
Built for anyone drowning in saved papers and scattered notes. Saves any arXiv link or PDF, auto-upgrades abstracts to full HTML, OCRs every figure with Claude Vision, then indexes everything in DuckDB with semantic embeddings. Search across figure panels by gene name or p-value, not just document titles. Auto-wikilinks new notes to related content already in your vault. Implements Ebbinghaus scoring to compress stale notes into PNG snapshots at 60-90% token reduction while keeping frequently accessed material at full fidelity. Exposes get_context, search_figures, search_notes, save_article, and update_goals over stdio. Pure Markdown vault, so you can sync via iCloud or git and switch agents anytime. Runs nomic-embed-text locally via llama-server with BM25 fallback.
A self-maintaining personal knowledge base for AI agents — a plain-Markdown vault, powered by MCP.
📖 English · 繁體中文
A local knowledge base your AI agent can read, write, and maintain on its own. Save a paper or note with one command — second-brain converts it to Markdown, OCRs every figure, embeds it for semantic search, and auto-links it to related notes. Notes you stop reading compress themselves over time, so recall stays cheap as the vault grows.
Everything is plain Markdown — sync via Google Drive / iCloud / git, switch agents anytime, zero lock-in.
save_article(url_or_pdf) fetches, converts to Markdown, OCRs figures (Claude Vision), embeds, and auto-links.search_figures("UMAP melanocyte") returns the exact panel across your whole library.get_context() reloads goals + top notes + rules at the start of every session.pip install mcp-second-brain
playwright install chromium
claude mcp add --scope user second-brain \
--env SECOND_BRAIN_PATH=~/second-brain \
-- python -m mcp_second_brain
The vault directory and templates are created on first run. Then tell your agent init_vault to verify.
⚠️ PyPI currently lags the source tree. For the newest build — plus Claude Desktop, Windows, and multi-machine / central-server setups — see NEW_MACHINE_SETUP.md.
| Tool | What it does |
|---|---|
get_context | Session start — goals + top-ranked notes + auto-rules |
save_article | URL / PDF → Markdown + figures + embeddings |
search_notes / search_figures | Hybrid BM25 + semantic search (note text / figure content) |
new_note / update_note / append_to_note | Create & edit notes (auto-filed, auto-indexed, auto-linked) |
vault_sleep | Compress old, low-activity notes |
get_agent_instructions | Serve the full filing SOP (AGENTS.md) to remote agents |
Full tool reference (30+ tools) lives in AGENTS.md.
Any source (paper · PDF · web · note)
│ save_article · new_note
▼
Markdown vault ──► index (DuckDB, or Postgres + pgvector)
00-inbox/ • BM25 + semantic search
10-projects/ • figure OCR + vision descriptions
20-areas/ • auto-wikilinks between related notes
30-resources/ • Ebbinghaus ranking → weekly auto-compression
decisions/ memory/
│
▼
Your AI agent queries it — search_notes · search_figures · get_context
The vault is the source of truth; the index is rebuildable anytime (sync_index). Filing conventions live in one operating manual — AGENTS.md — served to any agent via get_agent_instructions(), so every agent files things the same way without being re-taught.
vault/
├── 00-inbox/ Unprocessed captures
├── 10-projects/ Active projects
├── 20-areas/ Ongoing research / coding domains
├── 30-resources/ Papers & articles (save_article writes here)
├── 40-archive/ Auto-compressed originals
├── decisions/ Architecture Decision Records
├── memory/ goals.md · rules.md (injected every session)
└── templates/ Note templates
Inspired by biological memory: the Ebbinghaus forgetting curve (access_count / ln(age_days)) for ranking, and sleep-dependent consolidation (weekly LLM compression of low-access notes). Built with MarkItDown · DuckDB · pgvector · FastMCP · Playwright · Claude API.
MIT © 2026 Chan Chi Ru. See LICENSE.