JJ
jj-valentine/cerebellum
Agent-readable second brain using PostgreSQL + pgvector for semantic search and memory storage.
Capture thoughts from anywhere. Retrieve them semantically. Every AI tool you use — Claude, Cursor, VS Code — connects to the same brain via a single MCP server.
How it works
capture "thought text"
↓
embed (text-embedding-3-small) + classify (gpt-4o-mini)
↓
Postgres + pgvector (Supabase)
↓
semantic_search / list_recent / stats ← any MCP client
Cost: ~$0.10–0.30/month at 20 thoughts/day.
Stack
| Layer | Tech |
|---|---|
| Storage | Supabase (Postgres + pgvector, HNSW index) |
| Embeddings | openai/text-embedding-3-small via OpenRouter |
| Classifier | openai/gpt-4o-mini via OpenRouter |
| Protocol | MCP (@modelcontextprotocol/sdk) |
| CLI | Node.js + TypeScript |
MCP Tools
| Tool | Description |
|---|---|
semantic_search |
Find thoughts by meaning, not keywords |
list_recent |
Retrieve thoughts by time window |
stats |
Totals, type breakdown, top topics & people |
capture |
Write to the brain from any MCP client |
CLI
npm run cli -- "I noticed that X tends to happen when Y" # capture
npm run cli -- search "project planning" # semantic search
npm run cli -- recent --days 7 --limit 20 # recent thoughts
npm run cli -- stats # overviewSetup
1. Clone and install
git clone https://github.com/jj-valentine/cerebellum
cd cerebellum
npm install2. Configure environment
cp .env.example .env
# Fill in SUPABASE_URL, SUPABASE_SERVICE_KEY, OPENROUTER_API_KEY3. Run schema in Supabase SQL editor
# Copy contents of schema/schema.sql → paste into Supabase SQL Editor → Run4. Build and register MCP server
npm run build
claude mcp add --transport stdio --scope user cerebellum -- node /path/to/dist/mcp/server.jsMetadata auto-extracted per thought
Each captured thought is automatically classified into:
- Type —
observation·task·idea·reference·people·preference - Topics — 1–3 tags
- Mentions — mentioned names
- Action items — implied next steps
License
MIT
On this page
Languages
TypeScript78.9%JavaScript15.4%PLpgSQL5.6%Shell0.1%
Contributors
Created March 6, 2026
Updated March 17, 2026