GBrain
An open-source CLI and TypeScript library that gives AI agents a persistent, searchable knowledge base built from markdown files, with hybrid vector+keyword search powered by Postgres and pgvector.
At a Glance
Fully free and open-source under the MIT License. Use, modify, and distribute freely.
Engagement
Available On
Alternatives
Listed Apr 2026
About GBrain
GBrain is an open-source personal knowledge base engine designed to be installed and operated by AI agents. It indexes markdown files into a local or cloud Postgres database with pgvector, enabling hybrid search (vector + keyword + RRF fusion) so agents can read context before every response and write new knowledge after every conversation. The system supports a "compiled truth + timeline" knowledge model, 30+ MCP tools, and integration recipes for Gmail, Google Calendar, Twitter, Twilio voice calls, and meeting transcripts. Setup takes approximately 30 minutes with a frontier model like Claude or GPT handling the installation automatically.
- PGLite local brain — Run
gbrain initfor an embedded Postgres 17.5 brain via WASM with no server, no accounts, and no connection strings required. - Hybrid search with RRF fusion — Combines vector (HNSW cosine) and keyword (tsvector) search with Reciprocal Rank Fusion and multi-query expansion via Claude Haiku for best-in-class recall.
- 30 MCP tools — Expose
get_page,put_page,search,query,traverse_graph,sync_brain, and more to any MCP client including Claude Code, Cursor, Windsurf, and Claude Desktop. - Integration recipes — Agent-readable markdown recipes for Gmail, Google Calendar, Twitter/X, Twilio voice-to-brain, and Circleback meeting transcripts; the agent reads the recipe, asks for API keys, and wires everything up.
- Compiled truth + timeline model — Every brain page stores a rewritable "compiled truth" section above a separator and an append-only evidence timeline below, keeping facts current while preserving provenance.
- Pluggable engine architecture — Swap between PGLiteEngine (local, zero-config) and PostgresEngine (Supabase Pro) with a single
gbrain migrate --to supabasecommand. - File storage migration — Three-stage lifecycle (mirror → redirect → clean) moves binary attachments to S3-compatible or Supabase Storage while preserving all markdown references.
- TypeScript library — Import
createEnginefromgbrainto embed the brain directly in any TypeScript/Bun project with the same operations as the CLI and MCP server. - GBRAIN_SKILLPACK — A reference playbook telling agents when to read, when to write, how to detect entities, run enrichment pipelines, and maintain the brain autonomously via cron jobs.
Community Discussions
Be the first to start a conversation about GBrain
Share your experience with GBrain, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
Fully free and open-source under the MIT License. Use, modify, and distribute freely.
- Full CLI with 37 operations
- PGLite embedded Postgres brain (local, no server)
- Hybrid vector + keyword search with RRF fusion
- 30 MCP tools via stdio
- Integration recipes for Gmail, Calendar, Twitter, Twilio, Circleback
Capabilities
Key Features
- Local PGLite embedded Postgres brain (no server required)
- Hybrid vector + keyword search with RRF fusion
- Multi-query expansion via Claude Haiku
- 30 MCP tools via stdio
- Remote MCP server via Supabase Edge Functions
- Integration recipes for Gmail, Google Calendar, Twitter/X, Twilio, Circleback
- Compiled truth + append-only timeline knowledge model
- Pluggable engine: PGLite (local) or Postgres (Supabase)
- Bidirectional migration between PGLite and Supabase
- Three-stage binary file migration to cloud storage
- TypeScript library with createEngine API
- GBRAIN_SKILLPACK agent playbook
- 37 CLI operations
- Idempotent markdown import with SHA-256 content hashing
- Three chunking strategies: recursive, semantic, LLM-guided
- Page versioning and revert
- Typed link graph with recursive CTE traversal
- Daily briefing and meeting prep skills
- Migration from Obsidian, Notion, Logseq, Roam
- Health dashboard with stale/orphan detection
