Why we chose plain files over vector databases for AI agent memory
Whenever developers talk about giving long-term memory to AI agents, the default advice is almost always: "Spin up a vector database."
When building MemoFS, we decided to take the opposite approach and store all agent memory as plain Markdown and JSON directly on local disk (.memofs/) instead.
Here’s why we think files beat remote vector databases for both agent users and builders:
Inspectability & Git Tracking
Vector databases are opaque black boxes. When an agent hallucinates or makes a bad assumption, you can’t "cat", "grep", or "git diff" a vector store. With files, memory debugging is just text editing, and every memory change can be versioned and rolled back with Git.
Exact Symbol Lookups
Pure cosine similarity often fails when agents need exact code symbols, API routes, or configuration flags. Hybrid lexical retrieval (BM25) paired with local ONNX embeddings solves this without network overhead.
Sub-Millisecond Speed & Zero API Keys
Local in-process memory runs in ~0.6ms offline with zero external API keys required—compared to 150ms+ latency and vendor lock-in with cloud databases.
Write-Time Intelligence
Instead of dumping noisy conversation logs into an index, MemoFS filters secrets/PII and classifies durability before writing anything to disk.
We’d love to hear from the Product Hunt community:
If you use coding agents (Cursor, Claude Code, etc.): What is the #1 thing your agent forgets that annoys you the most?
If you build AI agents or bots: How are you currently solving persistent memory and state across sessions?
Looking forward to hearing your thoughts and workflows! 🚀
Replies