Why AI coding needs persistent memory
Stateless AI assistants force teams into repeating the same conversation every session. We argue the missing piece isn't a smarter model but an infrastructure layer that gives AI engineering memory — and we walk through what that layer looks like in practice.
The problem with AI coding assistants is not that they’re bad at coding. They’re often very good. The problem is that they forget everything between sessions.
Last Friday at 11pm, your senior engineer fixed a race condition in the payment processor. They figured out that two concurrent calls could double-charge customers, that the fix was a Redis distributed lock with a 30-second TTL, and that the lock key needed to be the payment_id and not the user_id (because users with multiple cards could legitimately make concurrent payments). They wrote a 200-character commit message. The fix shipped.
Six months later, a new developer joins the team. They open the same file. They ask the AI for help. The AI suggests a clean implementation that’s textbook correct — and that contains the exact race condition your senior engineer fixed six months ago.
This is not a model intelligence problem. The latest models from Anthropic, OpenAI and Google are wildly capable. The problem is that the model has no memory of your specific codebase — its history, its decisions, its scars. Every session it starts from zero.
Three failure modes
We see this pattern repeat in every team that uses AI coding assistants seriously:
Context amnesia. Each session you re-explain your architecture, your conventions, your constraints. After three sessions, you stop bothering. The AI keeps generating code that almost works.
Pattern drift. Without memory, the AI invents its own patterns each time. Each suggestion is internally consistent and externally diverges from your codebase. After six months your repo has three competing service patterns and none of them is the original one.
Knowledge locked in heads. The senior engineer’s race-condition insight was never typed into a place the AI could read. It lives in the commit message, in the post-mortem doc, in the senior engineer’s brain. The AI sees none of it.
Why “just use a vector DB” isn’t enough
The natural reaction is to ship a Retrieval-Augmented Generation pipeline: chunk every commit, embed it, index it, and inject the top-k results into every prompt. Lots of teams have built this.
It improves things and it doesn’t solve the problem.
The reason is that commits are not decisions. The race-condition commit message says “fix concurrency in PaymentService”. It doesn’t say “we picked Redis distributed locks over optimistic concurrency control because we’re already on Redis for sessions and adding a second concurrency primitive doubles the failure modes”. The decision is in the post-mortem; the post-mortem is in Notion; Notion isn’t indexed.
You can’t fix this with bigger context windows or better embeddings. You fix it with structured capture. The AI assistant has to decide, mid-session, that this fact is worth saving — not just that something happened, but what was learned and why.
What the missing layer looks like
We think the missing piece is an infrastructure layer sitting between the AI assistant and the team. Concretely:
-
A persistent local store (we use SQLite with FTS5) that survives session boundaries. Not in the cloud, not in the model — on the developer’s machine, owned by them.
-
A protocol the AI speaks natively to read and write that store. The Model Context Protocol (MCP) has emerged as the de-facto standard, supported by Claude Code, Cursor, Windsurf, GitHub Copilot, Codex, OpenCode, Gemini CLI and VS Code.
-
A privacy boundary. The store has to redact secrets before any persist or sync. The default has to be local; the cloud sync has to be opt-in.
-
A discovery mechanism that runs at session start. When the AI opens
payments.tsit should automatically pull the last N decisions, patterns and incidents related to payments — without the developer doing anything. -
Enforcement at commit time. Memory alone is advisory. To prevent the AI’s race-condition reincarnation, you need a pre-commit gate that catches the violation before it becomes a PR.
We built Korva as an opinionated take on these five pieces. The code is open source (MIT) and runs on every developer’s machine as a single Go binary. There’s no cloud account, no telemetry, no vendor lock-in.
What changes when memory shows up
The clearest signal that this matters is what stops happening once it’s in place:
- The new dev who opens
payments.tssees avault_contextpayload that includes the race-condition incident from six months ago. They don’t reinvent the wheel. - Code review stops being the first place architecture violations show up. The pre-commit gate catches them on the developer’s machine.
- The senior engineer stops re-explaining “why we did event sourcing here”. The decision lives in the vault. The AI cites it without prompting.
- Onboarding a new contractor goes from two weeks to two days because their AI assistant has a working knowledge of your codebase from minute one.
None of this is hypothetical — these are the four most-mentioned wins from the dozen teams who’ve been running Korva in production since beta.
The infrastructure perspective
There’s a recurring pattern in software where the “infrastructure” piece — Kubernetes, Terraform, Datadog — is initially confused for a “tool”. The same is true here. AI memory is not a tool you bolt onto Cursor; it’s a layer that sits underneath every IDE on the team.
When that layer is missing, every team improvises. We’ve seen .cursorrules files with 800 lines of carefully-curated context. We’ve seen CLAUDE.md files duplicated across 40 repos with subtle drift. We’ve seen RAG pipelines that worked great for the first two months and then drifted.
When that layer is present and standardised — same Vault, same MCP tools, same Sentinel rules across every IDE — these workarounds disappear. The AI just remembers.
Where to go from here
If you want to try this on your own machine:
curl -fsSL https://korva.dev/install | bashkorva initkorva setup --allkorva vault startYou’re done. Open Cursor, Claude Code, VS Code or any of the 8 supported IDEs and your next AI session will pull from a local persistent vault.
If you’d rather read first, the Quickstart walks through the same flow with explanations, and the Vault concepts page goes deeper into the SQLite schema, the privacy filter, and the three MCP permission profiles.
The point is not Korva specifically — the point is that AI assistants without memory are giving you a fraction of what they could. Until they remember, every session starts from scratch. And every team will keep paying the same tax over and over.