Skip to content

Per-agent memory

Durable facts and a rolling log that carry what agents learn across runs.

Agents can maintain persistent memory across runs. Place a MEMORY.md file alongside AGENT.md to enable it. Memory has two parts:

  • Durable facts (memory/<agent-name>/facts.md in the state directory): things that stay true across runs, like project conventions, rejected findings and why, and mechanisms the project already has. The agent returns new ones in memoryFacts, and vteam appends them as - lines, skipping exact duplicates. No LLM ever rewrites this file, so a fact stays until you delete it. vteam status asks you to prune it once it passes 50 lines.
  • Rolling log (memory/<agent-name>/store.md): what recent runs did. The agent returns memoryUpdate, and vteam appends it under a heading with the date, status, task, and pull request. When the log passes its line budget, a curation agent compacts it following the rules in MEMORY.md:
vteam/agents/improver/MEMORY.md
Keep a running list of areas scanned and key patterns observed.
When compacting, drop the oldest entries first.

Tell the agent what counts as a fact in its AGENT.md; the default agents end with a ## Memory section that does this.

The curation agent’s model and tools go in the memory section of agent.json, e.g. "memory": { "model": "haiku" }.

  1. Before each run, the orchestrator injects the facts and the log into the prompt (### Durable Facts, ### Recent Runs)
  2. The agent may include memoryFacts (a list of strings) and memoryUpdate (a string) in its structured JSON output
  3. After the run, the orchestrator appends the new facts to facts.md
  4. If there is a memoryUpdate, the orchestrator appends it to store.md under a heading such as ### 2026-12-02 14:03 · completed · task "Fix login" · PR https://…
  5. If the log now has more non-blank lines than maxLines, a small curation agent compacts it according to the MEMORY.md rules (it never sees the facts). vteam keeps the previous log in store.md.prev, and refuses a compaction that is empty or drops most of the log

Memory files live in the project’s state directory, not in the repository; they are local workflow state. A curation agent failure is non-fatal and does not affect the agent run’s exit status.

memory field Default Description
model none Claude model override for the curation agent
allowedTools none Tools the curation agent may use
disallowedTools none Tools the curation agent may NOT use
maxLines 40 Non-blank lines the log may reach before it is compacted

Memory is opt-in: agents without a MEMORY.md skip it entirely, and a memory section without MEMORY.md is a load error. vteam init scaffolds a default MEMORY.md for each built-in agent.