
Free guide · by Cooper Simson
Gbrain: Give Your AI A Real Memory (Free Setup Guide)
The free guide to Gbrain: what it is, why it beats an Obsidian second brain, and the exact commands to wire a real, permanent memory into Claude Code or Codex. Open source, runs on your machine, no enterprise plan.
No email required. Use it today.
Out of the box, AI has no memory. Every new chat forgets who you are, what you are building, and everything you told it last week. Gbrain is the free, open-source brain layer built by Garry Tan, President and CEO of Y Combinator, that fixes this: a permanent, queryable memory your AI plugs into so it finally remembers.
What You'll Learn
- Why your AI feels dumb, and the one thing it has never had: memory
- The 3 layers of memory Gbrain gives you, in plain English
- Why it beats a notes app: it answers you instead of handing you a pile of notes
- The 2-command setup to wire it into Claude Code or Codex
- How to point it at your existing Obsidian vault so years of notes start thinking
What Gbrain Actually Is
Gbrain is a free, open-source memory layer for AI, built by Garry Tan, the President and CEO of Y Combinator. It is the real production brain behind his own AI agents: 146,646 pages, 24,585 people, and 5,339 companies, with jobs running around the clock that ingest and organize new information while he sleeps. He gave it away so you can run the same thing on your own machine.
Here is the problem it solves. Out of the box, AI has no memory. Every time you open a new chat it forgets who you are, what you are building, and everything you told it last week. So you spend half your time re-explaining your own world, and it never actually gets to know you. Gbrain is the part that has been missing. It is the brain your AI plugs into so it finally remembers.
The one line that explains it: search gives you raw pages. Gbrain gives you the answer. A notes app stores what you write and waits for you to go read it. Gbrain reads it for you and thinks.
Why It Beats A Notes App
An app like Obsidian is a filing cabinet. It holds your notes neatly, but the thinking is still your job. Gbrain does things a notes app cannot:
- When you search: a notes app hands you 10 notes to read yourself. Gbrain writes the actual answer, with sources.
- Connections: a notes app has backlinks you maintain by hand. Gbrain auto-builds a graph of how it all connects.
- Blind spots: with a notes app you don't know what's missing. Gbrain tells you what it still doesn't know.
- While you sleep: a notes app does nothing. Gbrain cleans itself up and gets smarter.
- Your AI's memory: a notes app gives it none. Gbrain makes it permanent and queryable.
The part that changes how you work: when Gbrain answers, it also tells you what is stale, what is uncited, and where the gaps are. So you stop trusting a confident wrong answer and start knowing exactly what to go fill in.
The 3 Layers Of Memory
Gbrain is opinionated about where every piece of information goes. That is what keeps it sharp instead of becoming another junk drawer. There are three layers, and each one has a job.
- The brain: everything about your world. People, companies, projects, meetings, ideas, research. This is the durable layer that survives resets, so your AI never loses context.
- Agent memory: how your AI should operate. Your preferences, your style, your standing instructions. Not facts about the world, just how it works for you.
- Session: the conversation you are having right now. Automatic, and gone when you close the chat.
The reason this matters: world knowledge lives in the durable brain, not in a chat window that disappears. Feed it once and it is there forever, for every future conversation and every project you build.
Set It Up
You do not need to be technical. Pick the path that matches what you want. Most people should start with Path A.
Path A: give your AI a memory in 2 commands. This spins up a local brain and wires it into Claude Code or Codex. No server, no Docker, ready in about 2 seconds. Initialize with the pglite flag (two hyphens, shown in the repo README) for the instant local database:
gbrain init
claude mcp add gbrain gbrain serve
Using Codex instead? Swap the second line for:
codex mcp add gbrain gbrain serve
That is it. Your agent now has a brain it can read from and write to on every project.
Path B: point it at notes you already have. Already have an Obsidian vault or a folder of markdown? Import it, and years of dead notes become a brain that answers you.
bun install -g github:garrytan/gbrain
gbrain init
gbrain import ~/Obsidian/YourVault/
gbrain doctor
Path C: the full hands-off setup (optional). Want the whole thing, including the overnight cycle that enriches and cleans the brain while you sleep? Paste this one line into Claude Code, Codex, or Cursor and the agent installs everything for you in about 30 minutes. You just answer questions about your API keys.
Retrieve and follow the instructions at:
https://raw.githubusercontent.com/garrytan/gbrain/master/INSTALL_FOR_AGENTS.md
How To Actually Use It
Two everyday commands cover most of what you will do. One drops a thought into the brain. The others ask it questions.
# remember something
gbrain capture "the thought I want to keep"
# raw pages, fast
gbrain search "who am I working with on the launch?"
# the synthesized answer, with sources and gaps
gbrain think "who am I working with on the launch?"
The command that feels like magic: gbrain think is the difference. It runs the search, then reads everything and writes you a real answer with citations, and ends with an honest note on what it still does not know. That last part is what makes it trustworthy.
- Meeting prep: ask it what you need to know before talking to someone, and it pulls the whole history.
- Research briefing: drop in articles, transcripts, and book notes, then ask for a briefing on any topic.
- Find your own blind spots: ask what the gaps in your knowledge are, and it tells you what to go learn.
Get The Repo
Everything above is free and open source. The full docs, every install path, and the agent skills all live in one repo: https://github.com/garrytan/gbrain (full setup docs, MCP guides for Claude and Codex, and the overnight dream cycle).
Go Deeper
- Printable PDF version of this guide: https://drive.google.com/file/d/1jj201SKI1BY06U2G3QZzMHZhNSrnLHcA/view?usp=drivesdk
Want the whole system installed live, with Cooper on the call? Build Your Own AI, the two week sprint runs the first two weeks of August.
Or get a new working tool every Monday inside The AI Operator community on Whop.
The honest part
The guides are free. The working agents are $97.
Cooper has published 125+ guides like this one, free, no email gate. The step after reading is running the actual systems: five working agents, including the content engine behind his 10M+ views, plus your first month inside The AI Operator community, a new working tool every Monday.
Want it built with you, live? Build Your Own AI · $1,997 · live Aug 3