You know that sinking feeling when your AI assistant forgets who you are? You tell it your name, your preferences, your ongoing project — and the next conversation starts from scratch. It’s like talking to a goldfish with a PhD. The industry solution? Expensive, opaque vector databases that promise ‘persistent memory’ but actually just lock you into a platform you don’t control.
The most sophisticated AI memory is useless if you can’t see what’s inside — or if you’re paying rent for every single recall.
I got tired of that. So I built OpenCode-memory — a local, persistent memory system for OpenCode that stores everything in plain JSON files. No cloud, no vector embeddings, no API tax. Just a simple WRITE → DREAM → SURFACE architecture that any developer can inspect, debug, and modify with a text editor.
Here’s how it works: when your agent learns something important, it writes an explicit memory entry to a JSON file. During idle time, it ‘dreams’ — consolidating and linking those memories. When you need a relevant context, it ‘surfaces’ the most important memories. No black-box similarity search. No hidden costs. Just transparent, debuggable, local AI memory.
Complexity is the enemy of trust. If you can’t read your AI’s memory, you don’t own it.
I’m not saying vector databases are useless. For enterprise search over millions of documents, they’re fine. But for personal AI agents — the ones that hold your conversations, your habits, your private notes — the simple JSON approach wins. It’s faster to set up, cheaper to run, and infinitely more trustworthy.
This isn’t just a technical choice. It’s a philosophical one. The industry wants you to rent memory. I want you to own it.
FAQ
Q: Why not just use a vector database for better semantic search?
A: Because for personal AI agents, you don't need semantic search over millions of items. You need explicit, structured context that you can inspect and debug. Vector databases obscure that. JSON gives you human-readable memory.
Q: What's the practical implication for a developer building an AI agent?
A: You can set up persistent memory in under an hour with zero cloud dependencies. No API keys, no vector embeddings, no monthly bills. Your agent's memory lives in a folder you control. That's ownership.
Q: Isn't JSON too slow for real-time AI memory retrieval?
A: Surprisingly, no. For typical personal agent usage (hundreds to thousands of memories), a local JSON store is faster than a network call to a vector database. The bottleneck is almost never the file system — it's the latency of remote services.