fakenerd.ai

ninja nerdingGBrain: one memory for all your agents

GBrain: one memory for all your agents

Garry Tan, president of Y Combinator, built GBrain to run his own AI agents, and his always-on brain runs behind Hermes. It gives the agent you already use (Hermes, Grok Bot, Claude Code, Codex, ChatGPT, Cursor) a memory you control: facts with their sources, pages that keep themselves current, and a brain that works overnight. His own has grown to 155,795 pages.

Not tied to Slack. Any agent that speaks MCP can use it, from Hermes on a server to Grok Bot in xAI's cloud. Setup happens in a terminal (or your coding agent runs it for you) and it runs on your laptop or a server you control.

Watch a page update itself, see its day and night, or skip to picking a setup.

Paper-friendly: diagrams stay, buttons go, sources spelled out.

fakenerd.ai/gbrain · Repo: github.com/garrytan/gbrain

Ten signals

The whole system in ten boxes. Each links to the part of this page that explains it.

  1. 01

    One memory behind every agent

    Hermes, Claude Code, Codex, Cursor, ChatGPT and Grok Bot can all reach the same brain over MCP. It runs on your laptop or a server you control.

    How
  2. 02

    It writes the answer, not a list

    gbrain search hands you pages. gbrain think reads them and answers with sources, plus a note on what's stale, uncited or missing.

    How
  3. 03

    Built to run always on

    Garry's intended setup is Hermes on a server, running crons and ingestion around the clock. It's also the most expensive way in.

    How
  4. 04

    Thin harness, fat skills

    Judgment lives in Markdown skills; anything that needs the same answer every time lives in code. A short routing file beats a giant prompt.

    How
  5. 05

    Brain first, web second

    On every message the agent searches the brain before the web, answers, then writes back what it learned. Each write makes the next read better.

    How
  6. 06

    Rewrite the top, append the bottom

    Each page has a summary that gets rewritten when the evidence changes and a dated, sourced timeline that is never edited. Mistakes get a correction entry.

    How
  7. 07

    It works while you sleep

    A dream cycle at 2 AM creates and enriches pages, fixes missing sources and broken links, and re-indexes. Skip it and the brain slowly rots.

    How
  8. 08

    Seven verbs for coding agents

    recall, remember, entity, context_pack, delta, forget and synthesize. Only synthesize is slow and costs money.

    How
  9. 09

    Start keyless, opt in later

    The coding-agent setup takes about 10 minutes with no API keys. Capture, enrichment and the dream cycle are separate choices. Install from GitHub, not npm.

    How
  10. 10

    It scales to a team

    One brain with several sources and a scoped login per teammate, so each person sees only what they're allowed to. Garry's recipe covers 10 to 50 people.

    How

Words on this page

Thirteen terms, in plain words. Skip this if you already run agents from a terminal.

MCP
The shared plug that lets an AI agent use outside tools. Any agent that speaks MCP (Hermes, Claude Code, Codex, Cursor, ChatGPT) can use GBrain.
Coding agent
An AI that works in your terminal, like Claude Code or Codex. Giving one a memory is Garry's recommended way to start.
LLM
Large language model: the AI model itself. GBrain keeps it away from jobs that need the same answer every time, like links and counting.
Keyless
Running with no API keys. Memory and keyword search work this way on day one; keys, capture, enrichment and the dream cycle are later opt-ins.
Bun
The tool that installs GBrain from GitHub. Install only that way, not from npm, where a package with the same name is unrelated.
Embeddings
The index that lets a hybrid query match by meaning, not just exact words. Keyword search works without them; with them, search finds synonyms and concepts.
Cron
A job that runs on a schedule. Garry's production brain runs 66 of them, from meeting sync three times a weekday to the 2 AM dream cycle.
Daemon
A program that keeps running in the background. gbrain autopilot runs the whole loop this way.
Entity
A person or company the brain keeps a page on. The dream cycle creates pages for new ones and enriches thin ones.
Slug
A page's short address in the brain, like people/alice-example. gbrain get opens a page instantly when you know it.
PGLite and Supabase
Where the pages are stored. PGLite is a small Postgres database on the same machine; Supabase is hosted Postgres, for when the brain grows or a team shares it.
Tailscale
A private network between your own devices. gbrain mcp expose puts your brain on it so ChatGPT or your phone can reach it; --funnel makes it public for cloud agents.
Hot path
Something that runs on every request and has to be quick. synthesize costs money and takes seconds to minutes, so it stays off it.

A search engine finds pages. A brain writes the answer.

Garry's example: you meet Alice tomorrow. Most knowledge tools hand you five pages to read. GBrain reads them and answers, with sources, and tells you what it doesn't know.

  • 155,795pages
  • 24,589people
  • 5,340companies
  • 66cron jobs

Garry's production brain, per the README.

Most tools: a list

  1. people/alice: runs engineering at Acme…
  2. meetings/q1-review: Q1 product review…
  3. meetings/acme-kickoff: kickoff with…
  4. customers/acme: series-B fintech…
  5. notes/apr-22: quick chat about pricing…

Now you open and read all five.

GBrain: the answer

Alice runs engineering at Acme. You last spoke April 22. Three things are open: her security review (overdue), your 500-seat pricing (no reply), and a CISO intro you promised.

Heads up: nothing new on Alice in six weeks. She may have replied somewhere the brain can't see. Ask before assuming.

Shortened from the README. Every claim links to a source page.

The “heads up” is the part Garry calls the differentiator: a note on what's stale, uncited, contradictory or missing. gbrain search gives you pages; gbrain think gives you the answer and the gaps.

Built for Hermes: a brain that works while you're away

Hermes is Nous Research's open-source agent that lives on a server, not your laptop. Garry calls Hermes (with OpenClaw) the way GBrain was designed to be used: 24/7 crons, continuous ingestion and the overnight dream cycle, whether your laptop is open or not.

  1. 01

    You

    Message Hermes from anywhere. Or don't: it keeps working on its schedule.

  2. 02

    Hermes, on a server

    Always on. Runs the crons, collectors and the 2 AM dream cycle.

  3. 03

    gbrain serve

    Started by Hermes as a local subprocess. No separate server, tunnel or token.

  4. 04

    The brain

    PGLite on the same box, or Supabase when it grows. Your pages, your keys.

Setting it up

  1. 01

    Deploy Hermes

    One click on Railway. Hermes is Nous Research's open-source agent that runs on a server, so it keeps working with your laptop shut.

  2. 02

    Hand it the install doc

    Paste one instruction into Hermes pointing at GBrain's INSTALL_FOR_AGENTS.md. Hermes installs the brain itself.

  3. 03

    It starts keyless

    Memory works on day one with no API keys. The install doesn't switch anything else on.

  4. 04

    Opt in, one at a time

    API keys, automatic capture, paid enrichment and the nightly dream cycle are separate choices you make later.

What to paste into Hermes

Retrieve and follow the instructions at: https://raw.githubusercontent.com/garrytan/gbrain/master/INSTALL_FOR_AGENTS.md

Deploy Hermes first with the one-click Railway template. Already running Hermes and GBrain? Register it yourself: pick “Hermes, always on” in Pick a setup.

Gotchas Garry's docs call out

  • Put --args last. Anything after it, even a misplaced --env, is swallowed into the server's arguments.
  • Pipe in the Y. Without it the tool-enable prompt cancels and nothing is saved.
  • Ignore the exit code: hermes mcp add returns 0 even when it failed. Check with hermes mcp list and hermes mcp test gbrain.
  • For crons with no terminal: put the provider key in $HERMES_HOME/.env and pin the model with hermes config set model.default.

Connect GBrain to Hermes

The trade-off: it's the most expensive way in, a server with 8 GB+ of memory plus model usage that grows with how hard the agent works. Garry's advice: start with a coding agent to feel it first, or start here if you want the full experience from day one.

Thin harness, fat skills

The 2x and the 100x AI users run the same models. The difference, Garry argues, is the wrapper: give the model the right context at the right time without drowning it.

  1. Fat skills

    Markdown procedures that hold judgment, process and domain knowledge. About 90% of the value.

  2. Thin harness

    About 200 lines. JSON in, text out. Read-only by default.

  3. Your app

    The deterministic floor: query the database, read a doc, search, timeline.

Push intelligence up

Judgment, synthesis, reading 50 documents to write one page of assessment: that's the model's job, written as skills.

Push execution down

Anything that needs the same answer every time (counting, seating 800 guests, SQL) belongs in code. An LLM will hallucinate a plausible seating chart.

A resolver, not a giant prompt

A small routing file says “for this kind of task, load that doc first.” Garry's CLAUDE.md hit 20,000 lines; about 200 lines of pointers fixed it.

The loop: read before you answer, write after

Two rules: every read makes the answer better, every write makes the next read better. Capturing conversations automatically is opt-in; saving what you explicitly ask it to remember always works.

  1. 01

    Signal

    A message, meeting, email, tweet or link arrives.

  2. 02

    Search

    Brain first, before any web or paid API.

  3. 03

    Respond

    Answer with that context.

  4. 04

    Write

    Rewrite the page's summary, append a dated timeline entry.

  5. 05

    Auto-link

    Typed links and backlinks from page references. No LLM calls.

  6. 06

    Sync

    Index the change so the next search finds it.

next signal arrives, and the agent is a little smarter

Brain-first lookup, in this order

  1. 01Keyword searchgbrain searchFast. Works on day one with no embeddings.
  2. 02Hybrid querygbrain queryKeyword + meaning. Finds synonyms and concepts.
  3. 03Direct pagegbrain getInstant when you know the slug, like people/alice-example.
  4. 04The webfallback onlyOnly if the brain had nothing. External APIs fill gaps; they don't start from scratch.

How a page updates: rewrite the top, append the bottom

Every GBrain page has two zones. Compiled truth on top is the current picture, rewritten whenever the evidence changes. The timeline below is the proof: dated, sourced, never edited. Send the events and watch. The pattern

New evidence arrives

  1. 01Meeting notes arriveMeeting notes · Sept 3
  2. 02An email landsGmail · Sept 18
  3. 03You correct itYou · Sept 20

people/dana-ruiz.md

Dana Ruiz

Compiled truth

the current picture
State
Head of Ops at Northwind.
Building
Wants to automate invoice matching. No project yet.
Relationship
Met once, at a supplier summit.

<!-- timeline -->

Timeline

the evidence
  • 2026-08-02 · Met at a supplier summit. Interested in automating invoice matching. [Source: me, conversation]

Teal = what just changed. The correction didn't erase the October entry; it added a new one and the summary moved on. FakeNerd's example, in the shape GBrain's docs use.

  • Compiled truth: rewrite the whole section with the new evidence folded in. Never stack old and new.
  • Timeline: append a dated entry with its source. Never edit old entries.
  • Wrong fact: add a “Correction: …” entry, then rewrite the summary.

Why it works: six months of entries compress into a 30-second read, and search ranks the summary above the timeline, so the freshest picture surfaces first. Don't skip the Assessment section: your own read on a person is the one thing no API can give you.

Day and night: it gets smarter while you sleep

A production brain runs 20+ recurring jobs. Garry's reference schedule, with his rule that nothing pings you during quiet hours. The schedule

★●●●●●●
quietawake
12a6a12p6p12a
  • 2aDream cycle. The most important job. Sweep entities, fix citations, consolidate memory, sync and embed.
  • 7aHealth gate. Is the autopilot daemon alive and fresh?
  • 8aMorning briefing. Calendar attendees, deal status, open threads. Delivers everything held overnight.
  • 9aHeartbeat. gbrain doctor: database, embeddings, sync, stale pages, broken links.
  • 10aMeeting sync. Weekdays at 10, 4 and 9: ingest meetings, update every attendee's page.
  • :00 :30Collectors. Email and X every 30 minutes, all day.
  • 11p–8aQuiet hours. Work continues, pings are held for the morning briefing.

The dream cycle, nightly at 2 AM

  1. 01

    Entity sweep

    Read today's conversations. New person or company? Create a page. Thin page? Enrich it. Known? Add today's mentions.

  2. 02

    Fix citations

    Find timeline entries with no source and fix them. Repair broken links.

  3. 03

    Consolidate

    Patterns across conversations become durable knowledge. Summaries get rewritten from new evidence.

  4. 04

    Sync and embed

    Re-index everything so tomorrow's searches see it.

It ships as one command, gbrain dream, and gbrain autopilot runs the whole loop as a background daemon. Skip the dream and the brain slowly rots: broken links, facts without sources, stale summaries. It's also where the always-on cost lives, so it's opt-in.

Seven memory verbs, and two ways to ask

Connect a coding agent with --surface verbs and it sees exactly seven tools instead of the full wall. Frozen as a v1 protocol: new things get added, nothing gets removed. The spec

  • recallread · fast

    Get saved facts about a topic or entity.

  • rememberwrite · fast

    Save one fact, with where it came from.

  • entityread · fast

    Everything on one person or company. No LLM, under 100 ms.

  • context_packread · fast

    A bundle of context for up to 8 entities at the start of a session.

  • deltaread · fast

    What changed since you last checked.

  • forgetwrite · fast

    Withdraw a fact from active memory. History and backups may remain.

  • synthesizeread · $$ slow

    A written, cited answer. Costs money and takes seconds to minutes. Never on a hot path.

gbrain search

Top pages by hybrid score. No answer written. For skimming, citations, finding a quote.

gbrain think

Same retrieval, then a written answer with citations and a note on gaps, contradictions and stale pages. Needs a model configured.
Search modeContextHaiku-classSonnet-classOpus-class
Conservative~4K$40$120$200
Balanced~10K$100$300$500
Tokenmax~20K$200$600$1,000

Rough monthly cost of the context each search feeds your model, from the search-modes guide. Keyless keyword search costs nothing.

Pick a setup

Six ways in, from two commands to a team deployment. Start keyless: API keys, automatic capture, enrichment and the dream cycle are each separate opt-ins.

I want…

You already use a coding agent and want it to remember across conversations. Garry's recommended start.

Time
About 10 minutes
Cost
Free to start: keyless, no API keys
You need
A Mac or Linux terminal and Bun
You get
Seven memory verbs inside your agent. One local brain, no server.

Commands

bun install -g github:garrytan/gbrain
gbrain init --pglite --no-embedding
claude mcp add gbrain -- gbrain serve --surface verbs
# Codex: codex mcp add gbrain -- gbrain serve --surface verbs

Full steps: Give your coding agent a memory

  1. Memory for Claude Code or Codex: About 10 minutes. Free to start: keyless, no API keys. Needs: A Mac or Linux terminal and Bun.
  2. Use it from anywhere: About 15 minutes after the above. Free (Tailscale), plus whatever models you add. Needs: The computer stays on.
  3. Memory for Grok Bot: About 20 minutes. Free to start: keyless. Needs: GBrain on a computer that stays on. No such computer? Install it inside the Bot's /workspace instead..
  4. Hermes, always on: About 30 minutes (Hermes does the work), plus the deploy. Highest: a server (8 GB+ RAM) plus API usage that scales with how hard it works. Needs: Hermes on a server (one-click Railway template).
  5. A company brain for a team: About 90 minutes on top of the personal setup. Under $100/month of AI for 25 people, plus hosting. Needs: Postgres (Supabase), an HTTPS server, one login per teammate.
  6. Just search my notes: 5 minutes. Free. Needs: A terminal and Bun.

Don't install it from npm

The npm package called gbrain is unrelated and can shadow the real one. Install only from GitHub: bun install -g github:garrytan/gbrain. If you already ran the npm install, gbrain doctor detects it and prints the fix.

Where each kind of information belongs

  • GBrain

    Durable facts, preferences, decisions, commitments, corrections, with their source.

  • The agent's instruction files

    Its identity and binding rules, like “ask before deploying”.

  • Local config

    Tool settings, tokens, permissions, which skill is switched on.

  • The conversation

    The file you're reviewing right now, a temporary result.

A saved preference is data, not permission: it can't override the agent's rules. And “forget” removes a fact from recall, not from backups. Memory boundaries

As a company brain

Same system, three additions: several sources in one brain, one scoped login per teammate, and per-person folders, crons and skills. Garry's recipe for 10–50 people, about 90 minutes. The tutorial

Teammatesharedcustomersinternal
Alice · salesreadread + write—
Bob · opsread—read + write
Carol · legalread + writereadread

The tutorial's example. Performance reviews never reach sales queries; Garry reports zero leaks in fuzz tests across read paths.

If you wire in Slack

  • Two crons: a scan every 5–15 minutes for signals, a nightly archive of full history.
  • Map channel IDs to friendly names in one registry file.
  • Build message links from API data, never from the model.
  • Remember dismissed items so noise doesn't come back tomorrow.

The botmaster pattern: onboard each teammate yourself

  1. 01

    Pre-populate their slice

    Before they log in: a one-page profile, 5–10 frameworks that are theirs, links they care about, 2–3 example pages. About 20 minutes.

  2. 02

    Walk them through 2–3 wow flows

    A synthesis answer across sources. A question it can't answer, so they see it admit the gap. A meeting they tell it about, filed and linked.

  3. 03

    Then hand over the DM

    Only after the wow lands. Give access first and most people send one generic query and never come back.

About 45 minutes per person. Garry: compared to the cost of an internal tool nobody adopts, it's the best 45 minutes you'll spend. Expected bill for 25 people: about $40/month embeddings and $50/month model calls, plus hosting.

GBrain vs supermemory's Company Brain

Both are open source, both call themselves a company brain, and they solve different problems. The other one has its own page.

GBrainCompany Brain
Where you askAny MCP client: Hermes, Grok Bot, Claude Code, Codex, Cursor, ChatGPT, Claude DesktopSlack only
What it learns fromWhatever you connect: notes, email, calendar, meetings, X, voice callsSlack conversations
Memory shapeMarkdown pages (summary + timeline) and a typed graph, in Postgressupermemory containers per channel and person
Team privacySources plus one scoped login per teammateFollows Slack: public, private channel, DM
Runs onYour laptop, or any server you runYour Cloudflare account
SetupTerminal: 2 commands to 2 hoursOne-click deploy, about 5 minutes
Best forOne person's agents first, then a teamA team that lives in Slack

Best practices from Garry's playbook

From the README, the ethos essay and the operational disciplines, rewritten. Most apply to any agent memory, GBrain or not.

  1. 01

    Brain first, web second

    Search your own brain before any web or paid lookup. A LinkedIn scrape gives a job title; the brain gives the relationship.

  2. 02

    Rewrite the summary, append the timeline

    The top of a page is always the current picture. The timeline below is never edited, only added to.

  3. 03

    Correct with a new entry

    Wrong fact? Don't edit history. Add “Correction: …” and rewrite the summary.

  4. 04

    Every claim traces to a source

    Each line in the summary should point back to a dated, sourced timeline entry.

  5. 05

    Write your own assessment

    “Sharp leader, watch for burnout” is what no API can give you. It's what makes the page better than LinkedIn.

  6. 06

    Dream every night

    Skip the nightly cycle and the brain slowly rots: broken links, sourceless facts, stale summaries.

  7. 07

    Respect quiet hours

    Nothing pings you from 11 PM to 8 AM. Held items fold into the morning briefing, even when you travel.

  8. 08

    Twice means skill + cron

    Do it by hand for 3–10 items, fix the quality, write it as a skill, then schedule it.

  9. 09

    One owner per page type

    Two skills creating the same kind of page is a bug. That's how you get three pages for one person.

  10. 10

    Deterministic links

    Build Slack or email links from API data. LLMs hallucinate URLs.

  11. 11

    Keep CLAUDE.md to pointers

    Garry's grew to 20,000 lines and the model's attention degraded. About 200 lines of pointers fixed it.

  12. 12

    Test recall in a new conversation

    Remembering inside the same chat proves nothing. Start fresh and watch it actually call the brain.

FakeNerd's take

Copy the page shape first

Rewrite the summary, append the timeline, fix mistakes with a correction entry. That works in a plain folder of notes before you install anything. Most of GBrain is machinery around that one habit.

Start on the free path

The coding-agent setup is keyless and takes about 10 minutes, and it's Garry's own recommended start. Leave capture, enrichment and the dream cycle off until recall works in a fresh conversation.

Built for one very busy person

155,795 pages and 66 cron jobs is Garry's life, not a typical one. Unless you have his meeting load, a server running all night is a lot of cost for a small gain, and Hermes is the most expensive way in.

His numbers, not ours

The page counts, the zero leaks in fuzz tests and the team bill are what Garry reports. We read the docs; we haven't run a company brain or rerun his evals.

Medium level, not beginner

Every path starts in a terminal. If your team lives in Slack and nobody wants that, Company Brain is the five-minute version. GBrain earns its setup when you use several agents and want one memory behind all of them.

Related on this site: Company Brain, the Slack-only brain compared above. Compound Engineering, where the agent writes down what it learned so the next job starts smarter. autoresearch, another setup that keeps working while you sleep.

Attribution

  • garrytan/gbrain (MIT) by Garry Tan: README and docs as of Sept 26, 2026, including the compiled-truth pattern, brain-first lookup, operational disciplines, reference cron schedule, memory verbs spec, search modes and the company-brain tutorial.
  • Thin Harness, Fat Skills, Garry's essay (YC Spring 2026 talk).
  • gbrain-evals for benchmark receipts · Garry Tan on X
  • The Dana Ruiz page demo, the setup picker and the comparison table are FakeNerd's, built from the docs.
↑↓ move enter openBrowse every card