SecondBrain is a persistent MCP memory server. Your agents remember context across every session - stored in a semantic wiki, a knowledge graph, and a vector index you fully control.
Built-in memory engines and simple lists work fine at first. Then they don't.
SecondBrain is not a simple key-value store. It's a full knowledge management system designed for AI agents.
When your agent calls recall(), SecondBrain runs three retrieval passes in parallel - vector similarity search (Qdrant), knowledge graph traversal (Neo4j), and direct Markdown lookup - then synthesizes a single coherent answer with an LLM.
A planning agent decides how to update the knowledge base - creating, extending, or merging wiki pages intelligently rather than dumping raw text.
Two tools: remember() and recall(). Drop into claude.ai, OpenClaw, or any MCP-compatible client with a single URL.
All knowledge is stored as plain Markdown with [[wikilinks]]. Sync to any Git host. Browse it in Obsidian. Your data, your format.
A background agent automatically cross-links related pages, resolves contradictions, and keeps the knowledge base coherent over time.
One docker compose up. Runs on your server. No third-party cloud, no data sharing, no subscription. MIT licensed.
Your agent sees two MCP tools. Under the hood, a multi-layer system handles everything.
remember(text)The input is split into independent topics and queued for async processing.
An LLM agent searches existing pages and determines what to create, update, or merge.
Markdown vault, Neo4j knowledge graph, and Qdrant vector index are all updated atomically.
recall(query)HybridRAG searches all three layers and returns a synthesized, contextual answer.
Docker Compose handles all dependencies - Neo4j, Qdrant, Redis, backend, and frontend.
git clone https://github.com/JonasKruegerCode/SecondBrain.git
cd SecondBrain
cp .env.example .env
# Set OPENROUTER_API_KEY and MCP_API_KEY in .env
docker compose up -d
# Web UI: http://localhost
# MCP: http://localhost:3000/mcp
URL: https://mcp.your-domain.com/mcp
API Key: your-secret-key
For local testing: expose port 3000 with ngrok or Cloudflare Tunnel.
SecondBrain is MIT-licensed and actively seeking contributors. Here's where you can have the most impact:
Support direct OpenAI / Anthropic keys without requiring OpenRouter as a proxy.
EnhancementUsage examples and patterns for common agent workflows - the most impactful contribution for new users.
DocsGitLab, Gitea, and self-hosted support. Currently only GitHub PAT auth is tested.
FeatureExpand integration test coverage and add GitHub Actions for pytest, ruff, and mypy on PRs.
TestingOpen an issue before starting work on a significant change.