aiGalen Guan

GBrain Deep Dive: Garry Tan's 146K-Page AI Brain — Architecture, Knowledge Graph, and Self-Evolving Loop

GBrain Deep Dive: Garry Tan's 146K-Page AI Brain

On April 5, 2026, YC President Garry Tan released GBrain on GitHub. Less than three months later: 24,615 stars, 3,547 forks, MIT license, TypeScript.

This is not an ordinary open-source project. This is the AI agent brain that Garry Tan uses every day — managing knowledge across 146,646 pages, 24,585 people, and 5,339 companies, with 66 cron jobs running autonomously. His agent ingests meetings, emails, tweets, voice calls, and original ideas while he sleeps. It enriches every person and company it encounters, fixes its own citations, and consolidates memory overnight.

"I wake up smarter than when I went to bed — and so will you."

What GBrain Is

GBrain's positioning is razor-sharp: search gives you raw pages, GBrain gives you the answer.

Most personal knowledge tools give you "keyword matching + grep" — a list of relevant pages you have to read yourself. GBrain adds two things on top:

  1. A synthesis layer: synthesized, well-cited prose across people, companies, deals, and ideas — with an explicit note on what the brain doesn't know yet
  2. A self-wiring knowledge graph: every page write extracts entity refs and creates typed edges (attended, works_at, invested_in) with zero LLM calls

Here's an example. You have a meeting with Alice tomorrow and want to know what to prepare.

Typical tools return: a list of 5 relevant pages you have to open and read yourself.

GBrain returns:

Alice runs engineering at Acme (a series-B fintech). You last spoke
on April 22 in a quick pricing chat. Three things are still open
from that conversation:

1. She owes you the security review for the new tier
   (deadline was May 1; no update since).
2. You committed to pricing for a 500-seat tier
   (you sent it April 25; no response yet).
3. She mentioned they're hiring a CISO; you said you'd intro
   someone from your network.

Heads up: nothing's been added to the brain about Alice or Acme
since April 22, six weeks ago. She may have replied through email
or Slack DM, channels the brain doesn't see. Worth asking her to
catch up before assuming any of this is still current.

Every claim has a source page. The "heads up" at the end tells you what the brain doesn't know yet — this is GBrain's most distinctive design: gap analysis.

Core Architecture

GBrain's architecture is built around four core mechanisms:

1. Hybrid Retrieval: Vector + Keyword + Graph Signals

GBrain's retrieval is not simple vector similarity search. It's a multi-layer pipeline:

Query → Query Rewriting (intent-aware) → Vector Search (HNSW on pgvector)
      → BM25 Keyword Search
      → Reciprocal Rank Fusion (RRF)
      → Source-Tier Boost
      → Graph Signal Enhancement (adjacency boost, cross-source boost, session demote)
      → Reranking (ZeroEntropy reranker)
      → Best-Chunk Pooling (strongest evidence chunk per page)

Three search modes: conservative, balanced (default), tokenmax.

Graph signals are GBrain's secret weapon. When a search result is detected as a "hub node" for a query, it gets adjacency boost; when corroborated across team brains, cross-source boost; when crowded out by weak chunks from a chatty session, session demotion.

Benchmarked: on a 240-page Opus-generated rich-prose corpus, the graph-enabled variant achieves P@5 49.1%, R@5 97.9% — a +31.4 point P@5 lift over vector-only RAG.

2. Self-Wiring Knowledge Graph: Zero LLM Calls

GBrain's knowledge graph construction is deterministic — no LLM dependency:

  • Every put_page automatically extracts entity refs from Markdown/WikiLink/typed-link syntax
  • Creates typed edges: attended, works_at, invested_in, founded, advises, mentions
  • Multi-hop traversal via gbrain graph-query
  • Obsidian-style [[note-name]] cross-folder resolution

This means the graph grows automatically with every write, at zero additional compute cost. This is the fundamental difference from Cognee (which relies on LLMs for graph construction) — GBrain chooses deterministic rules, Cognee chooses LLM-driven flexibility.

3. Schema Pack: Evolvable Brain Structure

Most personal knowledge tools force a fixed layout. GBrain has no fixed layout — it uses a Schema Pack system:

  • gbrain-base-v2 (default): 15 DRY/MECE canonical types — person, company, media, tweet, deal, email, project, etc.
  • gbrain-recommended: extends with 13 additional directory types
  • Custom packs: gbrain schema detect clusters your filesystem → gbrain schema suggest LLM refinement → gbrain schema review-candidates --apply human gate

Schema Packs thread through every read + write path: parseMarkdown infers page type from the pack's path prefixes; whoknows scopes expert routing to types declared expert_routing: true; extract_facts runs only on extractable: true types.

Switch packs and the brain re-interprets itself; switch back and nothing's lost.

4. Dream Cycle: Overnight Self-Evolution

GBrain's most fascinating design is its Dream Cycle — cron jobs that run autonomously while you sleep:

  • Dedup people pages: merge duplicate person entries
  • Fix citations: auto-correct broken links and erroneous references
  • Score salience: compute importance for every page
  • Find contradictions: gbrain eval suspected-contradictions samples retrieval pairs, LLM judges conflicts
  • Prep tomorrow's tasks: pre-generate todos and meeting prep

This is not "scheduled indexing" — this is autonomous knowledge management. Your brain gets smarter while you sleep.

Company Brain: Federated Multi-User Memory

GBrain recently added a company brain mode — which YC just listed on its Request for Startups:

  • Each team member gets their own brain slice, scoped by login
  • Queries only see what you're allowed to see — never another person's notes, never another team's data
  • Fuzz-tested across search, list, lookup, multi-source reads — zero leaks
  • OAuth 2.1 scope-gated access control (read / write / admin)

Tech Stack Highlights

Component Technology Highlight
Database PGLite (Postgres 17 WASM) 2-second startup, zero config, no server needed for personal brains
Vector pgvector + HNSW Embedded in Postgres, no separate vector DB
Embedding 16 providers OpenAI/ZeroEntropy/Voyage/Gemini/Ollama and more
Reranking ZeroEntropy zerank-2 Default in tokenmax mode; also supports local llama.cpp
Runtime Bun + TypeScript Full-stack TypeScript, MCP-native
Job Queue Minions (BullMQ-style) Postgres-native, crash-safe two-phase persistence
Knowledge Graph Deterministic rules Zero LLM calls, typed edges

Comparison with Similar Projects

Dimension GBrain Cognee mem0 Obsidian Notion
Stars 24.6K 24.6K ~25K
Positioning Agent brain Agent memory Agent memory Note tool Workspace
Synthesized answers ✅ Core
Gap analysis ✅ Core
Knowledge graph ✅ Deterministic ✅ LLM-driven Limited ✅ Visual
Customizable schema ✅ Pack system ✅ Ontology ✅ Plugins ✅ Database
Company/multi-user ✅ OAuth isolated ✅ User isolation
Overnight self-evolution ✅ Dream Cycle
MCP-native ✅ 30+ tools
Zero-config local ✅ PGLite 2s ✅ Docker ✅ pip ✅ Local ❌ Cloud
License MIT Apache-2.0 Apache-2.0 Proprietary Proprietary

GBrain is unique on two dimensions: synthesized answers and gap analysis. Other tools "find relevant pages"; GBrain "reads the pages, gives you the answer, and tells you what it doesn't know yet."

Multi-Dimensional Scoring

Dimension Score Notes
Architecture 9/10 Dual-engine (PGLite/Postgres) unified interface, evolvable Schema Pack, MCP-native
Retrieval 9/10 Hybrid search + graph signals + reranking, P@5 49.1% benchmarked
Knowledge Graph 8/10 Deterministic construction at zero cost, but typed edges require specific syntax
Synthesis Quality 8/10 Cited synthesis + gap analysis is a differentiated killer feature
Usability 7/10 Agent-assisted install in 30 min, but high concept density, steep learning curve
Production Readiness 8/10 Garry's own 146K-page production use, 1,097 issues show active community
Innovation 9/10 Dream Cycle, gap analysis, Schema Pack self-evolution — multiple firsts

Overall: 8.5/10. GBrain is currently the most complete and thoughtfully designed open-source solution in the personal/team AI knowledge management space. It's not another note-taking tool — it's cognitive infrastructure designed for AI agents.

Limitations and Risks

  1. Extremely high concept density: Schema Pack, Dream Cycle, Minions, Brain ⊥ Source dual-axis — new users need time to understand these concepts.
  2. Agent ecosystem dependency: GBrain is designed to be used by AI agents; standalone UX is not as polished as Obsidian/Notion.
  3. 1,097 open issues: The project iterates extremely fast (40+ versions in 3 months); stability is in flux.
  4. Bun runtime: Depends on Bun rather than Node.js; may encounter compatibility issues in some environments.
  5. Knowledge graph syntax dependency: Typed edges require specific Markdown syntax; existing notes need adaptation.

Conclusion

GBrain is a gift from Garry Tan to the AI agent ecosystem. It proves a thesis: what AI agents need is not better search, but a brain layer that synthesizes answers, self-evolves, and is honest about the boundaries of its knowledge.

Its design philosophy is worth studying for every developer building AI systems:

  1. Search vs. Synthesis: Finding relevant pages is not the endpoint; reading them and giving the answer is.
  2. Deterministic vs. LLM-driven: Knowledge graphs don't need LLMs — deterministic rules are cheaper and more reliable.
  3. Honesty over cleverness: Gap analysis tells users "here's what I don't know" — the rarest quality in AI systems.
  4. Sleep time is the most valuable compute: Dream Cycle turns overnight idle compute into knowledge evolution.

Our recommendation: if you're using AI agents (Claude Code, Cursor, OpenClaw, Hermes), GBrain is currently the best memory layer. 30-minute agent-assisted install, 43 skills out of the box. Start with gbrain think to experience synthesized answers, then gradually explore Schema Pack customization and Dream Cycle automation.

For teams building a "second brain" or "company knowledge base," GBrain's federated multi-user architecture and OAuth isolation are production-grade infrastructure.

References