Give Your Agents One Shared Memory
One agent saves it once. Every agent can answer from it.

This guide is for founders and operators who run more than one AI agent and want what one learns to be available to the others. GBrain is an open-source memory for AI agents, licensed MIT. It stores pages with their sources, lets you correct or withdraw a fact later, and connects to Hermes over MCP, a standard way for AI tools to plug into each other. You install it, connect each agent to the same brain, paste one set of memory rules into each agent, and test it with one saved page. It starts with no API key and plain keyword search. The software is free. Your agents' model usage and any hosting are not. Agents save only when your rules tell them to, or after you opt in to automatic capture, and the model behind each agent still sees whatever it recalls.
The finding the other agent never saw
Say your research agent reads 10 Instagram reels about how founders use AI and finds one point that matters. The next day, your personal agent knows nothing about it. You ask, and it guesses. Nothing was lost. The finding lives in one agent's memory and no other agent can reach it.
That is the default for most agents. Each one keeps its own memory, so what one learns stays with it. GBrain is an open-source memory you can point several agents at. One agent saves a page with its source attached. Another agent searches the same brain and answers from that page.
This guide sets that up once, using Hermes as the example agent. You install GBrain, connect each agent to the same brain, give every agent the same memory rules, and test it with one saved page.
Where your research agent gets its material, such as the reels in the example, is separate from GBrain. This guide starts from a finished research document.
Completion test: in a new conversation, ask your personal agent what your research agent found yesterday. It answers from the saved page, names the page and shows the source. If it guesses, the memory is not shared yet.
What GBrain is, in plain words
GBrain is an open-source memory for AI agents, built by Garry Tan and released under the MIT licence. In its README's words, it stores explicit facts with their sources, supports corrections and withdrawal, and makes the same memory available across your agents.
Repository: github.com/garrytan/gbrain
When this guide was checked on October 24, 2026, the repository showed about 31,100 GitHub stars and 4,700 forks. Stars show interest. They do not show that it is ready for your business.
Five terms cover everything in this guide.
Brain. The stored memory. Every agent connected to the same brain sees the same pages.
Page. One saved note with a title. In this guide, a page is a research document such as Founders and AI Analysis.
Source. Where a fact came from, such as a link or a file. GBrain stores facts with their sources, so you can check them.
MCP. Model Context Protocol, a standard way for AI tools to plug into each other. Hermes talks to GBrain through MCP.
Keyless. GBrain's starting mode. It needs no API key and uses plain keyword search, so a clear page title makes a page easy to find.
Before you start
You need four things.
| Need | What it means |
|---|---|
| Bun | GBrain requires Bun 1.4.0 or newer. Bun is a tool for running JavaScript programs. |
| Two agents | At least two agents that can use MCP. This guide uses Hermes, the agent from Nous Research. |
| A terminal | The window where you type commands. You can also ask your agent to run them. |
| One decision-maker | The person who decides which agents may write to the memory and which may only read it. |
What it costs. GBrain is free and its starting mode needs no API key. You still pay for:
- Your agents' model usage: whatever GBrain recalls is read by the model behind each agent.
- Hosting, if you run a shared server instead of one computer.
- Optional extras: semantic search, synthesis and background enrichment use model providers you configure yourself.
The README calls the always-on server setup for Hermes the highest-cost path, with a server of 8 GB or more of memory plus raw API usage. This guide does not use it.
Data. The model your agent uses sees recalled memory even in keyless mode. If you later configure cloud embedding or synthesis providers, text goes to them too. Keep passwords, API keys, bank details and customers' personal data out of every page.
Install GBrain
GBrain is not on npm. The npm package named gbrain is unrelated and can shadow the real one. Never run npm install -g gbrain or bun add -g gbrain.
Install from GitHub and create a local, keyless brain:
bun install -g github:garrytan/gbrain
gbrain init --pglite --no-embedding
gbrain doctorThe first line installs GBrain. The second creates a brain on your computer with no server, no Docker and no API key. The third checks that it is healthy.
Checkpoint.
Pass: gbrain doctor finishes without reporting a problem.
Stop: if you installed from npm by mistake, run npm uninstall -g gbrain or bun remove -g gbrain, then install again with the command above. gbrain doctor detects the wrong package.
Or let your agent install it. The README's one-paste route for Hermes is to give your agent this instruction:
Retrieve and follow the instructions at:
https://raw.githubusercontent.com/garrytan/gbrain/master/INSTALL_FOR_AGENTS.mdThe agent starts with keyless memory and verifies it. API keys, automatic capture, paid enrichment and the overnight enrichment cycle are separate opt-in choices, and this instruction does not authorise them. Read that file yourself before you let an agent run it.
The rest of this playbook is below.
Enter your email to read it. You also get one new playbook every week.
One email a week. Unsubscribe any time.
Connect every agent to the same brain
Each agent needs one connection to the same brain. For Hermes on the same computer as the brain, run these two commands from GBrain's README:
printf 'Y\n' | hermes mcp add gbrain --env GBRAIN_HOME=$HOME --connect-timeout 60 --command $(which gbrain) --args serve --surface full
hermes mcp test gbrainThree details matter:
- Keep --args last in the command.
- The add command exits cleanly even when it fails, so always run the test.
- GBRAIN_HOME tells GBrain where to look for the brain. Use the same value for every agent on this computer.
Repeat the commands for each agent that should share the memory, in that agent's own Hermes setup.
Checkpoint.
Pass: hermes mcp test gbrain succeeds for every agent you connected.
Stop: an error, or no GBrain tools listed. Fix it before you go on.
Agents on different computers. Run one shared server instead. The README recommends gbrain mcp expose, which publishes your brain on your Tailscale network with HTTPS. Adding --funnel is the opt-in for agents that run in a vendor's cloud. Each agent then connects with its own token. GBrain's Hermes page and its remote MCP guide cover the connection. This guide did not test it.
Two agents writing at once. The starting brain uses PGLite, a lightweight database. The README points shared and multi-machine brains to Postgres, and the community Hermes plugin describes PGLite as its single-writer option. In this guide's example, one agent writes and another reads. If several agents write at the same time, or you see lock errors, use Postgres or the shared server. GBrain's INSTALL guide covers both.
Give every agent the same memory rules
Connecting an agent gives it access to the memory. It does not tell the agent when to use it. Paste these rules into the standing instructions of every connected agent, the place where you keep its role and rules.
Memory rules (shared GBrain)
1. Before you answer a question about our business, our research or our customers, search GBrain first. Say which page you used.
2. When I ask you to remember something, or when you finish research I will rely on, save it to GBrain as a page. Use a clear, plain title that someone would search for.
3. Write each finding on its own line with its source next to it: a link, a file, or the person who told you. If there is no source, say so on that line.
4. If a page with that title already exists, update it. Do not create a second page.
5. If I correct a fact, correct it in GBrain and keep the original source. If I withdraw a fact, withdraw it and confirm.
6. Never save passwords, API keys, bank details or customers' personal data.
7. If GBrain has nothing on the question, say so. Do not guess.Rule 2 is what lets an agent save findings without being asked every time. Without it, or without opting in to GBrain's automatic capture, an agent saves only when you tell it to. Automatic capture is a separate choice inside GBrain.
These rules are written for this guide. They are not GBrain settings.
Run the loop once
Give your research agent a finished research document, or ask it to write one. Then run three steps.
Step 1: the research agent saves it.
Save this research as a page in GBrain titled Founders and AI Analysis. Put today's date at the top. Write each finding on its own line with its source link. If the page already exists, update it. When you are done, show me the page title and the text you saved.Pass: the agent names the page title and shows the saved text, with a source on each line.
Stop: no title, or findings with no sources. Check the rules in section 6 and run it again.
Step 2: another agent answers from it. Open a new conversation with a different agent.
Search GBrain for Founders and AI Analysis. Tell me what the research found about how founders use AI. Use only that page. Name the page and show the source for each point. If you cannot find it, say so.Pass: the answer names the page and matches what was saved.
Stop: a confident answer that is not on the page, or no page named. The agent is guessing, not recalling.
Step 3: correct a fact and withdraw one.
One finding on Founders and AI Analysis is wrong: [paste the line]. Correct it in GBrain, keep the original source and tell me what changed. Then withdraw the finding about [topic] and confirm it no longer appears when you search.Check it yourself. Do not rely on the agent's word. Search the brain from your terminal:
gbrain search "Founders and AI Analysis" --jsonPass: the page is returned. If a page you saved does not appear, ask your agent: Check whether my search index is ready. GBrain says search can be incomplete while it rebuilds.
Who can write and who can only read
Memory that every agent can edit is memory that one bad answer can damage. Start with one writer.
| Level | Access | Who gets it | Rule |
|---|---|---|---|
| 1: Read | Search and read pages | Your personal and day-to-day agents | The default for every agent except the writer |
| 2: Write | Save and correct pages | Your research agent only, at first | Add a second writer only after a month of clean pages |
| 3: Admin | Register clients and change access | You | Never give this to an agent |
These levels are this guide's recommended policy. They map to the access scopes in GBrain's HTTP server: read, write, admin and agent.
Be clear about where they apply. When an agent connects as a remote client through the HTTP server, GBrain limits it to the access you grant. On one computer, agents connected the way section 5 shows share the same files and credentials, and the README says sources alone do not isolate those callers. For hard read-only access, connect that agent as a remote client with only the read scope. The README's example for creating a token is gbrain auth create local-agents --scopes read,write. Use read alone for a read-only client.
Rules for the people:
- Name one writer and write it down.
- GBrain saves memories brain-wide by default and supports a private visibility for facts that should stay local. Decide which facts are which before agents start saving.
- Read five saved pages a week and check their sources.
Starter checklist
Today, no setup
- Pick one finding one of your agents would save, and one other agent that should know it
- Write down who may write to the memory
Setup
- Install Bun 1.4.0 or newer
- Install GBrain from GitHub, never from npm
- Run gbrain init --pglite --no-embedding, then gbrain doctor
- Connect each agent and run hermes mcp test gbrain
Before the first real finding
- Paste the memory rules into every agent
- Run the three steps in section 7
- Search the brain from your terminal to confirm the page exists
Each week
- Read five saved pages and check their sources
- Remove anything wrong or out of date
- Check that no secrets were saved
After a month
- Decide whether a second agent may write
Troubleshooting
| What you see | What to do |
|---|---|
| The gbrain command is missing or behaves strangely | You may have installed the unrelated npm package. Run npm uninstall -g gbrain or bun remove -g gbrain, install from GitHub, then run gbrain doctor |
| hermes mcp add finishes but no tools appear | The add command exits cleanly even on failure. Run hermes mcp test gbrain, keep --args last, and add the command again |
| The second agent cannot find the first agent's page | Check that both agents use the same GBRAIN_HOME or the same server. Confirm the page exists with the terminal search in section 7. A fact saved as private stays local |
| The page is saved but search returns nothing | Search can be incomplete while GBrain rebuilds. Ask your agent: Check whether my search index is ready. Then search again using a word from the page title |
| Lock errors when two agents write | Switch to Postgres or the shared server. PGLite suits one writer |
| The agent answers confidently without naming a page | Rules 1 and 7 in section 6 are missing or ignored. Paste the rules again and repeat Step 2 |
| gbrain doctor reports a schema problem | The README points to gbrain apply-migrations --yes --no-autopilot-install. If it still reports a problem, run gbrain doctor --json and follow the fix it prints |
Honest limits
- GBrain is large and changing fast. On October 24, 2026 the repository showed about 9,580 commits and 291 open issues. Expect changes between releases.
- Agents save only when your rules tell them to, or after you opt in to automatic capture. Connecting an agent does not make it save anything.
- The model behind each agent sees whatever GBrain recalls, even in keyless mode.
- Shared memory spreads mistakes. A wrong fact saved with a source is still wrong, and every connected agent will repeat it. A source lets you check a fact. It does not make it true.
- On one computer, connected agents share the same files and credentials. Only remote clients with scoped tokens get limited access.
- Keyword search finds pages by their words. A vague page title makes a page hard to find.
- Markdown export is not a full database backup. Back up the database itself.
- The Hermes plugin for GBrain is a community plugin, not official, and the Hermes catalog says it is not affiliated with GBrain. Its setup script installs Bun with a download-and-run command, installs an unpinned copy of GBrain from GitHub, and sets up PostgreSQL with sudo. This guide uses GBrain's own Hermes command, not that plugin.
- Popularity is not maturity. About 31,100 stars show interest, not that it suits your business.
How this guide was made. This guide is built from GBrain's README and from the Hermes plugin catalog page for GBrain. Sources were checked on October 24, 2026. No brain was installed and no agent was connected for this guide, and the research example and page title are illustrations. Commands, settings and screens may change, so follow the linked documentation where it differs.
Links
- GBrain official GitHub repository
- GBrain with Hermes (MCP guide)
- GBrain agent install instructions
- GBrain install guide
- Use your brain from anywhere over MCP
- GBrain memory boundaries
- Hermes catalog page for the community GBrain plugin
- Hermes Agent repository
What this changes
When an agent's finding lives in its own memory, only that agent benefits. Put the memory in one place, make every agent write down what it learned with its source, and the next agent starts from the finding instead of from nothing.
Start with one finding and two agents. The tool matters less than the habit: if a finding is not saved with its source, the next agent has to guess.



