Practical Guides Β· knowledge base from X

GBrain β€” Garry Tan's (YC) open-source "Memex" for a personal and company brain that every agent reads

Y Combinator's CEO took Karpathy's wiki to the scale of tens of thousands of pages: 14,000 pages in week one, 74,114 pages and 117,855 links a month later, over 100,000 markdown files by May. GBrain (MIT) adds hybrid search, a relationship graph, an MCP server and skills; Markdown stays the source of truth. An entrepreneur uses it on ~7,000 company pages with 14 employees.

✍️ Garry Tan · @garrytan
πŸ”— Read the original on X Β· X Thread Β· published 9 Apr 2026
πŸ“Š 155 likes Β· 341 bookmarks Β· 70k views
Summary and adaptation in English; content and results belong to the author.

Part of the manual Second Brain β€” the complete manual (from the PARA method to the wiki the AI writes for you)

Claimed result

  • 7 April 2026: "I'm turning my OpenClaw into a Vannevar Bush Memex. It's just going to remember everything I care about and read and it will become my second brain" (268 likes, 201 bookmarks, 30k views, post).
  • 9 April: open-sources his entire setup under the MIT licence, including a pgvector RAG system for tens of thousands of markdown files (post); the post with the install prompt is this guide's source.
  • 28 April: "How big is my personal Karpathy knowledge wiki stored in GBrain now? 74,114 pages. 117,855 edges. 281,700 timeline entries. Week 1 it was 14,000 pages. A month later it is 5x what it was" (post). Sources: only important/valuable emails, his old Posterous blog, meetings, tweets, books, people, companies.
  • 8 May: "over 100,000 markdown files" and "30+ skills" given away (post).
  • 5 June: "GBrain is your company brain" β€” 1,384 likes, 2,206 bookmarks, 189k views, the most saved GBrain post (post); YC also uses it as a company brain (reply).
  • 30 June: "GBrain is mostly useful at 10,000+ markdown files" (810 likes, 946 bookmarks, post).
  • 31 August: evals that in his view prove the retrieval layer is state of the art without an LLM in the loop, plus evals for memory-save from agent transcripts (post).
  • GitHub repo garrytan/gbrain: 33,040 stars (GitHub API, 15/11/2026), created on 5 April 2026.
  • External use case: Thomas Bekkers runs the knowledge of a "seven-figure" business on GBrain: 14 employees, 60+ Slack channels, ~7,000 markdown pages (article).

Proof: medium. Precise, public scale numbers, open and verifiable code, evals published by the author himself. The "state of the art" claims are his; the company case is self-reported. Note: there is a paid service (gbrain.io) next to the free version.

The key idea

The edges are the real number. "117,855 links between things. That's what makes it a Memex and not just a filing cabinet." Every person connected to every meeting they were in, every company to every deal, every email to every person mentioned in it. Garry quotes Bush (1945): "The human mind operates by association."

Second idea, taken up by Bekkers: Markdown remains the source of truth; the database is an index that can be rebuilt. Knowledge lives in a git repo that is readable even without GBrain, versioned, backed up and portable. "I do not want the only copy of my company's memory trapped inside a vector database, an AI provider or another SaaS product."

Third idea: beyond a certain scale routing rules are no longer enough. With 40–50 well-organised documents the model can read them directly; with thousands of pages you need a real retrieval system. GBrain "does not eliminate routing. It changes what the routing has to do": the agent routes the question to the brain, retrieval finds the best evidence.

Step-by-step playbook

1. Installation (prompt Garry published in April)

The original post asks you to paste into the agent (OpenClaw) a 7-step prompt: install bun and the package from GitHub; gbrain init --supabase; scan ~/git/ and ~/Documents/ for markdown repos, pick the best one and import it without embeddings; run a test query; read the recommended schema and offer to restructure; read the skillpack and update skills with the production patterns (brain-agent loop, entity detection, source attribution, "iron law" back-linking, enrichment pipeline); set up a daily gbrain check-update cron that notifies only about new features and never auto-installs.

The current README (November 2026) is simpler: bun install -g github:garrytan/gbrain#stable, then gbrain setup claude-code (or codex), or gbrain init --pglite --no-embedding to start with no API keys (keyword-only search until you add a key). README warning: do not install the npm package gbrain, which is unrelated.

2. What to put in

  • Two markdown folders: your notes (an Obsidian vault works) and company docs.
  • In the company folder: facts.md (numbers and statements agents may repeat), decisions.md (each decision with its date, reason and who made it), call transcripts as .md.
  • Bekkers adds: raw information should not automatically become company truth. A Slack conversation has a question, three bad suggestions and one decision: the knowledge base must keep durable pages that separate the current answer from the evidence and timeline behind it.

3. The loop

signal β†’ search β†’ respond β†’ write β†’ auto-link β†’ sync: - brain-first lookup before any external API ("the cheapest, fastest, most personal information source you have"); - auto-link without LLM calls, by pattern-matching references like [[people/name]]; - overnight enrichment ("dream cycle"): dedupe people pages, fix citations, find contradictions, prepare tomorrow's tasks. - Two ways to query: gbrain search (top pages by hybrid score: vectors + keywords + RRF + source boost + reranker) and gbrain think (a synthesised answer with citations and an honest gap analysis of what the brain doesn't know yet: stale pages, uncited claims, contradictions).

4. Connecting agents

  • MCP for Claude Code, Codex, Cursor, ChatGPT, Claude Desktop, Perplexity and others; since May an MCP OAuth panel to control which clients access the brain, with revocation and logs (post).
  • gbrain setup writes a "brain-first" block into CLAUDE.md or AGENTS.md, because "agents seldom call an MCP server nobody told them about".
  • Engines: PGLite (Postgres via WASM, zero-config) up to ~50,000 pages; Postgres + pgvector for shared or large brains.

5. Company use (Bekkers)

  • Narrow agents with a clear job, one shared memory: "I do not want fifteen agents with fifteen disconnected memories." Example: one agent handles only pool heating for short-term rentals and retrieves current policy, property details, whether the guest paid, past exceptions.
  • Roles: GBrain makes knowledge findable; Hermes agents work with the team in Slack; Codex is used to build and repair the agents.
  • If two sources disagree, the system shows the contradiction instead of confidently picking one.

Tools and costs

Piece Option Cost
Software GBrain, MIT free to self-host
Database PGLite (default) or Postgres/Supabase + pgvector free / Supabase cost
Embeddings and synthesis model API key (optional) pay as you go
Managed hosting gbrain.io paid
"Always-on" version server with 8 GB+ RAM (per the README) VPS cost

Limitations

  • Designed for large scales (10,000+ files): below that it is extra infrastructure to maintain.
  • The "state of the art" evals are the author's; no independent comparison read.
  • Bekkers lists what it does not solve: it does not decide on its own which Slack message becomes policy, connectors must be built and maintained, permissions are needed because not everyone (people and agents) should see everything.
  • Versions change fast (v0.8 in April, v0.45 in August): instructions and commands age quickly.
← More guides in β€œSecond Brain β€” knowledge bases that AIs can read too”