← Back to directory
G

GBrain

Community
An open-source brain layer for your AI agents, with synthesis, graph traversal, and gap analysis.
Category
Other #30 of 230
Stars
★ 31.0k Very popular
Transport
stdio (local process) · Streamable HTTP
Runtime
Bun · Hosted (no local runtime)
Credentials
Optional API key
License
MIT
Last commit
Tools
10
66FMRS · C

GBrain is a feature-rich knowledge graph and RAG engine offering unique synthesis and gap analysis capabilities. It suits individuals and teams looking to enhance their AI agents' memory, but requires a technical background for deployment and configuration. Security-wise, local storage and multi-user isolation are well-designed, but care must be taken with API keys and tokens. During installation, ensure you get it from GitHub to avoid npm confusion. Overall, for those needing a true 'brain' rather than just search, this is a powerful choice.

Strongest · Documentation 16/20 Weakest · Reliability 8/20

Reliability
8/20
Security and permissions
13/20
Maintenance
16/20
Documentation
16/20
Setup experience
13/20
Why each score
Reliability 8/20
The README describes a plausible start path (bun install, gbrain init --pglite, gbrain serve, MCP handshake with 30+ tools) and even documents numerous bug fixes and workarounds, which suggests the project is real and runnable. However, this static review had access only to the README and repository metadata; no actual CI workflow files, committed tests, or executable examples were provided. Per the static calibration rule, reliability cannot exceed 12 without verifiable execution evidence, and missing evidence is deducted. The many troubleshooting entries also imply edge cases that are not demonstrably covered by tests. Score: 8.
Security and permissions 13/20
No red-line issues are evident: no malware, credential theft, covert exfiltration, or destructive defaults without confirmation; the only token shown is the placeholder gbrain_xxx, not a real secret. The README describes a thoughtful security posture: OAuth 2.1 with PKCE for HTTP, scope-gated access (read/write/admin), rate limiting, DCR-style registration, a credential gateway, and a SECURITY.md threat model. However, these are claims in the README; the actual source code could not be inspected. Also, no explicit confirmation flow for dangerous write/admin operations is documented, and multi-user data-boundary claims (fuzz-tested zero leaks) are unverified. Score: 13.
Maintenance 16/20
The repository is not archived, has an MIT license, a CONTRIBUTING guide, a SECURITY.md, and a detailed CHANGELOG referencing many recent versions (e.g., v0.41.37.0). The README describes a PR-wave workflow and contributor attribution, indicating organized maintenance. 300 open issues is high but consistent with an active project; no release cadence or commit data is available in the supplied material. Score: 16.
Documentation 16/20
The README is unusually comprehensive: quick start, agent-based install, CLI and MCP setup for many clients (Claude Code, Codex, Cursor, ChatGPT, Perplexity, Cowork), architecture, integrations, cost hints, and a troubleshooting section with concrete fixes and version references. Limitations are disclosed (macOS 26 PGLite incompatibility, npm shadowing warning, PGLite single-writer). The main deduction is that linked docs (INSTALL.md, docs/mcp/*, SECURITY.md, etc.) were not supplied for verification, and some claims (e.g., benchmark numbers) are unverifiable from this material. Score: 16.
Setup experience 13/20
Setup is documented in clear steps: install via bun install -g github:garrytan/gbrain, initialize a local brain, run gbrain serve, then connect with one-command examples for mainstream clients. Platform caveats are given (macOS 26/Tahoe PGLite issue, Windows DNS workaround). However, setup requires bun, API keys for embeddings, and possibly a remote host; several manual choices (embedding provider, schema pack) add friction. Per static calibration, setup cannot exceed 15 without verifiable CI/tests in the supplied files, and none were provided. Score: 13.

Static review · not runListed 2026-08-07

Read the FMRS scoring method →

Fit and risk

What it can accessWrites / deletes local filesRuns commands or codeUses the networkConnects to a database

Best for

  • Personal knowledge management that requires actual answers beyond search (synthesis + gap analysis)
  • Teams wanting to build shared institutional memory (with OAuth scoping)
  • AI agents needing persistent memory (automatic ingestion, enrichment, consolidation)

Not for

  • Scenarios requiring real-time data streams (depends on scheduled syncs and crawling)
  • Users without API keys or willing to configure an embedding provider (requires at least one)
  • Users wanting a fully managed cloud service (requires self-hosting)

Required permissions

  • Read/write access to local filesystem (for brain repo and imports)
  • Network access to external APIs (unlocks embedding providers, LLMs, ingestion webhooks)
  • Environment variable access for API keys (e.g., OPENAI_API_KEY, etc.)
  • Local database (PGLite or Postgres)

Risks and side effects

  • Package confusion: the 'gbrain' package on npm is unrelated and may cause conflicts; install only from GitHub
  • Data privacy: local data is secure, but remote deployments must secure OAuth tokens and API keys
  • LLM costs: 'think' and synthesis features consume LLM API calls, incurring expenses
  • Performance issues: large brain syncs may take time or stall (troubleshooting provided)

Setup

Before you start

Runtime:Bun · Hosted (no local runtime)

GBRAIN_REMOTE_TOKEN optionalsecret Bearer token for connecting to a remote gbrain serve --http server; Codex reads it at runtime so it stays out of config. Issued by the server admin dashboard.
OPENAI_API_KEY optionalsecret OpenAI API key used as the default embedding provider; get it from the OpenAI platform.
ZEROENTROPY_API_KEY optionalsecret ZeroEntropy API key, the default embedding + reranker provider; get it at zeroentropy.dev.
VOYAGE_API_KEY optionalsecret Voyage AI API key, an optional embedding provider; get it from the Voyage AI platform.
Other optional settings (7)
GBRAIN_FTS_LANGUAGE optional Sets the Postgres full-text-search tokenizer language, defaults to english (e.g. portuguese, spanish).
GBRAIN_BULK_MAX_RETRIES optional Max retries for bulk batch writes on Supavisor pooler blips; default 3, 0 disables retries.
GBRAIN_BULK_RETRY_BASE_MS optional Base backoff in ms for bulk-write retries; default 1000.
GBRAIN_BULK_RETRY_MAX_MS optional Max backoff in ms for bulk-write retries; default 10000, must be >= base.
GBRAIN_SYNC_TRACE optional Set to 1 so gbrain sync prints per-file begin-import lines to locate a hanging file.
GBRAIN_MAX_REGEX_INPUT_CHARS optional Caps input length for schema-pack inference regexes to mitigate ReDoS.
GBRAIN_CONTRIBUTOR_MODE optional Set to 1 to enable contributor features like gbrain eval export/replay.

Installation steps: 1. Install the Bun runtime. 2. Run bun install -g github:garrytan/gbrain (note: the gbrain package on npm is unrelated, do not use it). 3. Initialize a local brain: gbrain init --pglite. 4. Verify installation: gbrain doctor. 5. Connect the MCP server to your client: e.g., for Claude Code use claude mcp add gbrain -- gbrain serve; or for remote use gbrain connect https://your-host/mcp --token gbrain_xxx --install.

Check that it works

Run gbrain init --pglite then claude mcp add gbrain -- gbrain serve, restart Claude Code, and confirm the gbrain tools (search, think, put_page, etc.) appear in the client's tool list; gbrain doctor should also pass its health checks.

Troubleshooting

  1. `gbrain init --pglite` crashes on macOS 26.x: use native Homebrew PostgreSQL + pgvector
  2. `gbrain import` fails with dimension mismatch: run `gbrain doctor` and follow the repair command
  3. Cron sync timeouts: use `--break-lock --all --max-age` and per-source loops
  4. Dream cycle losing links: upgrade to v0.41.19.0+ and use retry environment variables
  5. PGLite single-writer conflicts: stop `gbrain serve` before large syncs

Things to try

Once connected, you can ask your AI assistant things like:

  • Search my brain for everything about Acme, then think: who works at Acme AI?
  • Capture this thought to my brain: discussed pricing with Bob today.
  • Use graph-query to find what Bob invested in this quarter.
  • Import my ~/notes directory into the brain and run a sync.

Tools 10

search read-only
Hybrid retrieval, returns raw list of pages ranked by score.
think read-only
Synthesizes retrieval results into a cited answer with gap analysis.
put_page writes
Writes a page and automatically extracts entity relationships (zero LLM calls).
graph-query read-only
Performs multi-hop knowledge graph traversal.
schema_apply_mutations writes
Batch-apply schema mutations (admin scope, remote accessible).
capture writes
Captures a thought or file contents as a page.
agent writes
Runs sub-agents through the Minions queue to execute think operations.
sync writes
Syncs data sources (e.g., import, sync).
Show 2 more tools
import writes
Imports files or directories into the brain.
query read-only
Performs retrieval or synthesis queries (alias).

Use cases

Getting a synthesized brief before a meeting (e.g., 'What do I need to know before my meeting with Alice?')
Querying relationships in the knowledge graph (e.g., 'Who works at Acme AI?')
Serving as a team's shared institutional memory with per-user scoping (company brain)
Providing long-term memory for coding agents to avoid amnesia about non-code context

Supported clients

Claude Desktop
Claude Code
Codex
Cursor
Windsurf
Perplexity
ChatGPT
Claude Cowork

Listed from the project's documentation, not tested by this site.

Overview

GBrain is an open-source knowledge graph and retrieval-augmented generation (RAG) engine built by Garry Tan, President of Y Combinator, to power his own AI agents. It offers hybrid search (vector + keyword + reranker), a self-wiring knowledge graph, and a synthesis layer (think) that returns cited answers with gap analysis. It supports both personal use and team-wide 'company brain' with multi-user isolation via OAuth scopes. It can be used via CLI, MCP (stdio/HTTP), or integrated into clients like Claude Code, Codex, Cursor, etc. It uses PGLite (zero-config) or Postgres + pgvector as backend.

Similar servers

BioMCP 75 · B

One binary. One grammar. Evidence from the biomedical sources you already trust.

★ 659 · Tools 11 Compare with this →

Source revision 3326d8d78c04 Data synced 2026-10-19 Read the FMRS scoring method