Skip to main content
Repo memory is a structured model of a repository — its architecture, patterns and conventions — that coding agents read before they change anything. Every claim in it carries a line-number reference to the file that supports it.

What does repo memory give an agent?

  • Evidence-backed claims: All assertions link to specific file locations
  • Branch inheritance: Child experiments inherit parent’s memory
  • Bounded prompts: Summary + TOC keeps context manageable
  • Section-based access: Agents can read specific sections on demand

Schema

Core sections

How do I build and read it?

Ensure memory exists

Render for prompts

Output:

Get specific section

Bootstrap from existing repo

Update after experiment

max_retries counts repair attempts after the first response. Kapso selects and reads repository files once, then asks the model to repair only malformed JSON or an invalid outer schema. Provider, authentication, transport, and configuration errors are not retried.

What happens when it fails?

RepoMemory is optional enrichment; experiment code and evaluation results are the primary artifacts. Search strategies therefore default to warning when a baseline or per-experiment memory update fails:
  • warn logs the enrichment error, then still pushes the candidate branch and cleans up the coding agent session.
  • fail still performs branch push and cleanup, then re-raises the original RepoMemory error.
  • Invalid policy values and negative or non-integer retry counts fail during strategy/workspace setup.
Direct calls to RepoMemoryManager.bootstrap_baseline_model() and update_after_experiment() always raise if structured-response repair is exhausted. The warn/fail policy is applied by the search/session lifecycle.

Where is it stored?

RepoMemory is stored at .kapso/repo_memory.json in each repository.

How does it travel between experiments?

When experiments branch from a parent:
  1. Child branch inherits parent’s .kapso/repo_memory.json
  2. After experiment runs, memory is updated with new understanding
  3. Memory is committed to the branch
  4. Future children of this branch inherit the updated memory

How are its claims verified?

Every claim carries a line-number reference — {path, line, description} — into the file it came from. The builder validates the model’s shape (a summary and well-formed sections); it does not re-check the referenced lines, because a line number is a pointer rather than a quotable assertion: the model is trusted as-is, and the quality block records evidence coverage.

How do agents read it?

For Claude Code agent, RepoMemory is accessible via MCP tools:
The section ids are the seven from the Core Sections table.

Integration with coding agents

The generic strategy’s implementation prompt opens with the memory’s rendered summary and TOC:
The prompt also tells the agent to pull detailed sections on demand through the repo_memory MCP gate (get_repo_memory_section(section_id="core.architecture")), so the full memory never has to ride in the prompt.

Quality metrics

Coding agents

Who reads repo memory

Experiment lifecycle

Where it is built and updated
Related pages: Coding agents · Experiment lifecycle · Orchestrator Kapso is an open-source framework by Leeroo that builds software toward measurable goals through experiment campaigns. Source code: github.com/Leeroo-AI/kapso · Install: pip install leeroo-kapso · Every page as plain text: llms.txt.