What is GBrain
GBrain is a personal production-grade AI memory system open-sourced by Y Combinator president Garry Tan, designed specifically for OpenClaw, Hermes Agent, and other AI Agent platforms. The tool transforms scattered Markdown notes into a searchable, reasoning-capable, continuously growing knowledge graph, giving Agents long-term memory. Garry himself uses the tool to manage 10,000+ files, 3,000+ contacts, and 13 years of calendar data. The system already has 17,888 pages, 4,383 people, 723 companies, and 21 scheduled tasks running fully automatically, built in 12 days.
GBrain's main features
-
Automatic signal capture: Each message triggers a cheap model to extract original opinions and entity mentions in parallel, automatically archived in the background.
-
Brain-ops priority query: The Agent checks the brain before answering; if it cannot find the answer, it says so directly rather than hallucinating.
-
Multi-source content ingestion: Supports automatic digestion of all formats including meetings, emails, Twitter, PDFs, videos, and GitHub repositories.
-
Automatic entity enrichment: People/companies are automatically upgraded based on mention count (1 mention stub → 3 mentions online lookup → 8 mentions/meeting full profile).
-
Compiled Truth + Timeline: The upper layer is a rewritable current best understanding, and the lower layer is an append-only evidence timeline.
-
Hybrid search: Vector + keyword + RRF fusion + multi-query expansion + 4-layer deduplication, achieving 95% Recall@5.
-
Knowledge graph self-linking: Every write automatically extracts entity relationships with zero LLM calls (attended/works_at/invested_in, etc.).
-
Minions background queue: Deterministic tasks go through the Postgres-native job queue, completing in 753ms, with zero token cost and 100% success rate.
-
Skillify skill management: Automatically generates SKILL.md + tests + evaluations + parser triggers, preventing the skill tree from becoming a black box.
-
Voice calls: Integrates with Twilio + OpenAI Realtime; incoming calls automatically pull the caller's profile and generate a call brain page.
-
Daily briefing: Automatically summarizes meeting context, active deals, citation tracking, and to-dos.
GBrain's technical principles
- Three-layer architecture separation: GBrain adopts a separated architecture of Brain Repo (Git-hosted Markdown files, the only human-readable and editable data source) → GBrain retrieval layer (Postgres + pgvector hybrid search engine) → AI Agent (26 Skill definitions for read/write logic). The Agent reads and writes through the BrainEngine interface, with underlying support for PGLite (embedded Postgres, zero configuration) and PostgresEngine (Supabase) with bidirectional hot migration.
- Compiled Truth + Timeline dual-layer knowledge model: Each Markdown page is divided by
---into two layers: above is Compiled Truth (the current best understanding, continuously rewritten as new evidence arrives), and below is Timeline (the raw, append-only evidence chain). This design allows cognition to evolve while preserving a complete audit trail, avoiding the loss of history from purely overwriting updates or query noise from purely appending. - Zero-LLM-call knowledge graph self-linking: After each page write, a deterministic regex pipeline automatically extracts entity references (Markdown links + bare slugs), infers typed relations (attended/works_at/invested_in/founded/advises), and completes deduplication, dead link cleanup, and backlink updates. The entire process involves zero LLM calls, implemented purely with local regex + a priority inference cascade.
How to use GBrain
-
Agent automatic installation (recommended): Paste the instruction into OpenClaw or Hermes Agent
Retrieve and follow the instructions at: https://raw.githubusercontent.com/garrytan/gbrain/master/INSTALL_FOR_AGENTS.md, and the Agent automatically clones the repository, installs dependencies, loads 26 Skills, and configures scheduled tasks, completing in about 30 minutes. -
Standalone CLI:
git clone https://github.com/garrytan/gbrain.git && cd gbrain && bun install && bun link, thengbrain initinitialize the local brain (PGLite, ready in 2 seconds),gbrain import ~/notes/import notes,gbrain query "..."query. -
MCP Server: Locally expose 30+ MCP tools via
gbrain serveto connect to Claude Code/Cursor/Windsurf; after remote deployment to Supabase, connect to Claude Desktop/Cowork/Perplexity via a fixed ngrok domain. -
Data ingestion: Run
gbrain integrationsto view and configure integration recipes for Gmail, Calendar, Twitter, meeting transcripts, etc.
GBrain's key information and usage requirements
-
Environment requirements: Node.js + Bun (recommended), PGLite runs locally with zero configuration, or Supabase Postgres ($25/month) for multi-device sync.
-
API Key: Requires configuration of OpenAI (embeddings), Anthropic (optional, for sub-agents), Groq (voice transcription), etc.
-
Storage: Markdown files are the single source of truth, directly editable by humans,
gbrain syncautomatically syncs. -
Relationship with GStack: GStack (80k+ Stars) teaches Agents to write code, GBrain teaches Agents to take notes and think, and they can be combined for use through the
hosts/gbrain.tsbridge. -
License: MIT open source, available for commercial use.
GBrain's core advantages
-
Production-grade validation: Used daily by the YC president personally, not a toy-level demo, but a workflow forged in real combat.
-
Self-evolving knowledge graph: Entity relations are automatically extracted with zero LLM calls, and search accuracy improves by 28.8 percentage points over pure vectors.
-
Deterministic background tasks: Minions separate deterministic work from judgment work, reducing cost from $0.03 per run to $0 and increasing success rate from 0% to 100%.
-
Layered knowledge model: Compiled Truth ensures cognition evolves in real time, and Timeline ensures the evidence chain is never lost.
-
Agent-native design: Installation, operations and maintenance, and extension are all designed for AI Agents rather than manual human operation.
GBrain's project address
- Project official website:https://github.com/garrytan/gbrain
Comparison of GBrain with similar competitors
| Comparison dimension | GBrain | Mem0 | LlamaIndex | Pinecone |
|---|---|---|---|---|
| Positioning | AI Agent long-term memory system | Personalized AI memory layer | LLM application data framework | Vector database |
| Knowledge graph | Native self-connection, zero LLM calls | No native graph | Requires manually building a RAG graph | None, pure vector storage |
| Automatic entity upgrade | Automatically upgrades by mention count | Based on user interaction memory | Requires developer configuration | Not involved |
| Search method | Vector + keyword + RRF + graph traversal | Primarily vector search | Multiple retrievers available | Pure vector/hybrid search |
| Agent integration | OpenClaw/Hermes/MCP native | Multi-framework SDK | LangChain/LlamaIndex | Requires custom wrapping |
| Background tasks | Minions native queue, zero tokens | No native queue | None | None |
| Data format | Markdown as the sole source | Multi-format API ingestion | Multi-format nodes | Vector embeddings |
| Open source license | MIT | Apache 2.0 | MIT | Commercial/open source hybrid |
| Production validation | YC president's 17,000-page production environment | Used by multiple companies | Widely adopted by enterprises | Widely adopted by enterprises |
| Installation method | Agent self-install in 30 minutes / CLI | pip install SDK | pip install | Cloud-hosted/self-hosted |
GBrain application scenarios
-
Investor/founder relationship management: Automatically archives meetings, emails, and social updates, and generates a complete profile and interaction history of the other party 30 seconds before a meeting.
-
Personal knowledge base: Transforms years of notes, articles, and ideas into a reasoning-capable knowledge graph, supporting queries such as “my view on something six months ago.”
-
Research automation: After ingesting papers, reports, and videos, automatically extracts entities, builds citations, and generates timelines, assisting academic or industry research.
-
Content creation assistance: Tracks inspiration sources, automatically completes citations, and maintains topic tag consistency, preventing information omissions during the creation process.
-
Smart schedules and tasks: Automatically prepares meeting briefs daily, inspects expired pages, fixes broken citations, and generates periodic reports.