Initialize AgentDB
Sets up a fresh AgentDB instance for the current project. Creates a single-file .rvf Cognitive Container that holds vectors, indexes, learning state, and the audit log.
When to use
- User asks to "set up agentdb", "init memory", "add a vector store"
- New project that needs persistent agent memory
- Existing project moving from in-memory state to durable memory
Steps
- Confirm the storage path (default:
./memory.rvfat the project root, or~/.agentdb/<project-name>.rvffor global memory). - Pick the embedder (default:
Xenova/all-MiniLM-L6-v2at 384d — fast, free, runs in-process). - Register the agentdb MCP server in Claude Code:
claude mcp add agentdb -- npx agentdb@latest mcp start - Initialize the file via the MCP tool
agentdb_pattern_store(the first store auto-creates the schema), or via CLI:npx agentdb@latest init ./memory.rvf - Add
*.rvfto.gitignoreunless the user explicitly wants memory checked into source control. - Confirm with a smoke test: store one pattern and search for it.
Notes
- The
.rvfis a single binary file. Back it up like a SQLite database. - For multi-agent setups, share one
.rvfper coordinated namespace; use separate files for trust-boundary isolation. - All AgentDB operations after init go through the MCP tools (
agentdb_pattern_*,agentdb_reflexion_*, etc.) or the npm library (import { SelfLearningRvfBackend } from 'agentdb').
Don't
- Don't commit the
.rvffile by default — it can hold session-specific data, including content from messages. - Don't run
initon an existing.rvffile without confirming — it will refuse rather than overwrite, but a confused user might delete the existing file thinking it's stale.