brain2
A database-first personal knowledge management system powered by a local MCP server, providing 29 tools to manage and search structured knowledge (meetings, emails, people, accounts, projects, todos, etc.) via a single SQLite file.
README
brain2
Database-first personal knowledge management system powered by a local MCP server. All data lives in a single SQLite file. Claude accesses it via 29 MCP tools through Claude Desktop or Claude Code.
Replaces an earlier Obsidian vault-based system with structured storage, semantic search, and automated ingestion pipelines.
Features
- Unified knowledge store — meetings, emails, chats, notes, people, accounts, projects, todos, ideas, and resources in one database
- Knowledge graph — flexible edges between any entities (mentions, related_to, attended, about, etc.)
- Hybrid search — FTS5 full-text search + sqlite-vec vector similarity (384-dim, all-MiniLM-L6-v2)
- Watermark-based ingestion — incremental M365 email sync with dedup (Teams chat sync currently unavailable)
- Dreaming — connection building, person summaries, account health assessment, and theme discovery — runs at the end of each sync
- Daily digest — morning briefing with meetings (account context, open threads, heads-up) and overdue todos
Requirements
- Node.js 20+
- Claude Desktop or Claude Code (for MCP integration)
- Microsoft 365 MCP (for email/chat ingestion)
Setup
npm install
Configure MCP
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json) or Claude Code config (~/.claude/mcp.json):
{
"mcpServers": {
"brain2": {
"command": "npx",
"args": ["tsx", "/path/to/brain2/src/index.ts"],
"env": {
"BRAIN2_DB": "/path/to/brain2/data/brain2.db"
}
}
}
}
Import from Obsidian vault (optional)
npx tsx src/index.ts --import-vault ~/path/to/obsidian-vault
Parses frontmatter, tables, and imports all entity types (meetings, emails, chats, people, accounts, projects, todos, resources).
Usage
npx tsx src/index.ts # Start MCP server (stdio)
npm test # Run tests
npx tsc --noEmit # Type-check
Once the server is running, Claude can use all 26 tools and 4 skill prompts through natural conversation:
- "What's happening with the Dell account?" — searches items, gets account profile and contacts
- "Process my emails" — runs the email ingestion pipeline
- "Who have I met with most this month?" — queries the knowledge graph
- "Add a todo to follow up with Sarah by Friday" — creates a todo with due date
Architecture
data/brain2.db SQLite + sqlite-vec + FTS5
data/models/ Cached embedding model (all-MiniLM-L6-v2)
src/
index.ts Entry point (stdio MCP transport + vault migration CLI)
server.ts MCP server setup and tool registration
db/
connection.ts SQLite connection with sqlite-vec extension
schema.ts Table definitions and migrations
tools/
ingest.ts Ingest meetings, emails, chats, notes (5 tools)
entities.ts Upsert people/accounts/projects, manage todos (6 tools)
query.ts Get/list items, people, accounts (6 tools)
search.ts Hybrid FTS5 + vector search (1 tool)
graph.ts Edges and knowledge graph traversal (3 tools)
synthesis.ts Save/retrieve dreaming syntheses (2 tools)
watermark.ts Ingestion watermark tracking (3 tools)
stats.ts Database stats and portfolio view (2 tools)
embeddings/ Local embedding generation via @xenova/transformers
search/ Hybrid search ranking logic
migration/ Obsidian vault import
utils/ Hashing, ID generation
prompts.ts Registers skills as MCP prompts for Claude Desktop
skills/ Skill prompts (MCP prompts + Claude Code skills)
brain-sync.md Sync M365 → brain2 (email + chat) + dream + lint
brain-day.md Daily prep brief
brain-note.md File user notes to calendar meetings
brain-extract.md Extract reusable knowledge from work sessions
Skills
Skills are available as MCP prompts in Claude Desktop (via the / menu) and as Claude Code skills (via ~/.claude/skills/). Both read from the same skills/*.md files.
| Skill | Description |
|---|---|
brain-sync |
Sync M365 emails with verification, then dream + lint (Teams chat unavailable) |
brain-day |
Daily prep brief — meetings with account context + overdue todos |
brain-note |
File user notes by matching them to calendar meetings |
brain-extract |
Extract reusable knowledge from work sessions |
Data Model
Core entities
- items — unified table for meetings, emails, chats, notes
- people — one row per person with contact info (name, title, company, email, phone)
- accounts — customer accounts with health, platform, segment, ARR
- projects — active work with status tracking
- todos — action items with priority, due date, source item, assignee
- ideas / resources — captured ideas and reference material
Relationships
- item_people — who attended/participated in which item
- account_contacts — people linked to accounts with roles (ae, csa, se, tam, etc.)
- edges — generic typed relationships between any entities
- tags — flexible tagging on any entity
Search
- FTS5 index on item content and titles
- sqlite-vec 384-dimensional vectors for semantic similarity
- Hybrid ranking combines both signals
License
Private.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.