GBrain

A self-hosted memory brain for the agent you already use: sourced facts, corrections and withdrawal, shared across your agents.

Source repo
garrytan/gbrain
Stars
★ 31k
Last updated
1mo ago
FARS reviewed
Oct 20, 2026
License
MIT
Primary language
TypeScript

At a glance

How it runs
CLIMCP serverAgent plugin / skill
Works with
Universal · cross-platformChatGPT · Codex · Claude Code · OpenAI APIClaude.ai (Partial support)
Cost
Free tier plus a paid hosted plan
Setup effort
Medium · a few setup steps
You'll need
Bun 1.4.0 or newerPostgres + pgvector (optional, for large deployments)Shell / CLINetwork accessLocal filesystemMCP Server
Typical use
A developer already using Claude Code or Codex who wants durable, searchable memory for that existing agent without creating a new personal-agent identity or private repository.
Not a fit if
  • Users who want a zero-install, no-terminal experience
  • Teams that cannot send any memory text to cloud embedding or synthesis providers
  • Anyone expecting a fixed note schema that works without configuration
Maintenance
Commits in the last 6 monthslast commit 2026-10-20

What does this agent do, and when should you use it?

GBrain is Garry Tan's open-source (MIT) memory layer, extracted from the brain running his own OpenClaw and Hermes deployments. It stores explicit facts together with their sources, supports corrections and withdrawal, and makes the same memory readable by multiple agents. Storage defaults to PGLite (Postgres 17 compiled to WASM, zero configuration), with Postgres + pgvector for shared or large deployments; the CLI and the MCP server are generated from one contract-first interface. It is reachable as a terminal tool, as a stdio or HTTP MCP server with OAuth 2.1 and an admin dashboard, and as plugins or documented connections for Claude Code, Codex, ChatGPT, Cursor, OpenClaw, Hermes and others. Retrieval starts keyless with keyword search; semantic search, synthesis and background enrichment are opt-in. The author reports his production brain at 155,795 pages, 24,589 people, 5,340 companies and 66 cron jobs.

The loop is signal → search → respond → write → auto-link → sync. GBrain parses Markdown brain repositories and indexes them into PGLite or Postgres. gbrain search returns ranked raw pages using hybrid scoring (vector + keyword + RRF + source-tier boost + reranker); gbrain think runs the same retrieval and then composes a cited answer that explicitly states what the brain does not know yet. On the write path, trusted local page writes extract typed edges such as [[people/alice-example]] by pure pattern matching with no LLM call, while remote put_page edges arrive later through sweeps, maintenance or add_link. gbrain agent run exposes the same surface to a sub-agent through the Minions queue with crash-safe two-phase persistence. A cron-driven dream cycle deduplicates people pages, fixes citations, scores salience, finds contradictions and prepares tomorrow's tasks. It ships through gbrain serve (stdio MCP) or gbrain serve --http (HTTP MCP with OAuth 2.1 and an /admin dashboard), and gbrain mcp expose publishes the server over Tailscale.

  1. A developer already using Claude Code or Codex who wants durable, searchable memory for that existing agent without creating a new personal-agent identity or private repository.
  2. Someone preparing a client meeting who asks what they need to know about Alice and gets a cited answer plus a warning that nothing has been added since April 22, instead of five pages to read.
  3. A 10–50 person team building a shared company brain, constrained by OAuth scopes, source and operation grants, and visibility filters.
  4. Operators running an always-on OpenClaw or Hermes agent that must ingest meetings, email, tweets and voice calls and enrich itself overnight.
  5. A user with years of Obsidian or Notion exports who wants the brain to learn their own folder structure via gbrain schema detect and gbrain schema suggest rather than a fixed template.
  6. A solo user who wants the brain on their own machine and reachable from laptop or phone agents over MCP.

Key setup facts

Pulled from the install and usage notes below. The project README has the current values.

Install / run
  • bun install -g github:garrytan/gbrain
  • npm install -g gbrain
Runtime
Bun 1.4.0
Install notes cover
Docker

How do you install or deploy this agent?

Requires Bun 1.4.0 or newer. GBrain is not distributed on npm — the npm gbrain package is unrelated and can shadow the real binary, so never run npm install -g gbrain.

bun install -g github:garrytan/gbrain
gbrain setup claude-code   # or: gbrain setup codex; --dry-run previews, --remove undoes

setup prints the brain, source, launcher and owner it resolved before writing, runs gbrain init --pglite --no-embedding only when no brain exists, writes the stdio MCP entry and read-context hooks, and smoke-tests them.

Standalone CLI path (no agent, no server, no Docker):

bun install -g github:garrytan/gbrain
gbrain init --pglite --no-embedding
gbrain doctor
gbrain import ~/notes/ --no-embed
gbrain search "a phrase from a note" --json

If you installed the npm package by mistake, run npm uninstall -g gbrain or bun remove -g gbrain, then reinstall; gbrain doctor detects the conflict. For an unmigrated schema, run gbrain apply-migrations --yes --no-autopilot-install; exit 1 means it is still behind, so use gbrain doctor --json rather than --yes.

How do you use this agent?

Two query modes: raw retrieval and synthesized answers.

gbrain search "who's working on AI agents at portfolio companies?"
gbrain think "who's working on AI agents at portfolio companies?"

Serve it over MCP — stdio for local subprocesses, HTTP for clients that need OAuth.

gbrain serve              # stdio MCP
gbrain serve --http       # HTTP MCP + OAuth 2.1 + /admin dashboard
gbrain mcp expose         # publish on your Tailscale tailnet, installs a user service
gbrain mcp expose --funnel  # public HTTPS for cloud agents

Point a laptop agent at a remote brain (--install wires it up and smoke-tests the token):

gbrain connect https://your-host/mcp --token gbrain_xxx --install
gbrain connect https://your-host/mcp --token gbrain_xxx --agent codex --install

Once connected, drive it in natural language — "what do I need to know before my meeting with Alice tomorrow?" or "check whether my search index is ready" — and the agent routes the request to the brain.

Safety boundaries, hardening & integrations

Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.

Declared capability surface (blast radius)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

External MCP tool bridge

Inherits capabilities of connected MCP servers; audit third-party servers before enabling.

What are this agent's strengths and limitations?

Pros
  • gbrain think returns cited synthesized prose with an explicit gap analysis — stale pages, uncited claims, contradictions — rather than a list of chunks to read yourself.
  • Zero-config PGLite by default for personal brains, with a documented switch to Postgres + pgvector for shared or large deployments behind the same BrainEngine contract.
  • Genuine cross-agent memory: one brain reachable from Claude Code, Codex, ChatGPT, Cursor, OpenClaw, Hermes and more over MCP, with OAuth 2.1 scopes and source/operation grants.
  • Keyless start with keyword retrieval; semantic search, reranking, synthesis and enrichment are explicit opt-ins, and embedding/reranking support many providers including local Ollama and llama.cpp.
  • Schema packs are user-authorable: gbrain schema detect, suggest and review-candidates derive page types from your actual filesystem instead of forcing a fixed layout.
Limitations
  • Install friction: Bun 1.4.0+ is mandatory and npm is explicitly forbidden, so teams need to pin the runtime and avoid the shadowing npm package.
  • The full experience is expensive: the README states the OpenClaw/Hermes always-on path needs an 8GB+ RAM server plus raw API token usage well beyond a chat subscription.
  • Retrieval and synthesis are not free once providers are configured — configured embedding, reranking, extraction and synthesis providers receive text and charge for it, and synthesis needs a chat capability.
  • Documented authorization limits: local files and shared database credentials are a separate trust boundary that sources alone cannot isolate, and the tests cover specific access paths rather than a universal no-leak guarantee.
  • Several client integrations have known rough edges: hermes mcp add exits 0 even on failure and needs hermes mcp test, while Grok Build and opencode adds are lazy and need a separate doctor check.

How does this agent compare with similar options?

Key facts side by side with the most closely related agents.

Agent Source review Form / cost Stars Updated Language Full support on
GBrain This agent 53 · Major gaps CLIFreemium ★ 31k 1mo ago TypeScript ChatGPT · Codex · Claude Code · OpenAI API
Athena 48 · Major gaps IDE extensionFree + model costs ★ 652 today Python Claude Code
SwarmVault 75 · Good CLIFree + model costs ★ 739 4mo ago TypeScript Codex · Claude Code
Obsidian Wiki — A Digital Brain You Grow with Your AI Agent 73 · Some gaps Agent plugin / skillFree ★ 3.8k 1d ago Python Codex · Claude Code

How does FollowAgents rate this agent?

FollowAgents source review · FARS-2.1
Major gaps
53/ 100 5-point scale 2.7 / 5
Trust 18/29
Reliability 6/14
Adaptability 10/18
Convention 10/18
Effectiveness 6/13
Verifiability 3/8
Why each dimension lost points
Trust18 / 29 · 3.1/5

Evidence shows a fairly mature permission and confirmation design: owner approval for OAuth authorization-code connections, S256 PKCE, read/write/admin scope gating, plugins barred from declaring tools, namespace-scoped put_page, cwd .env quarantine for protected variables, redacted config get, and documented backup/rollback steps. Deductions: the external-effect surface is large (24/7 crons, automatic ingestion of mail/calendar/contacts, Tailscale funnel public exposure, hosted OAuth relay), and the README states 66 crons run autonomously; safe defaults depend on per-capability opt-in that static review cannot confirm on every path. Dependency security rests on CI claims (OSV-Scanner, Semgrep) with no dependency manifest or known-vulnerability disposition visible in the provided files.

Reliability6 / 14 · 2.1/5

Failure messaging and diagnostics are unusually concrete (doctor, bootstrap verify, exit 78, PROXY_NOT_SUPPORTED, PGLite WAL repair ladder, tracked issues #218/#5034), which is solid. Self-consistency is strained: OpenClaw/Hermes links point to garrytan-owned repos in one place and to openclaw/openclaw and NousResearch/hermes-agent in another; install paths span latest-stable tag, master branch, pinned tag, and attested binary with different trust levels, and the docs admit the tag can be force-moved. Dependency availability is asserted only as Bun 1.4.0+ with CI on 1.4.0/1.4.3; no lockfile or dependency inventory is in evidence.

Adaptability10 / 18 · 2.8/5

Audience and scenario coverage is broad (coding agents, Grok Bot, Muse, OpenClaw/Hermes, standalone CLI, company brain, headless Docker/CI), and capability boundaries are stated (keyless mode, surface tiers, remote callers constrained by source/operation grants, local files and shared DB credentials as a separate trust boundary). Deductions: trigger precision leans on natural-language phrases to agents and paste-in prompts rather than a checkable trigger contract; environment fit lists many platforms but several are explicitly unverified or need user confirmation (Muse native MCP config, Grok Build version, Hermes add exiting 0 on failure).

Convention10 / 18 · 2.8/5

Information architecture is clear (README routing, docs/INSTALL, per-harness guides, llms.txt map), install notes are detailed with troubleshooting, known limitations are candid (Markdown export is not a full backup, sources do not isolate local callers, script-mode bunfig risk), and the MIT license is complete. Deductions: naming stability is weak — an unrelated npm package named gbrain can shadow the binary, and Grok Bot vs Grok Build, Muse vs Muse Code are easy to confuse; versioning/changelog appears only as a latest-stable tag plus migration docs, with no standalone CHANGELOG; maintenance responsibility is uncertain because the publisher is unverified and the docs mix personal-repo and org-repo links.

Effectiveness6 / 13 · 2.3/5

Output usability has concrete examples (meeting-prep answer with citations and an explicit unknown-gap note), so the value to a user is legible. Marginal value is limited: memory, retrieval, and synthesis are not unique among agent-memory offerings, and much of the value depends on paid providers plus an always-on server. Cost-benefit is the weakest point: the README itself calls the OpenClaw/Hermes path the highest-cost option (8GB+ RAM server plus metered API usage) and separates subscription from API billing, leaving ordinary users with high cost uncertainty.

Verifiability3 / 8 · 1.9/5

There are traceable verification entry points (bootstrap verify, doctor --json, models doctor, gh attestation verify, a BrainBench link), but benchmark results live in an external repo and are self-described as whole-system rather than graph-only lift, so they cannot be cross-checked here. Scale figures (155,795 pages, 24,589 people, 66 crons) and performance numbers are self-asserted with no in-repo data. Fact/inference separation is decent in places (explicitly flagged unverified steps, an explicit non-guarantee about leaks) but marketing prose and engineering fact are interleaved, so overall traceability is thin.

Risks and how to mitigate them
  • The README states 24/7 crons, automatic ingestion of mail/calendar/contacts, and overnight enrichment; confirm each opt-in boundary and outbound data scope before enabling.
  • The hosted OAuth relay design has gbrain.io holding user Google tokens for a short window; evaluate that trust assumption before using the fast path.
  • Install paths carry different trust levels: the latest-stable tag can be force-moved and script mode reads a working-directory bunfig.toml; in untrusted checkouts use the attested release binary.
  • An unrelated npm package named gbrain can shadow the real binary; never run npm install -g gbrain.
  • Publisher identity is unverified by the FollowAgents registry and the docs mix personal-repo and org-repo links; verify provenance and maintenance responsibility before production adoption.
  • Cost is uncertain: an always-on server (8GB+ RAM) plus metered API usage is billed separately from any subscription and can substantially exceed expectations over time.
Evidence confidence: Low Reviewed Oct 20, 2026 Reviewed revision 521b9c5d3ba8
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/gbrain.svg)](https://followagents.com/en/agents/gbrain)
<a href="https://followagents.com/en/agents/gbrain"><img src="https://followagents.com/badge/gbrain.svg" alt="FARS review"></a>

FAQ

Can I use it without any API key?
Yes. gbrain init --pglite --no-embedding starts a keyless brain with keyword retrieval and no model API. Semantic search, reranking, synthesis and background enrichment are separate, explicitly opted-in choices.
Does my memory data leave my machine?
It depends on what you enable. Configured cloud embedding, reranking, extraction and synthesis providers can receive text, and the harness model sees recalled memory even in keyless mode. gbrain mcp expose is tailnet-only by default; --funnel is the explicit public option for cloud agents.
How is access controlled when a team shares a brain?
The HTTP MCP server provides OAuth 2.1, read/write/admin/agent scopes, owner-approved authorization and rate limiting, and remote clients are constrained by source and operation grants plus visibility filters. The README also warns that local files and shared database credentials sit outside that boundary and are not isolated by sources.
Is Markdown export a full backup?
No. The README states Markdown export is not a full database backup; DB-only pages, unresolved facts, revision history and operational state need a separate database backup.
How does gbrain.io relate to this repository?
gbrain.io is the hosted version aimed at first-time agent users who do not want to run a server, connecting to ChatGPT, Claude and Cursor. This repository is the self-hosted open-source implementation, with the same brain model running on your own hardware and keys.
Is GBrain free?
GBrain has a free version; the project also offers a paid hosted plan.
Is GBrain open source?
Yes. The source code is on GitHub (garrytan/gbrain) under the MIT licence.
Is GBrain safe to use?
FollowAgents' FARS review (Oct 20, 2026) scored GBrain 18/29 on trust and safety. None of the eight safety controls the review checks for was missing outright.
Is GBrain still maintained?
Development has slowed: the latest commit on GitHub is from 2026-10-20, within the last six months but not the last 30 days.
Who makes GBrain?
GBrain is published on GitHub by the account garrytan. FollowAgents has not verified which person or company is behind that account.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts