GBrain is a memory layer for AI agents that indexes a git repository of markdown pages into Postgres and exposes retrieval, synthesis, a knowledge graph, and a job queue over a command-line interface and a Model Context Protocol (MCP) server. It runs as a persistent brain behind an always-on agent (OpenClaw or Hermes) or as a retrieval layer wired into Claude Code or Codex. Its author operates a deployment of about 155,000 pages, 24,500 people, and 5,300 companies with 66 cron jobs.
Two query paths exist. gbrain search returns top pages ranked by a hybrid score combining pgvector HNSW vector search, BM25 keyword search, reciprocal-rank fusion, source-tier boosts, and an optional cross-encoder reranker. gbrain think runs the same retrieval and then composes a cited answer that also notes what the brain does not know: stale pages, uncited claims, and contradictions between pages. Every page write extracts entity references from wikilinks and typed-link syntax and creates typed graph edges (attended, worksat, investedin, founded, advises) without LLM calls; multi-hop traversal runs through gbrain graph-query. On a 240-page test corpus the graph-enabled configuration measured P@5 of 49.1% and R@5 of 97.9%, 31.4 points of P@5 above the graph-disabled variant.
Two storage engines implement one BrainEngine contract of 140+ methods: PGLite (Postgres 17 via WASM, no server) for personal brains up to roughly 50,000 pages, and Postgres with pgvector (Supabase or self-hosted) for shared or multi-machine use. The brain repo stays the system of record; deletions in git become soft deletes in the database, and per-login scoping lets team members query only their own slice. Bundled schema packs define page types (person, company, deal, email, project, and so on), and gbrain schema commands can detect and propose types from an existing vault such as an Obsidian export. Keyless installs work with keyword search; an OpenAI, Voyage, or Anthropic key adds semantic search and fact extraction.
Features
- Hybrid search: vector, BM25, RRF, source-tier boost, query rewriting, and reranking, with conservative, balanced, and tokenmax modes and --explain per-stage attribution
- Synthesis: gbrain think returns cited prose answers with gap analysis on stale, uncited, or contradictory material
- Self-wiring graph: typed edges created on every write from wikilinks, with multi-hop graph queries and Obsidian basename resolution
- Two engines: zero-config PGLite for local brains and Postgres plus pgvector for shared deployments, behind one contract
- Minions job queue: Postgres-native queue for durable subagents with two-phase persistence, shell jobs, child jobs, rate leases, and optional per-job process isolation
- Agent bootstrap: an interview-driven setup creates identity files, a private GitHub repo, and MCP wiring for Codex or Claude Code
- Memory verbs protocol: a seven-verb MCP surface (recall, remember, entity, synthesize, forget, context_pack, delta) for coding agents
- Schema packs: bundled taxonomies plus detect, suggest, and review commands that derive types from your own files
- Ingestion: Gmail, calendar, and contacts via ClawVisor, Google Takeout archives, voice calls through Twilio, and email and calendar webhooks
- Provider matrix: embeddings from Voyage, OpenAI, OpenRouter, Gemini, Azure OpenAI, MiniMax, DashScope, Zhipu, Ollama, llama.cpp, and LiteLLM; rerankers from Voyage or a local llama-server
- Eval suite: LongMemEval, NamedThingBench retrieval gates, BrainBench cross-harness conformance, and a suspected-contradictions checker
- Skills and crons: 50+ bundled markdown skills for capture, ingest, enrichment, and an overnight consolidation cycle
Integrates with
AlphaClaw
Web dashboard around OpenClaw with a setup wizard, self-healing watchdog, Git-backed rollback, and multi-agent management
Claude Code
Terminal-based agentic coding tool that reads your codebase and runs tasks through natural-language commands
Codex
Lightweight coding agent that runs in your terminal
Hermes
Self-improving AI agent with a learning loop that creates and refines skills, recalls past sessions, and runs across chat platforms
