garrytan/gbrain

▲ 40 stars today★ 30,646⑂ 4,596

Garry's Opinionated OpenClaw/Hermes Agent Brain

About garrytan/gbrain

garrytan/gbrain is an open-source project on GitHub, mainly written in TypeScript. Garry's Opinionated OpenClaw/Hermes Agent Brain It currently holds 30,646 stars and 4,596 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).

Project Overview

AI Homed tracks it on the Today's Trending board, currently at rank #32 with 40 new stars today.

GitHub Repository Details

Repository garrytan/gbrain · default branch - · size 0 KB · watchers 0 · source: GitHub REST API and repository README

README

GBrain

Give the agent you already use a memory you control. GBrain stores explicit facts with their sources, supports corrections and withdrawal, and makes the same memory available across your agents. Start with keyless memory and keyword retrieval; add semantic search, synthesis, and background enrichment when you need them.

Keep skills beside knowledge. New local brains include memory skills in their content root. Agents can join an authorized catalog; only approved editors can publish. Managed coding-agent installs add an owned native router; restart and real-use verification are separate steps. Staged migration preserves sharing choices and personal edits. See shared brain skills.

Choose your setup

1. Add GBrain to my existing agent — recommended. Keep your agent's identity and save memory inside its environment. No new personal-agent identity or private repository is required. Start with the guide for Grok Bot, Muse, or Codex / Claude Code. Other harnesses. 2. Use the brain on my own computer from everywhere. One command publishes it over MCP on your Tailscale tailnet and keeps it running: gbrain mcp expose (add --funnel for cloud agents such as Grok Bot, Muse and ChatGPT). Follow use your brain from anywhere over MCP. Say to your agent: "use my brain over mcp" — "put my brain on tailscale". 3. Connect my existing hosted brain. Follow hosted harness access to choose native OAuth or a private machine connection. For dashboard login, clients, and permissions, use MCP administration with the server's separate owner credential. Delegation is an explicit choice.

Grok Bot and Grok Build are different products. Muse's personal agent and Muse Code are different products too. Muse already has native editable memory; GBrain adds an explicit, portable record with provenance and shared access. See each guide's dated evidence and remaining verification steps.

I'm Garry Tan, President and CEO of Y Combinator. I built GBrain to run my own AI agents. It's the production brain behind my OpenClaw and Hermes deployments: 155,795 pages, 24,589 people, 5,340 companies, 66 cron jobs running autonomously. My agent ingests meetings, emails, tweets, voice calls, and original ideas while I sleep. It enriches every person and company it encounters. It fixes its own citations and consolidates memory overnight. I wake up smarter than when I went to bed — and so will you.

It works as a company brain too. Authenticated remote clients are constrained by source and operation grants plus visibility filters. Local files and shared database credentials are a different trust boundary: sources alone do not isolate those callers. The authorization tests exercise specific access paths, not a universal no-leak guarantee. Read the sharing boundaries and company-brain tutorial before setting up shared access.

Alongside keyword and semantic retrieval, GBrain offers two optional ways to use your stored knowledge:

The point of building a 150K-page brain is to use it as a strategic moat. To never lose context. To query what's in your own head without re-reading it. The brain layer is what makes the moat usable. The 24/7 dream cycle is what keeps it sharp. Both run on your hardware, your DB, your keys.

It's easier to ship a daemon that runs 24/7 to ingest, enrich, and consolidate than it is to keep an agent in chat working hard. GBrain is that daemon, generalized. Install in 30 minutes. Your agent does the work. As my personal agent gets smarter, so does yours.

Start keyless. Your harness subscription and any separately configured model API usage are different costs. The optional personal-agent bootstrap takes about 15 minutes; always-on enrichment needs its own compute and API configuration.

Durable preferences and facts can be shared across agents; transient task and harness configuration state stay local. Configured cloud embedding, reranking, extraction, and synthesis providers can receive text, and the harness model sees recalled memory even in keyless mode. Markdown export is not a full database backup. Read memory boundaries.

LLMs: fetch llms.txt for the documentation map, or llms-full.txt for the same map with core docs inlined in one fetch. Agents: start with AGENTS.md (or CLAUDE.md if you're Claude Code).

What this looks like

Say you have a meeting with Alice tomorrow. You want to walk in remembering what she works on, when you last talked, and what's still open between you. Here's what you'd type, and what you'd get back.

You ask:

"What do I need to know before my meeting with Alice tomorrow?"

Most personal-knowledge tools give you back a list of pages. Something like:

1. people/alice — Alice runs engineering at Acme...
2. meetings/2026-03-15-alice-q1 — Q1 product review with Alice...
3. meetings/2026-01-08-acme-kickoff — Kickoff meeting with Acme team...
4. customers/acme — Acme is a series-B fintech we work with...
5. notes/2026-04-22 — Quick chat with Alice about pricing...

Five pages you now have to open and read yourself to actually prepare. The tool found the right material, but it didn't do the work.

GBrain gives you back the answer, with sources:

Alice runs engineering at Acme (a series-B fintech). You last spoke
on April 22 in a quick pricing chat. Three things are still open
from that conversation:

1. She owes you the security review for the new tier (deadline was May 1; no update since). 2. You committed to pricing for a 500-seat tier (you sent it April 25; no response yet). 3. She mentioned they're hiring a CISO; you said you'd intro someone from your network.

Heads up: nothing's been added to the brain about Alice or Acme since April 22, six weeks ago. She may have replied through email or Slack DM, channels the brain doesn't see. Worth asking her to catch up before assuming any of this is still current.

Every claim has a source page behind it. The "heads up" at the end tells you what the brain doesn't know yet, so you can ask Alice about it directly instead of being surprised. The brain just did your meeting prep.

This is the difference between a search engine and a brain. Search finds the pages. The brain reads them for you and writes the answer.

Install

Requires Bun 1.4.0 or newer. Existing worker installations should follow the authorization and queue upgrade guide before restarting services with this version.

[!WARNING]
GBrain is NOT distributed on npm. The npm package named gbrain is an unrelated
package with no connection to this project. Do not run npm install -g gbrain or
bun add -g gbrain — you'll get something else, and it can shadow the real binary on
your PATH. Install and upgrade ONLY via the documented paths below
(bun install -g github:garrytan/gbrain, or git clone + bun install && bun link).
If you already ran the npm install by mistake: npm uninstall -g gbrain /
bun remove -g gbrain, then reinstall from GitHub. gbrain doctor detects a
shadowing npm install and prints the fix.

Start with the agent you already use. For Grok Bot and Muse, the dedicated guides above install an isolated launcher, repairable runtime, and memory in a verified persistent directory. For a coding agent, paste:

Add GBrain memory to this existing agent. Read and follow:
https://raw.githubusercontent.com/garrytan/gbrain/master/INSTALL_FOR_AGENTS.md
Keep my current identity and instructions. Start keyless, preserve unrelated
configuration, and use the memory-only path. Do not create a personal-agent
identity or private repository. Show me the required search-mode choice.
Verify a unique remember/recall/correction/withdrawal round trip using observed
GBrain calls, then tell me how to verify recall in a new conversation.

Codex guide · Claude Code guide · Memory-only walkthrough · CLI standalone.

The following bootstrap paths are optional: use them when you want GBrain to help create a new persistent personal agent, including identity files and a private repository.

For Codex — optional personal-agent bootstrap

Turn Codex into your persistent personal agent. (Just want the brain + skills without the full agent? codex plugin marketplace add garrytan/gbrain@codex-plugin then codex plugin add gbrain@gbrain — see docs/mcp/CODEX.md. The paste block below builds the whole agent.) Works in the ChatGPT desktop app (open Codex on a folder) and in the Codex CLI (codex in a terminal) — same install, same result. Open Codex in a new, empty folder (not an existing code project) — that folder becomes your agent's own private GitHub repo, which bootstrap creates and privacy-verifies for you. Then paste:

Read and follow every step of:
https://raw.githubusercontent.com/garrytan/gbrain/latest-stable/BOOTSTRAP_FOR_AGENTS.md
Goal: set yourself up as my persistent personal agent in this folder, with gbrain
as your memory. Interview me before writing any identity file — never invent
answers. Ask before anything destructive. You are not done until
gbrain bootstrap verify exits 0.

Bootstrap creates identity files from your answers, a local keyless brain, MCP registration, and a private repository. Command approvals are normal. Verify a saved fact in a fresh conversation; identity-file recall alone is not that test. The repo is not a complete backup. For private-repo adoption, optional providers, cloud behavior, and uninstall, read the bootstrap guide.

For Claude Code — optional personal-agent bootstrap

Works in the desktop app and in the CLI (claude in a terminal) — identical harness, identical result. Open Claude Code in a new, empty folder (not an existing code project) — that folder becomes your agent's own private GitHub repo, created and privacy-verified for you. Then paste the same block:

Read and follow every step of:
https://raw.githubusercontent.com/garrytan/gbrain/latest-stable/BOOTSTRAP_FOR_AGENTS.md
Goal: set yourself up as my persistent personal agent in this folder, with gbrain
as your memory. Interview me before writing any identity file — never invent
answers. Ask before anything destructive. You are not done until
gbrain bootstrap verify exits 0.

Claude Code also supports per-turn context and persistence hooks, with opt-outs. A fresh-conversation recall test must observe actual GBrain calls, not infer the source from the answer. See bootstrap for cloud setup, private-repo adoption, hooks, recovery, and removal.

For OpenClaw or Hermes — GBrain as intended, always on

This is GBrain used the way it was designed to be used: a server-hosted agent with 24/7 crons, continuous ingestion, and the overnight dream cycle that enriches your brain while you sleep — your agent works whether your laptop is open or not. It's also the highest-cost path: a deployed server (8GB+ RAM) plus raw API token usage that scales with how hard your agent runs, well beyond a chat subscription. Start here if you want the full experience from day one; start with Codex above if you want to feel it first. If you don't have a platform running yet, both deploy in one click:

Then paste this into your agent:

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

The agent starts with keyless memory and verifies it. API keys, automatic capture, paid enrichment, and the dream cycle are separate opt-in choices; the install prompt does not authorize all of them.

Never set up an AI agent platform before? The personal-brain tutorial walks the whole path end-to-end — picking OpenClaw vs Hermes, deploying it, pointing it at INSTALL_FOR_AGENTS.md, getting the API keys, and verifying the first query. Start there if any of the above is new.

Lighter ways in

Just want a memory for your coding agent — no identity, no repo. Spin up a local brain and connect it in two commands — zero server, zero token, zero tunnel. --surface verbs gives your agent the seven-verb memory protocol (recall, remember, entity, synthesize, forget, context_pack, delta — MEMORY_VERBS v1, frozen + additive-forever) instead of the full tool wall; drop the flag for every operation:

gbrain init --pglite --no-embedding                     # keyless local brain (no Docker)
claude mcp add gbrain -- "$(command -v gbrain)" serve --surface verbs   # or: codex mcp add gbrain -- "$(command -v gbrain)" serve --surface verbs

If claude is not found, install Claude Code first — or use the per-harness blocks in the protocol doc. Heads-up: memories agents save default to brain-wide visibility (every connected agent can recall them); pass visibility: "private" for local-only facts.

Already have a brain on a remote host (OpenClaw, Hermes, or any gbrain serve --http)? Point your laptop agents at it with one command each — --install wires it up and smoke-tests the token before handoff:

gbrain connect https://your-host/mcp --token gbrain_xxx --install               # Claude Code
gbrain connect https://your-host/mcp --token gbrain_xxx --agent codex --install # Codex

Onboarding a whole agent harness onto a shared brain? On the brain host, gbrain agent register --harness claude-code mints a scoped OAuth client plus a 30-day token and prints the paste-ready wiring block — presets for daily-driver and write-isolated coding agents. The onboarding decision table says which path fits.

Brain-only install into another coding agent (Cursor, Claude Cowork, or anything that can fetch a URL and run shell commands) — paste the OpenClaw/Hermes block above (INSTALL_FOR_AGENTS.md). It starts with keyless memory without replacing the agent's identity. Skills, automatic capture and the dream cycle are separate choices; verify activation in the intended harness.

→ Full walkthrough: give your coding agent a memory — the memory-only paths end to end, plus the brain-first protocol you paste into CLAUDE.md / AGENTS.md and the four habits that make it actually change how you work.

CLI standalone (no agent)

bun install -g github:garrytan/gbrain
gbrain init --pglite --no-embedding  # keyless; no server, no Docker
gbrain doctor            # verify health
gbrain import ~/notes/ --no-embed   # index your markdown
gbrain search "a phrase from a note" --json

Postgres-at-scale, Supabase, and thin-client setup paths live in docs/INSTALL.md. For an existing keyless brain, follow the memory-only upgrade path to keep daemon installation and paid reindexing opt-in.

Connect GBrain to your AI client (MCP)

For a hosted brain, start with the native OAuth and private machine connection guide. To open the dashboard, register clients, edit access, or invalidate tokens, use MCP administration. A profile controls MCP authority; a surface controls which granted tools are visible. Neither grants owner dashboard access. New memory profiles use the starter surface. --surface verbs retains exactly the seven memory verbs, with orientation available through gbrain://capabilities. Thin CLI connections use the full surface and remain restricted by their grants.

Choose the connection instructions for your actual product:

Upgrading a brain indexed before v0.48.3.0: its search chunks need rebuilding before remote chunk retrieval returns them. Semantic result caching is temporarily disabled; stored contradiction reports and code-inspection tools have local-only limits. Follow the upgrade recovery guide for rebuild commands, embedding costs, and the restrictions that remain after rebuilding. Say to your agent: "Upgrade gbrain and check whether my search index needs rebuilding."

For the HTTP server itself:

gbrain serve              # stdio MCP (local subprocess; for Claude Code, Cursor, Windsurf)
gbrain serve --http       # HTTP MCP with OAuth 2.1 + admin dashboard at /admin
                          # (required for Claude Desktop, Cowork, Perplexity, ChatGPT)
gbrain mcp expose         # publish serve --http on your Tailscale tailnet with HTTPS + a user service
gbrain mcp expose --funnel  # same name, public HTTPS — for agents that run in a vendor's cloud

gbrain mcp expose is the recommended way to run the server from your own computer: it installs Tailscale if needed (after a consent prompt), signs in, publishes the server on https://your-machine.your-tailnet.ts.net/mcp, keeps the admin token in a private file, installs a launchd / systemd user service, and prints separate owner-login, native OAuth, and machine-client next steps (--status re-checks, --remove undoes only its own changes). Local coding agents on the same machine: gbrain bootstrap harness --yes --port 3131 on a Postgres brain; on PGLite mint a token before the service runs (gbrain auth create local-agents --scopes read,write) and pass --token, or grant a scoped client through the running server (gbrain mcp grant … --admin-token-file ~/.gbrain/serve/admin-token). Tailnet-only by default; --funnel is the explicit

GitHub Stars & Activity

30,646Stars
4,596Forks
0Open issues
TypeScriptLanguage

GitHub Popularity

GitHub stars30,646
Forks4,596
Open issues0
Primary languageTypeScript
License-
Stars gained today40
Created-
Last pushed-

Trending History

Daily boardrank #32 · ▲ 40 stars

Related AI Projects

1

deepseek-ai / deepseek-harness

TypeScript★ 245,133⑂ 0
→
2

n8n-io / n8n

TypeScript★ 206,820⑂ 0
→
3

firecrawl / firecrawl

TypeScript★ 189,447⑂ 0
→
4

langgenius / dify

TypeScript★ 158,032⑂ 0
→
5

anthropics / claude-code

TypeScript★ 149,748⑂ 25,718▲ 161 stars
→
6

thedotmack / claude-mem

TypeScript★ 97,602⑂ 8,594▲ 578 stars
→
7

twentyhq / twenty

TypeScript★ 58,039⑂ 9,468▲ 74 stars
→
8

morluto / rea

TypeScript★ 13,925⑂ 1,473▲ 4,666 stars
→

More AI Rankings