AIAI > Agent Infrastructure

garrytan/gbrain: Garry's Opinionated OpenClaw/Hermes Agent Brain

github.com13 min readsaved May 31, 2026
Open original
TL;DR

GBrain is Garry Tan's open-source, self-hosted "agent brain" — a memory and knowledge layer that gives AI agents synthesis, knowledge-graph traversal, and gap analysis over your notes, people, companies, and ideas. Unlike search tools that return raw pages, it returns cited answers plus an honest note on what it doesn't yet know, and runs a 24/7 "dream cycle" to ingest, enrich, and consolidate memory overnight. It runs locally on PGLite or at scale on Postgres/pgvector and is built to be installed and operated by an agent.

Why it matters

It's a concrete, self-hostable blueprint for durable, queryable agent memory with a real knowledge graph — the 'company brain' pattern YC is actively pushing. For anyone building agent infrastructure or PKM tooling, it shows synthesis + graph + gap analysis working together instead of yet another RAG-over-chunks tool.

Key points

  1. 1

    Two query modes: raw hybrid retrieval (gbrain search) and a synthesis layer (gbrain think) that composes cited answers with explicit gap analysis on what's stale, uncited, or contradictory.

  2. 2

    Self-wiring typed knowledge graph: every page write extracts entity refs and creates typed edges (works_at, invested_in, founded, advises) with zero LLM calls; benchmarked +31.4 P@5 over vector-only RAG.

  3. 3

    Designed to be installed and operated by an AI agent in ~30 minutes; runs on PGLite locally (DB ready in 2s) or Postgres/pgvector (Supabase) for team and large deployments.

  4. 4

    Multi-user 'company brain' with login-scoped access, fuzz-tested for zero cross-user leaks, matching YC's Request for Startups company-brain shape.

  5. 5

    24/7 dream cycle ingests meetings, emails, tweets, and calls, dedups people, fixes citations, finds contradictions, and preps tasks overnight.

  6. 6

    Ships 43 skills, customizable schema packs, and a 30+ tool MCP server supported across Claude Code, Cursor, ChatGPT, Cowork, and Perplexity.

Best quotes

GBrain Search gives you raw pages. GBrain gives you the answer.
Search finds the pages. The brain reads them for you and writes the answer.
The point of building a 100K-page brain is to use it as a strategic moat.