See your agents built, governed and running in a 30-minute walkthrough. Book a demo →
← All posts

Agents as Repos: Inheritance, Memory Branching and Governed Evolution in A3T

Template, clone, branch, merge and inherit, for an agent's flows and its memory. A design post on how A3T and ADB will let agents share rules, test against real memory and change safely.

Sriram 10 min read
A git-style graph of agent memory, with a production line, a branch for a new recall flow and a mounted compliance layer, under the title Agents as Repos.

Why agents need version control for what they know

An agent is two things: the flows it runs and the memory it has built up. We version the first like code and treat the second like a throwaway cache. That breaks as soon as agents are shared across teams, inherit rules from other agents, or need to be changed safely in production.

In A3T we are designing agents to behave like repositories. You can start from a template, clone an agent with its memory, branch that memory to try something, and promote what works. Think GitHub for the flows and a branching database for the memory, in one system.

This is a design post, not a launch. The engine underneath is real, but the branching and inheritance model described here is what we plan to build. I am publishing it to get feedback before the API sets in stone.

The model: five operations, four kinds of memory

Every A3T agent is a pair: flows (CNCF Serverless Workflow definitions plus agent code) and memory (held in ADB, A3T’s agent memory engine). The operations act on both.

OperationWhat you getClosest analogy
TemplateFlows, memory schema and seed procedures. No data.GitHub template repo
CloneFlows plus a snapshot of the agent’s memorygit clone of code and database
BranchA copy-on-write fork of memory at a commit pointA branch of a branching database
MergeFlow changes and reviewed procedure changes, promoted to the parentPull request
InheritA live or pinned link to another agent’s memory layerA mounted, read-only dependency

Not all memory behaves the same way, so each operation treats each kind differently:

  • Working memory is the chat log and LLM scratchpads. It is never branched or inherited.
  • Episodic memory is the timestamped record of what the agent did, including workflow checkpoints. It is append-only and stays private to the agent that wrote it.
  • Semantic memory is facts and the knowledge graph. It can be inherited and branched, and is the hardest to merge.
  • Procedural memory is the deterministic procedures the agent runs on its hot path. It is the most valuable to share, and merges as reviewed diffs.

Inheritance comes in three modes. Mount follows the parent live. Pin follows a chosen version and upgrades on request. Fork takes a snapshot and diverges.

Use case 1: agents that inherit from other agents

Inheritance lets a new agent start with everything a parent knows and add only what is new.

A lineage of chat agents

We run an internal chat agent in A3T. Its template is a generic system chat agent. We extended it into an A3T chat agent by adding platform hooks, and we use that inside our crawl project. That is three generations: system chat, A3T chat, crawl chat.

With copied templates, the three drift apart. Fix a recall bug in the system chat agent and you fix it three times. With lineage, each child records which version of its parent it came from, and pulls fixes like a dependency upgrade. That is the first thing we build, because it pays off even when memory is empty.

Three generations of chat agents. system-chat is the template; a3t-chat extends it and adds platform hooks; crawl-chat extends a3t-chat. A recall fix released in system-chat v4 is pulled into a3t-chat as a version upgrade, not copied by hand. TEMPLATE system-chat generic chat agent · v4 recall, summarise, cite fixed in v4: recall bug CHILD a3t-chat extends system-chat@3 → @4 + platform hooks records its parent version GRANDCHILD crawl-chat extends a3t-chat@2 + crawl project flows pulls fixes through a3t-chat extends extends fix once: upgrade @3 → @4, re-run tests then crawl-chat upgrades a3t-chat
Lineage: each child records the parent version it extends, so a fix in the template reaches its descendants as an upgrade, not a copy.

A trading agent that inherits compliance

The case that matters more is inheriting memory, not just flows. Imagine a compliance agent owned by the compliance team. Its memory holds the rules, a knowledge graph of regulations, and procedures such as check_trade and log_breach.

A desk builds a new trading agent. Instead of re-implementing compliance, the trading agent mounts the compliance agent’s memory as a read-only layer and adds its own flows on top:

  • From the compliance agent it inherits semantic memory (the rules) and procedural memory (callable compliance procedures).
  • It does not inherit the compliance agent’s episodic memory. That history stays private.
  • Its own layer holds the trading flows, its own procedures and its own history.

Two rules keep this safe. Inherited constraints are sealed: the trading agent can call check_trade but cannot shadow or rewrite it. And precedence is decided by policy, not by which layer sits on top. The compliance team owns its layer; the desk owns everything else.

The trading agent is two layers. Its own layer, owned by the desk, holds trading flows, its own procedures and its own history. Under it sits the compliance agent's memory, mounted read-only and sealed: semantic rules and procedural check_trade and log_breach. The compliance agent's episodic history stays private and is not inherited. TRADING-AGENT · WHAT IT SEES Own layer owned by the desk · read-write flowsprice → route → execute proceduralsize_order, hedge episodicits own history Compliance layer SEALED semanticrules, regulation knowledge graph proceduralcheck_trade(), log_breach() callable, never shadowed or rewritten · read-only Precedence between layers is decided by policy, not by which layer sits on top. COMPLIANCE-AGENT Shared memory semantic rules, regulation KG procedural check_trade, log_breach released as v1, v2, … episodic its own history PRIVATE mount or pin not inherited by any child
The trading agent reads through two layers: its own, and the compliance layer it mounts. The compliance agent's history never crosses over.

Use case 2: governance — what happens when the rules change

When the compliance agent publishes new rules, every agent that mounts it should move to them, but not blindly. A rule change can block trades that a downstream flow relied on yesterday. Branching turns that risk into a report.

A rule change, step by step

  1. The compliance team publishes compliance v2.
  2. A3T branches each inheriting agent’s memory against v2. No data is copied.
  3. On each branch, A3T replays recent episodes or runs the agent’s regression flows in shadow mode, with side effects switched off.
  4. A3T produces an impact report per agent: which decisions would have changed, and why.
  5. v2 is promoted. Mandatory changes carry a grace period; after the deadline, agents still on v1 are blocked from running.
A compliance rule change in five steps: publish v2, branch every inheriting agent against v2 without copying data, replay recent episodes in shadow mode with side effects off, produce an impact report per agent, then promote v2 with a grace period, after which agents still on v1 are blocked. 1 · PUBLISH compliance v2 new rules released 2 · BRANCH every child memory against v2 3 · REPLAY shadow mode side effects off 4 · REPORT impact per agent, with why 5 · PROMOTE v2 goes live then enforced trading-agentbranch @v2 fx-desk-agentbranch @v2 ops-recon-agentbranch @v2 branches are metadata: no memory is copied Impact report · compliance v2 trading-agent3 decisions change check_trade: limit 5M → 2M blocks 3 orders fx-desk-agentno change ops-recon-agent1 decision changes log_breach now required on late fills v2 promoted grace period deadline: v1 agents blocked
A rule change becomes a branch and a replay per inheriting agent. The impact report shows who is affected before anything goes live. Agent names and numbers are illustrative.

The report answers the question compliance teams actually ask: if we change this rule, what breaks, and who is affected? Today that is a manual exercise across teams. Here it is a branch and a replay.

Point-in-time audit

Every decision an agent makes records the commit point of its memory and the version of each inherited layer. So you can answer “what did this agent know, and which compliance version was it running, at 14:32 on 3 March?” by reading the memory as of that commit. For regulated firms this matters as much as the decision itself.

Who controls what

  • The compliance team owns the compliance layer and its release schedule.
  • Desks own their own layers and cannot edit inherited ones.
  • Which agents may mount which layers, and who may branch production memory, is policy, enforced at fork time and at every tool call.

Use case 3: developers testing against real memory

The developer case needs no inheritance at all. It is pure branching: test a change against production memory without touching production.

Agents are hard to test because their behaviour depends on what they have learned. A fresh test agent with empty memory tells you little. A copy of production memory is slow, expensive and a data-handling problem. A branch is neither.

The loop

a3t agent branch support-bot --from prod --name try-new-recall
# edit flows, run them against the branch
a3t agent diff try-new-recall prod
a3t agent rebase try-new-recall --onto prod
a3t agent promote try-new-recall --flows --procedures
  1. Branch from production at the current commit point. It is instant and stores nothing until the branch writes.
  2. Run the new flows against real memory. Writes land only on the branch.
  3. Diff behaviour and memory against production.
  4. Rebase onto the latest production commit, since production kept moving while you tested, and re-run.
  5. Promote the flow and procedure changes. Data written during testing is discarded by default.
Production memory commits c1 to c5. A branch, try-new-recall, starts at c2 and runs new flows against real memory, writing only to the branch. Production keeps committing. The branch is rebased onto c5 and re-run, then its flow and procedure changes are promoted as c6. Test data written on the branch is discarded. PROD c1c2 c3c4 c5c6 production keeps committing 1 · branch at c2 try-new-recall 2 · run new flows, 3 · diff vs prod 4 · rebase --onto prod, re-run 5 · promote flows, procedures × test writes discarded
The developer loop: branch, run, diff, rebase, promote. Only flows and procedures reach production; the branch's test writes do not.

Guarantees a developer gets

  • No side effects by default. Memory is branched, but the outside world is not. On a non-production branch, tasks that place orders, send messages or call external APIs are mocked or blocked unless policy explicitly allows them.
  • Promote changes, not test data. Promoting flows and procedures is routine. Promoting data from a branch is a separate, reviewed action.
  • Reproducible tests. A branch pins inherited layers at the version live when it was created, unless you choose to test against an upcoming one.
  • Rollback for free. A bad procedure update or a bad memory compaction is undone by resetting to an earlier commit.
  • Same access rules as production. A branch inherits its parent’s policies, including field masking for roles that should not see client data.

How it works in A3T and ADB

A branch is metadata, not a copy. It costs nothing to create and grows only with what it writes. That follows from how ADB stores memory.

One commit log gives every write a position across all memory stores. The branch point is log position 1042. The production snapshot at 1048 lists segments S1 to S4. The branch's manifest lists the same immutable segments S1 to S3, pinned so compaction keeps them, plus its own delta D1 with its writes and tombstones. Nothing is copied. ONE COMMIT LOG · EVERY MEMORY STORE 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 branch point prod head prod snapshot @1048 manifest → S1 S2 S3 S4 branch @1042 manifest → S1 S2 S3 + D1 SHARED · IMMUTABLE SEGMENTS S1episodic S2graph S3procedural retention pin: kept through compaction S4 · prod onlywritten after 1042 D1 · branch onlywrites + tombstones Before branching, the write buffer is flushed up to 1042, so the branch starts from a clean snapshot.
Production keeps committing after the branch point; the branch never sees those commits until it rebases. Both manifests point at the same immutable segments, and the branch adds only its own delta.

What ADB already gives us

  • Immutable segments. Each memory store (episodic, semantic and graph, procedural) is columnar data in immutable segments. Segments are never edited in place.
  • Snapshots. Every commit writes a small snapshot manifest listing which segments and indexes make up that version. Older snapshots stay readable, so any committed version can be read as it was.
  • One commit log across models. Writes go through a write buffer and a durable log, LSM-style, and are compacted into segments in the background. The log gives every commit a single position, across all memory stores.

Branching on top of that

  • A branch point is a log position. ADB maps that one position to the matching snapshot of every memory store. That gives a consistent cut: a branch can never see a graph edge whose source episode does not exist yet.
  • A branch is a new manifest. It references the parent’s segments where they live and sends its own writes to its own location. Reads see the parent’s snapshot plus the branch’s own changes.
  • Flush before branching. Data still in the write buffer is flushed up to the branch point, so the branch starts from a clean snapshot.
  • Retention pins. Background cleanup and compaction normally drop old snapshots. A branch pins the snapshot it depends on, so the parent can keep compacting without deleting what the branch still reads.

Per memory type

MemoryOn branchOn promote
WorkingNot branchedDiscarded
EpisodicNew append-only stream from the branch pointKept as branch lineage, not merged
Semantic and graphCopy-on-write, with deletes recorded as tombstonesReviewed merge only
ProceduralSmall, so copied outrightMerged as reviewed diffs

Indexes

Vector and graph indexes are built against the parent’s segments. A branch reuses them, and searches its own small delta directly or through a small branch index. When a branch is promoted, indexes are rebuilt properly on the result.

Inheritance uses the same machinery

A mounted layer is a reference to another agent’s memory at its latest snapshot. A pinned layer is a reference to a tagged snapshot. A fork is a branch with no upstream link. Policy decides who may mount, pin or fork, and which memory types each may carry across an organisation boundary.

Hard problems, and where I want feedback

Some of this is straightforward engineering. Some of it is genuinely open.

  • Merging semantic memory. Two branches can learn conflicting facts. Last-writer-wins is wrong for a knowledge graph, and source-priority rules need to be configurable. For now we only merge flows and procedures, and treat graph merges as reviewed and manual.
  • Branch chains. A branch of a branch of a branch makes every read walk several layers. We plan to flatten a branch once its depth or delta size crosses a threshold. What threshold works in practice is unknown.
  • Side effects. Mocking external calls on a branch is easy to state and hard to make complete. Every task type needs a declared side-effect class, and anything undeclared is blocked on non-production branches.
  • Memory that crosses organisations. Forking a template to another company should carry procedures and schema, never episodes or client data. The policy model for that boundary needs real users to test it.
  • Cost of mounted layers. A compliance layer mounted by a hundred agents is read by all of them. Caching and isolation for hot shared layers is still to be designed.

Three questions I would like answered by people who run agents in production:

  1. Would you use branch-and-promote for agent changes, or does your current testing already cover it?
  2. Is inherited, sealed compliance memory something your risk or compliance team would accept, or would they insist on copies they control?
  3. Which matters more to you first: developer branching, or governed rule propagation?

Comments here or on LinkedIn are welcome. A3T is at a3t.io.