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.
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.
| Operation | What you get | Closest analogy |
|---|---|---|
| Template | Flows, memory schema and seed procedures. No data. | GitHub template repo |
| Clone | Flows plus a snapshot of the agent’s memory | git clone of code and database |
| Branch | A copy-on-write fork of memory at a commit point | A branch of a branching database |
| Merge | Flow changes and reviewed procedure changes, promoted to the parent | Pull request |
| Inherit | A live or pinned link to another agent’s memory layer | A 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.
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.
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
- The compliance team publishes compliance v2.
- A3T branches each inheriting agent’s memory against v2. No data is copied.
- On each branch, A3T replays recent episodes or runs the agent’s regression flows in shadow mode, with side effects switched off.
- A3T produces an impact report per agent: which decisions would have changed, and why.
- v2 is promoted. Mandatory changes carry a grace period; after the deadline, agents still on v1 are blocked from running.
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
- Branch from production at the current commit point. It is instant and stores nothing until the branch writes.
- Run the new flows against real memory. Writes land only on the branch.
- Diff behaviour and memory against production.
- Rebase onto the latest production commit, since production kept moving while you tested, and re-run.
- Promote the flow and procedure changes. Data written during testing is discarded by default.
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.
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
| Memory | On branch | On promote |
|---|---|---|
| Working | Not branched | Discarded |
| Episodic | New append-only stream from the branch point | Kept as branch lineage, not merged |
| Semantic and graph | Copy-on-write, with deletes recorded as tombstones | Reviewed merge only |
| Procedural | Small, so copied outright | Merged 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:
- Would you use branch-and-promote for agent changes, or does your current testing already cover it?
- Is inherited, sealed compliance memory something your risk or compliance team would accept, or would they insist on copies they control?
- Which matters more to you first: developer branching, or governed rule propagation?
Comments here or on LinkedIn are welcome. A3T is at a3t.io.