Introduction
"This isn't an experiment. This is the production system I actually use."
This is article No.46 in the "One Open Source Project a Day" series. Today's project is GBrain (GitHub).
Start with who built it, because it matters: Garry Tan is the current President and CEO of Y Combinator. He co-founded Initialized Capital (managing $700M at its peak), wrote the first seed check for Coinbase in 2012, led early investments in Instacart and Flexport, and has appeared on the Forbes Midas List of top global investors every year since 2018.
This person sat down, wrote code, built an AI memory system, and open-sourced it.
What makes it more striking: this is not a demo project. GBrain is the production system Tan uses every day. It currently manages 17,888 documents, 4,383 contacts, and 723 companies — his entire knowledge network of portfolio companies, founder relationships, and market signals. When a top-tier VC stakes their core intellectual infrastructure on an open-source tool, that's the most credible endorsement possible.
10k+ Stars, 1.2k+ Forks — the most identity-loaded open-source project in the AI memory space right now.
What You'll Learn
- GBrain's "Brain-First" design philosophy: why you query local memory before calling external APIs
- Hybrid search architecture: vector + keyword RRF fusion achieving 95% Recall@5
- Zero-LLM knowledge graph auto-wiring: 5 relationship types extracted with pure regex
- Minions task queue: deterministic operations 13x faster than LLM sub-agents
- "Compiled page" pattern: Git-like knowledge evolution tracking
Prerequisites
- Basic understanding of AI Agents and context window limitations
- TypeScript/JavaScript basics (optional)
- Familiarity with Obsidian, Notion, or similar PKM tools (helps with use case context)
Project Background
What Is It?
GBrain is an AI Agent persistent memory and knowledge management system that gives AI assistants a cross-session, semantically searchable "brain" via the MCP (Model Context Protocol) standard.
Design philosophy: Brain-First
Traditional Agent workflow:
Receives question → Directly calls external API (search/database/tools)
Problem: Pulls data from outside every time — repetitive, expensive, no accumulation
GBrain's Brain-First workflow:
Receives question → Query local brain (indexed knowledge graph) first
→ Hit? Answer directly, zero additional cost
→ Miss? Call external API → Write result back to brain → Hit next time
Result: The brain gets smarter and cheaper with every use
About the Author: Garry Tan
Garry Tan's background has more technical depth than most VCs:
- Stanford BS in Computer Systems Engineering; after graduation joined Microsoft, then became Palantir's 10th employee
- Co-founded blogging platform Posterous in 2008; acquired by Twitter for $20M in 2012
- Joined YC as Design Partner; personally wrote the first seed check for Coinbase in 2012
- Co-founded Initialized Capital, managed $700M, led investments in Instacart, Flexport, Coinbase
- Named to Forbes Midas List every year from 2018 onward
- Became Y Combinator CEO in January 2023, launched a $2B fundraising initiative
He's maintained an active YouTube channel sharing technical content throughout — he's one of the few people in VC who still actually writes code. GBrain is the direct product of that dual identity.
Project Stats
- ⭐ GitHub Stars: 10,400+
- 🍴 Forks: 1,200+
- 🐛 Open Issues: 75+
- 📦 Latest Version: v0.16.4
- 📄 License: MIT
- 🌐 Primary language: TypeScript (Bun runtime)
- 🧠 Author's live usage: 17,888 pages / 4,383 people / 723 companies
Key Features
Hybrid Search: RRF Fusion, 95% Recall@5
GBrain's retrieval engine combines vector search and keyword search using Reciprocal Rank Fusion (RRF):
RRF score = Σ 1/(60 + rank)
Example:
Vector search returns: [Doc A #1, Doc B #2, Doc C #5]
Keyword search returns: [Doc B #1, Doc D #2, Doc A #4]
Doc A: 1/(60+1) + 1/(60+4) = 0.01639 + 0.01538 = 0.03177
Doc B: 1/(60+2) + 1/(60+1) = 0.01613 + 0.01639 = 0.03252 ← top combined
Compared to pure vector search:
| Metric | Pure Vector | GBrain Hybrid |
|---|---|---|
| Recall@5 | 83% | 95% |
| Precision@5 | 39% | 45% |
| Knowledge graph F1 | 57.8% (grep) | 86.6% |
Zero-LLM Knowledge Graph Auto-Wiring
One of GBrain's most interesting design choices: automatically extracting entity relationships with zero LLM calls.
Regex/pattern matching extracts 5 relationship types from Markdown text:
Relationship Trigger pattern examples
attended "met with X at...", "attended X's..."
works_at "X is [title] at Y..."
invested_in "led Y's Series A..."
founded "X founded Y..."
advises "X serves as advisor to Y..."
In practice: when Garry Tan writes in his notes "morning call with Brian Armstrong about Coinbase's new product," the system automatically creates the edge [garry-tan] --attended--> [brian-armstrong] in his knowledge graph — without spending a single token.
Minions Task Queue: 13x Faster Than LLM Sub-Agents
GBrain splits work into two lanes:
Deterministic operations (Minions):
Parse Markdown, build links, sync files, extract relations
Execution latency: 753ms
Token cost: zero
Non-deterministic reasoning (LLM Agent):
Summarize, answer questions, generate insights
Execution latency: 10+ seconds
Token cost: real money
Minions run on a Postgres-native persistent task queue — crash-safe, auto-recoverable, no lost jobs. The key insight: most knowledge management operations are deterministic. They don't need an LLM. GBrain wipes that cost to zero.
26 Skills: Full AI Memory Coverage
| Skill Category | Examples |
|---|---|
| Always-On | Signal detection (auto entity recognition), brain read-enrich-write cycle |
| Data Ingestion | Idea processing, media ingestion, meeting transcription, structured data import |
| Brain Operations | Knowledge enrichment, smart querying, maintenance, citation repair |
| Task Operations | Task management, scheduling, reporting, webhook triggers |
| Identity Management | Soul audit, initialization, data migration, daily briefing |
30+ MCP tools available for direct invocation from Claude Code, Cursor, and Windsurf.
Data Integration Recipes
Built-in data ingestion pipelines:
✅ Gmail → Auto-ingest contacts and topics
✅ Google Calendar → Meetings automatically paged
✅ X/Twitter timeline → Follow posts + deleted tweet monitoring
✅ Twilio + OpenAI Realtime → Phone calls transcribed in real time
✅ Circleback → Meeting recordings auto-transcribed and indexed
Quick Start
# Clone (must use git clone — bun install -g won't work)
git clone https://github.com/garrytan/gbrain.git ~/gbrain
cd ~/gbrain
# Install Bun runtime (not Node.js)
curl -fsSL https://bun.sh/install | bash
export PATH="$HOME/.bun/bin:$PATH"
# Install and link global command
bun install && bun link
# Initialize your brain
gbrain init
# Health check
gbrain doctor --json
# Import your Markdown notes
gbrain import ~/notes/ --no-embed # import first, skip embedding
gbrain embed --stale # batch-generate vectors
# Query
gbrain query "who did I meet with this week?"
# Knowledge graph query
gbrain graph-query garry-tan
# Start MCP server (for Claude Code / Cursor)
gbrain serve
Claude Code integration:
// ~/.claude/server.json
{
"mcpServers": {
"gbrain": {
"command": "gbrain",
"args": ["serve"]
}
}
}
Deep Dive
Three-Layer Architecture
┌──────────────────────────────────────────────────────────┐
│ Brain Repository (Git-managed Markdown) │
│ Single Source of Truth │
└────────────────────────┬─────────────────────────────────┘
│ gbrain import
┌────────────────────────▼─────────────────────────────────┐
│ GBrain Retrieval Layer (Postgres + pgvector) │
│ Vector search ──┐ │
│ ├── RRF fusion → hybrid search results │
│ Keyword search ─┘ │
│ Knowledge graph (zero-LLM auto-wiring) │
│ Minions task queue (deterministic operations) │
└────────────────────────┬─────────────────────────────────┘
│ gbrain serve (MCP)
┌────────────────────────▼─────────────────────────────────┐
│ AI Agent Skills Layer (26 Skills) │
│ Claude Code / Cursor / Windsurf / any MCP client │
│ Trusted CLI callers (full filesystem access) │
│ Untrusted MCP callers (sandboxed) │
└──────────────────────────────────────────────────────────┘
The "Compiled Page" Pattern
GBrain's core mechanism for preventing knowledge rot:
# Brian Armstrong
## Current Best Understanding (compiled summary)
Brian Armstrong is the CEO of Coinbase, focused on pushing
crypto regulation into compliance territory. Q1 2026 priority:
negotiating the US SEC regulatory framework.
---
## Raw Evidence Timeline (append-only, never modified)
2026-01-15: Meeting notes - discussed Layer2 scaling...
2026-02-20: Email fragment - mentioned ETF application progress...
2026-03-10: Meeting notes - SEC negotiation strategy shift...
The compiled summary at the top is regenerated each time new evidence is written. The timeline at the bottom is append-only. This mirrors Git: the commit history is immutable, the working tree continuously updates.
Why Bun Instead of Node.js
Bun advantages that directly benefit GBrain:
✅ Native TypeScript support (no ts-node or build step)
✅ 3-4x faster startup than Node.js
✅ Built-in test runner and bundler
✅ Single-binary build: Darwin ARM64 + Linux x64 in one command
For a CLI tool that restarts on every invocation,
fast startup time directly affects how the tool feels to use.
Security: The Trust Boundary Model
CLI callers (remote: false):
Full filesystem access
Can read/write Brain Repository directly
Use case: gbrain import, gbrain query
MCP Agent callers (remote: true):
Strict sandbox
Data access only through defined tool interfaces
Use case: Claude Code / Cursor calling through MCP
This solves a real problem: when an AI Agent calls GBrain via MCP, you don't want it to have direct access to modify your raw note files — only the controlled Skill interfaces should read and write.
"Fat Skills, Thin Harness" Philosophy
GBrain's 26 skills are mostly Markdown files, not hardcoded logic:
gbrain/skills/
always-on/
signal-detection.md ← Markdown describing "how to detect entities"
brain-operation.md ← Markdown describing "read-enrich-write cycle"
ingestion/
ideas.md
media.md
...
The benefit: skill definitions can be edited in plain language — even by an AI assistant. This is genuinely customizable AI behavior: tell your agent "update the signal-detection skill to also watch for acquisition announcements," and it modifies a Markdown file.
Resources
Official
- 🌟 GitHub: https://github.com/garrytan/gbrain
- 👤 Garry Tan GitHub: https://github.com/garrytan
- 🏢 Y Combinator: https://www.ycombinator.com
- 📦 Bun runtime: https://bun.sh
Technical References
- 🔌 MCP Protocol: Model Context Protocol docs
- 🗄️ PGLite: https://pglite.dev (embedded PostgreSQL)
- 🔢 pgvector: https://github.com/pgvector/pgvector
Summary
Key Takeaways
- Brain-First philosophy: Query local memory before calling external APIs — the brain gets smarter and cheaper with every use cycle
- RRF hybrid search: Vector + keyword dual-path fusion lifts Recall@5 from 83% to 95% — the most practical search architecture improvement available today
- Zero-LLM knowledge graph: Deterministic pattern matching auto-builds 5 relationship types, accumulating knowledge at zero marginal cost
- Minions vs Agent: Hard separation of deterministic work and LLM reasoning — the former is 13x faster and free
- Markdown as source of truth: Portable data, Git-managed, zero cloud vendor lock-in
- Fat Skills: Intelligence lives in Markdown skill files, not hardcoded runtime logic — genuinely customizable AI behavior
Who Should Use This
- Investors / VCs: Managing large relationship networks and portfolio company information — Garry Tan's original use case
- Independent researchers: People who need AI to continuously accumulate domain knowledge and reason cross-session
- Power Obsidian users: Want to add AI retrieval and knowledge graph capability to an existing Markdown library
- AI Agent developers: Building persistent memory infrastructure for their own agents
A Question Worth Sitting With
GBrain raises an implicit question: when a top investor starts managing their core knowledge assets with open-source AI tools, what does that signal?
Garry Tan's daily work is finding investable patterns in a firehose of information — founders, market signals, policy shifts. He open-sourced the infrastructure layer of that system. Not because it doesn't matter, but because he believes: the real competitive advantage is insight and judgment, not the tool itself.
Open-source the tools. Keep the cognition. That's a mental model worth thinking about.
Visit my personal site for more useful knowledge and interesting products
Top comments (0)