Why Plain Files Beat Vector Stores for AI Coding Agent Memory

Why Plain Files Beat Vector Stores for AI Coding Agent Memory

Jun 11, 2026 ai coding agents memory systems zerostack file-based storage developer tools context management

I have a confession to make. When I first started thinking about how to give AI coding agents persistent memory, my mind jumped straight to the trendy stuff. Vector embeddings. Semantic search. Embedding endpoints and similarity thresholds and all the infrastructure that comes with them.

Then I read about how someone built a memory subsystem for zerostack using nothing but plain text files, and something clicked.

The problem with memory in coding agents isn't storage—it's retrieval. You need the right information at the right moment without flooding the context window with everything you've ever known about a project. The sophistication isn't in how you store; it's in how you decide what to surface and when.

zerostack runs in about 16 MB of RAM. No daemon. No background process. It's one process that does its work and exits. That's a stark design philosophy, and it forces every decision through a tight filter: does this respect the constraints?

A vector store doesn't. It requires an embedding endpoint, which means another provider to configure, another API key to manage, another potential point of failure. For a tool that prides itself on running anywhere with minimal overhead, that's a heavy price.

Plain files, on the other hand, cost nothing. They're human-readable. They survive crashes. They're queryable with standard shell tools. The agent writes context to a file, and next session, it reads what it needs. No embedding pipeline, no semantic similarity calculations, no dependency on an external service.

The real design challenge becomes the boundary: what gets remembered, how much, and how do you prevent the system from slowly consuming an ever-larger portion of its context window? You need hard caps. You need to know when to stop injecting information so the session doesn't get dominated by history.

This is where the elegance of the file-based approach reveals itself. By keeping memory bounded and file-scoped, you get durability without complexity. The model can't remember everything, but it doesn't need to. It just needs access to what's relevant, and plain files give you exactly that—nothing fancy, nothing hidden, just structured text waiting to be read.

There's a lesson here for anyone building AI tools: reach for the simplest solution that solves the actual problem. Sophistication is not a virtue in itself. Sometimes the file system is the feature.

Read in other languages: