All bits

Bit

Most AI coding agents either start every session with amnesia or drown in a 150k-token dump of stale context.

Treating context as a static prompt stuffed into one chat window breaks down across multi-repo systems. Over the past few months, I have been working on persistent memory architectures that pool live codebase state, architectural decision records, and operational observations into a cross-session knowledge graph:

  1. Persistent knowledge graph over ephemeral windows: Indexing repositories, synced docs, and verified engineering notes into a shared store gives agents durable recall of how a system evolved and why past architectural decisions were made.
  2. Decision-gated retrieval instead of eager dumps: Dumping full memory histories at the start of a run pollutes long-running agent sessions with irrelevant noise. Querying the graph dynamically only when an agent hits a decision point cuts token overhead and keeps context clean.
  3. Live code as primary truth: Weighting historical discussions and docs below the current repository state ensures agents never override working implementation with outdated notes.
  4. Scoped, permission-filtered context bundles: Passing each agent run a tightly scoped slice of the graph rather than unrestricted corpus access keeps multi-team boundaries intact.

Separating ephemeral session state from durable system memory is one of the biggest unlocks for getting coding agents to work reliably on large legacy codebases.