Open-source project
garrytan/gbrain avatar
garrytan/gbrain

GBrain: A Searchable Long-Term Memory Layer for Coding Agents

gbrain adds searchable long-term notes to OpenClaw, Hermes Agent, Claude Code, and Codex so earlier work can be retrieved in later sessions.

29,960 stars4,476 forksTypeScriptMIT

At a glance

What is it?
GBrain adds searchable, synthesized long-term notes to OpenClaw, Hermes Agent, Claude Code, and Codex. It combines a synthesis layer, a self-wiring knowledge graph, and gap analysis, but its setup and operational costs vary sharply by path.
Who is it for?
Adopt GBrain if you run an AI agent that keeps losing context across sessions and you want synthesized answers with citations, not just page lists. Do not adopt it if you expect a simple npm install or if your team cannot tolerate a 24/7 daemon for the always-on path.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly TypeScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The Amnesia Problem GBrain Targets

Coding agents like Claude Code and Codex remember little across sessions. They handle the current task well, but earlier work, meeting notes, and decisions vanish from context. GBrain addresses this by adding a searchable long-term note layer. The intended user is someone running an AI agent for real work, not a hobbyist. The README describes a personal brain with 155,795 pages, 24,589 people, and 5,340 companies, but those numbers are the author's own deployment, not a benchmark you can reproduce. The core claim is that search gives you raw pages, while GBrain gives you an answer. That distinction drives the entire design.

Synthesis, Graph Traversal, and Gap Analysis in One Box

GBrain does three things that the README says no other tool ships together. First, a synthesis layer that returns a written answer with citations, not a list of chunks. Second, a knowledge graph that extracts entity references and creates typed edges like attended, works_at, invested_in, founded, and advises, all without LLM calls. Third, gap analysis that explicitly tells you what the brain does not know yet. The meeting-prep example shows this: the answer summarizes Alice's role, open action items, and then warns that nothing has been added about her in six weeks. That gap note is the differentiator. The graph is self-wiring because it builds edges during page writes, so you can query relationships that vector search alone would miss.

How the Data Flow Works

The architecture is a daemon that runs 24/7 to ingest, enrich, and consolidate memory. The README describes it as easier to ship a daemon than to keep an agent in chat working hard. The daemon ingests meetings, emails, tweets, voice calls, and ideas, then enriches every person and company it encounters. It fixes citations and consolidates memory overnight. On the query side, you ask a natural-language question, and the system searches across pages, traverses the graph, and synthesizes an answer. The database is PGLite, which is a serverless PostgreSQL variant, and it is ready in two seconds. The README claims zero LLM calls for graph edge extraction, which is a concrete design choice that keeps costs down and makes the graph deterministic.

Installation Paths: Codex, Claude Code, OpenClaw, or Hermes

Installation is agent-driven, not a typical package install. The README warns that GBrain is NOT distributed on npm. The npm package named gbrain is unrelated and can shadow the real binary on your PATH. The documented install paths are bun install -g github:garrytan/gbrain, or git clone plus bun install and bun link. If you already ran the npm install by mistake, the fix is npm uninstall -g gbrain or bun remove -g gbrain, then reinstall from GitHub. The recommended first step is Codex, which runs on a ChatGPT subscription and takes about 15 minutes, with no deployment. Claude Code has an identical path. For the always-on setup, OpenClaw or Hermes requires a real server and API cost, taking about 30 minutes. There is also a CLI standalone path and an MCP table for connecting to AI clients, though the README is truncated on those details.

The Company Brain and Multi-User Scoping

GBrain also works as a shared team memory. Each person gets a slice of the brain scoped by login, so queries only return data they are allowed to see. The README claims the team fuzz-tested search, list, lookup, and multi-source reads and found zero leaks. That claim is unverified by an independent party, but it is a specific design feature. The company-brain shape is tied to Y Combinator's Request for Startups, which is a marketing angle but also a concrete use case. If you are building a company-brain product, the README suggests building on GBrain. The multi-user scoping is a differentiator over personal-knowledge tools that assume a single user, but it also adds operational complexity around login management and permission enforcement.

Performance Numbers and What They Do Not Prove

The README cites a benchmark: P@5 49.1% and R@5 97.9% on a 240-page Opus-generated rich-prose corpus, plus a +31.4 point P@5 gain over its graph-disabled variant and over ripgrep-BM25 plus vector-only RAG. These numbers appear in the README, but they come from a single corpus generated by one LLM. They are not a general guarantee. The README points to a sibling repo, gbrain-evals, for full scorecards. If you are evaluating GBrain, you should treat these numbers as directional, not as a promise for your own data. The recall number is high, which suggests the graph helps find relevant pages, but precision is below half, meaning many retrieved results may be irrelevant. The gap analysis feature may compensate by telling you what is missing, but you will still have to filter results.

Limitations and Wrong-Tool Cases

GBrain is not a lightweight tool. The always-on path requires a server and API costs, which may be overkill for a solo developer who only needs occasional session memory. The install warning about npm shadowing is a real failure mode: if you run the wrong install command, you get an unrelated package and a broken PATH. The README says gbrain doctor detects shadowing and prints a fix, but that is an extra step. Another limitation is that the synthesis layer depends on the quality of your ingested notes. If you feed it sparse or noisy data, the answers and gap analysis will reflect that. The graph edges are typed but limited to the five listed types; if your domain needs custom relationships, the README does not describe how to extend them. Also, the multi-user scoping is only as safe as the login implementation; the fuzz-test claim is not a formal security audit.

Alternatives and the Difference in Approach

The README contrasts GBrain with two alternatives. One is ripgrep-BM25 plus vector-only RAG, which is the typical retrieval stack: keyword search combined with embeddings. That approach returns chunks of text that match a query, but it does not synthesize an answer or traverse a graph. The other alternative is a graph-disabled variant of GBrain itself, which shows the graph's contribution to precision. If you already use a tool like Obsidian with a vector plugin, you get search and links, but you do not get the synthesis layer or gap analysis. The fundamental difference is that GBrain treats retrieval as a step toward an answer, not as the final output. For teams that just need fast grep-like search over notes, a simpler tool will be cheaper and easier to operate.

Maintenance, Upgrades, and License

The project is MIT-licensed, which means you can use, modify, and redistribute it with few restrictions, but that is not legal advice. The release cadence is active: v0.47.5.0 was pushed on 2026-08-29, with v0.47.4.0 and v0.47.3.0 on consecutive days. That suggests frequent updates, which is good for features but means you need a repeatable upgrade process. Since installation is from GitHub, upgrades are not a simple package manager command. You will likely need to git pull and re-link or re-install. The README does not describe an upgrade script, so plan for manual steps. The daemon that runs 24/7 also needs monitoring, but the README does not specify how. The PGLite database is embedded, so you do not run a separate server, but you still need to back it up if your notes are valuable.

Editorial conclusion

Adopt GBrain if you run an AI agent that keeps losing context across sessions and you want synthesized answers with citations, not just page lists. Do not adopt it if you expect a simple npm install or if your team cannot tolerate a 24/7 daemon for the always-on path. Before adopting, verify that the npm package named gbrain is not shadowing the real binary on your PATH, and confirm that the PGLite database and your chosen agent integration (Codex, Claude Code, OpenClaw, or Hermes) match your existing workflow. The project is MIT-licensed, but the absence of npm distribution means you must install from GitHub and manage upgrades via git.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Community notes

Community notes