brain

A CLI for sharing knowledge across a dev team.
Markdown in git. Searchable via FTS5.
Accessible to AI agents through MCP.

$ git clone https://github.com/vraspar/brain.git && cd brain && npm install && npm run build && npm link

How it works

1. Create
$ brain init --name "My Team"
✅ Brain "My Team" is ready!
2. Import
$ brain ingest https://github.com/acme/docs.git
✅ Ingested 24 entries from acme/docs 💡 8% stale. Run 'brain prune --dry-run' to review.
3. Share
$ brain push ./guide.md
✅ Pushed: Docker Multi-Stage Builds Tags: docker (auto-detected)
4. Discover
$ brain search "kubernetes"
Found 3 results: +------------------------+--------+-------+-----------+ | Title | Author | Type | Tags | +------------------------+--------+-------+-----------+ | K8s Deployment Guide | bob | guide | k8s | | CI Pipeline | carol | guide | ci, k8s | | Helm Chart Patterns | alice | skill | helm, k8s | +------------------------+--------+-------+-----------+

Why brain?

Git as storage

Entries are markdown in a git repo. No server to run. No infrastructure to manage. Version history and access control come from git.

FTS5 search

SQLite FTS5 with BM25 ranking, prefix matching, and contextual snippets. Sub-millisecond search. Works offline.

MCP server

5 tools and 2 resources exposed via Model Context Protocol. AI agents can search, read, and publish entries. brain serve starts the server.

Repo ingest

Seed your brain from existing repos. brain ingest <url> scans for markdown, auto-detects titles and tags, and scores freshness at import.

Freshness scoring

Entries scored as Fresh, Aging, or Stale based on recency and read frequency. brain prune archives what's stale. brain restore brings it back.

Knowledge trails

Auto-computed links between entries. brain trail <topic> follows connections across your team's knowledge.

brain connect https://github.com/acme/brain-hub.git

Works with your AI agent

Add to your MCP client config:

mcp.json
{ "mcpServers": { "brain": { "command": "brain", "args": ["serve"] } } }

5 tools: push_knowledge · search_knowledge · whats_new · get_entry · brain_stats
2 resources: brain://digest · brain://stats

Your agent can search team knowledge, publish findings, and check what's new.

Claude · Copilot · Cursor · Windsurf

Quick start

# Install
$ git clone https://github.com/vraspar/brain.git
$ cd brain && npm install && npm run build && npm link
 
# Create a brain
$ brain init --name "My Team"
 
# Or join an existing one
$ brain connect <url>

Requires Node.js 20+ and git.

Under the hood

brain push / brain search / brain digest
CLI
Git repo storage
SQLite FTS5 search
Receipts analytics
Storage Markdown + YAML frontmatter in a git repo
Search FTS5 virtual table, rebuilt on sync
Analytics JSON receipts, eventually consistent