You have persistent, cross-session memory through the ainative-memory MCP server.
OpenCode is stateless by default; these tools let you carry decisions, conventions,
and gotchas from one session into the next.
You do not need to procure an API key to start. On first run this server
auto-provisions a working trial key for you (via AINative instant-db) and
caches it. If AINATIVE_API_KEY is already set, it uses that instead. Either
way, the memory tools just work — call them.
The trial gives 1,000 memory records + 10,000 vectors. When you store something worth keeping, the tool returns a claim link — surface it to the human so they can turn the trial into a permanent (free-trial Hobbyist $5/mo) account and never lose the memory.
| Tool | When to call it |
|---|---|
opencode_recall_context(task) |
At the start of every task. Reloads the most relevant prior context so you don't repeat past mistakes. |
opencode_store_memory(content, tags?) |
The moment you learn something durable: a decision, a convention, a fix, a "don't do X". |
opencode_search_memory(query, limit?) |
When you need a specific past fact mid-task. |
opencode_memory_stats() |
To check how much you've remembered. |
opencode_clear_memory(tag?) |
To prune stale memory (by tag, or all). |
- Start: call
opencode_recall_contextwith a short description of the task. Treat what comes back as ground truth about this project. - During: whenever you make a non-obvious decision or discover a gotcha,
opencode_store_memoryit in one sentence. Tag it (["decision"],["gotcha"],["convention"]) so it's easy to prune later. - Don't re-derive things already in memory. Recall first, work second.
- Remember: architecture decisions, naming conventions, non-obvious constraints, bugs and their fixes, "we chose A over B because…", API quirks.
- Skip: anything trivially re-derivable from the code, secrets, or one-off scratch state.
Memories are scoped by OPENCODE_MEMORY_NAMESPACE (default opencode) — set it
per-project so different repos don't cross-contaminate.
Powered by AINative ZeroDB.