Local-first MCP memory hub for AI coding tools. MVP target: OpenCode.
This repo ships a minimal, production-practical setup using agent-memory-mcp (LanceDB + hybrid BM25/vector search + local embeddings) to solve context loss from compaction.
- Hybrid search (BM25 + vector) improves recall over pure vector or pure graph memory.
- Fully local: no API keys, no network dependency after model download.
- MCP-compatible: works across CLI/TUI/GUI tools that speak MCP.
- Ready-to-use MCP config templates
- macOS LaunchAgent setup for always-on memory server
- Clean directory layout for local storage
- macOS (MVP target)
- Node.js 18+ with npm
- Install the MCP server globally (downloads ONNX model once):
npm install -g @adamrdrew/agent-memory-mcp- Create local storage paths:
mkdir -p ~/.openbrain/memory-db ~/.openbrain/hardcopy ~/.openbrain/logs- Configure OpenCode MCP (project-level):
Copy config/opencode.mcp.json to .mcp.json in your project and edit paths.
- Start server manually (for quick test):
MEMORY_DB_PATH="$HOME/.openbrain/memory-db" \
ENABLE_HARDCOPY=true \
HARDCOPY_PATH="$HOME/.openbrain/hardcopy" \
MEMORY_DECAY_HALF_LIFE=30 \
agent-memory-mcpUse this as .mcp.json in your OpenCode project:
{
"agent-memory": {
"command": "agent-memory-mcp",
"env": {
"MEMORY_DB_PATH": "/Users/you/.openbrain/memory-db",
"MEMORY_DECAY_HALF_LIFE": "30",
"ENABLE_HARDCOPY": "true",
"HARDCOPY_PATH": "/Users/you/.openbrain/hardcopy"
}
}
}Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"agent-memory": {
"command": "agent-memory-mcp",
"env": {
"MEMORY_DB_PATH": "/Users/you/.openbrain/memory-db",
"MEMORY_DECAY_HALF_LIFE": "30",
"ENABLE_HARDCOPY": "true",
"HARDCOPY_PATH": "/Users/you/.openbrain/hardcopy"
}
}
}
}- Edit
scripts/macos/com.mihai-codes.openbrain.agent-memory.plistand update the path to this repo. - Load it:
launchctl unload ~/Library/LaunchAgents/com.mihai-codes.openbrain.agent-memory.plist 2>/dev/null || true
cp scripts/macos/com.mihai-codes.openbrain.agent-memory.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.mihai-codes.openbrain.agent-memory.plist~/.openbrain/
memory-db/ # LanceDB
hardcopy/ # optional JSON mirror
logs/
agent-memory-mcp is GPL-3.0. This repo only provides configuration and glue. If you embed or redistribute a derivative, GPL obligations apply.
- Hindsight: stronger structured memory and ranking, heavier stack. Good for long-horizon tasks.
- mcp-knowledge-graph: explicit entities/relations, weaker fuzzy recall.
- memory-lancedb-pro (OpenClaw plugin): MIT, hybrid + rerank; can be used as an alternative pattern.
- agent-memory-mcp: https://github.com/adamrdrew/agent-memory-mcp
- mcp-knowledge-graph: https://github.com/shaneholloman/mcp-knowledge-graph
- Hindsight: https://github.com/vectorize-io/hindsight
- memory-lancedb-pro: https://github.com/win4r/memory-lancedb-pro