← Back to Leaderboard
Ggarrytan

garrytan/gbrain

Markdown-backed agent memory with Postgres hybrid search and cited retrieval

View on GitHub ↗
Engineering Health (Methodology)
A+ · 100/100
Maintenance Activity
● Updated today
Latest Release
v0.60.794.0
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance35/35
Fork Adoption25/25
Release Cadence20/20
License Clarity20/20
DockerSelf-HostedLocal AIMCPCLIAPI
Total Stars
★ 33,857
24h Growth
+11
7d Growth
+208
Forks
5,074

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

garrytan/gbrain Star History (2026-04-06 - 2026-12-04) ALL-TIME STAR HISTORY (2026-04 – 2026-12) +33.9k in 242d · avg +140/day 35.8k 17.9k 0 2026-04-06: ★ 12026-04-25: ★ 11,0932026-05-16: ★ 15,8422026-06-06: ★ 20,8662026-06-27: ★ 23,8562026-07-18: ★ 26,1152026-08-08: ★ 27,6232026-08-29: ★ 28,9622026-09-19: ★ 29,8642026-10-10: ★ 30,5562026-10-31: ★ 31,3022026-11-15: ★ 33,0702026-12-04: ★ 33,857 ★ 33.9k 2026-04 2026-08 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

GBrain separates the knowledge source from the retrieval index. Its TypeScript/Bun runtime parses Markdown, frontmatter and wikilinks into searchable pages and typed relationships. Local brains use @electric-sql/pglite; shared deployments can use PostgreSQL with pgvector. Git-backed writes commit back to disk, making file-backed content both diffable and suitable for rebuilding the index. Database-only pages fall outside that recovery path and need a database backup.

The gbrain CLI and MCP clients use the same retrieval engine. The manifest includes @modelcontextprotocol/sdk, Express and AI SDK adapters for Anthropic, Google, OpenAI and OpenAI-compatible endpoints. Local clients can use stdio; remote HTTP MCP enforces per-member permissions. gbrain serve --surface starter --advertise verbs is a concrete stdio entrypoint for clients that need a smaller tool surface.

Key Capabilities & Differentiators

Without credentials, GBrain can import Markdown and query it using keyword search and typed graph traversal without making model calls. For example, a company field in frontmatter can link a person to an organization and give the agent related pages to cite. Adding an embedding key enables keyword-plus-vector retrieval. For standalone CLI synthesis, gbrain think can use Anthropic or OpenAI credentials; an MCP-connected agent uses its own model.

In the published gbrain-evals results at commit 898e0ebf, personal-notes Q&A went from 13.3% without retrieval to 86.7% with GBrain across 98 tasks. On the 500-question LongMemEval dev set, GBrain scored 93.6% versus 89.0% for plain PostgreSQL hybrid retrieval and 94.2% for full-context input, with measured answer-reader costs of $0.023 versus $0.172 for full context. The role-scoped test put restricted documents into neither context nor answers in 100 runs; that is evidence for the tested setup, not a general security guarantee.

Trade-offs & Limitations

Compared with Markdown plus grep, GBrain adds linked evidence, citations and permissioned remote access at the cost of a separate index and service configuration. Compared with plain PostgreSQL hybrid RAG or a standalone vector database, it brings the source files, typed relationships and trust labels into one retrieval workflow. That complexity does not consistently improve accuracy: GBrain scored 55.2% versus 67.4% for an agent with grep on BEAM-10M, and 80.0% versus 84.2% for full-context input on LoCoMo.

The MIT license allows self-hosting without a software subscription, but operators own backups, access boundaries and provider configuration. Telemetry is off by default. Keyless GBrain retrieval avoids model calls, but that does not make the connected agent local: its own model may still receive retrieved material. Enabling provider-backed embeddings or chat can also send indexed text, including archived sessions, to the configured provider. Check both data paths before importing sensitive material.

Hardware & Deployment Guide

The documented self-host path is macOS or Linux with Bun 1.4.4 or later. Install from github:garrytan/gbrain#stable, not the unrelated npm package, or use the release binary for macOS Apple Silicon or Linux x86-64 glibc. gbrain init --pglite --no-embedding creates a keyless local brain, and gbrain import <path-to-markdown-folder> --no-embed keeps the initial import embedding-free. The visible Compose files, docker-compose.ci.yml and docker-compose.test.yml, are for CI and testing; don't assume they are production deployment manifests.

PGLite is single-writer. For concurrent clients, move to PostgreSQL or centralize access through one shared HTTP server. Remote self-host access can use HTTPS over Tailscale; the paid gbrain.io option uses HTTPS MCP with OAuth. Start by sizing disk for Markdown and the database index, then measure import and query load at your expected concurrency. Release v0.60.798.0 added preview-first identity backfill and owner fact relinking without re-extraction, and improved handling of Git imports and embedding backfills.

Storage: Rebuild the index from on-disk Markdown; back up database-only pages separately.
Retrieval: Keyword and typed-graph search work keyless; an embedding key adds vector ranking.
Integration: Local stdio MCP and CLI access, with per-member permissions on remote HTTP MCP.
Provenance: Cited cross-page retrieval distinguishes linked evidence, gaps in the record and source trust.
Privacy: Telemetry is off by default; providers can receive indexed text, including session archives, when model-backed features are enabled.
Evaluation: LongMemEval reached 93.6% versus 89.0% for plain PostgreSQL hybrid search, but GBrain lost to grep on BEAM-10M.
Best For

Individuals or small teams that keep knowledge in Markdown and want several agents to retrieve the same cited decisions, with local-first storage or permissioned remote access.

Skip If

Your notes fit comfortably in one prompt, your main task is grepping huge chat logs, or you only need a vector index without document relationships or agent integration.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerSelf-HostedLocal AIMCP
bun install -g github:garrytan/gbrain#stable
gbrain --version
gbrain setup claude-code   # initializes ~/.gbrain (PGLite), wires MCP, and adds agent hooks (reversible)

Comparison vs. Top RAG, Data & Memory Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
gbrain ★33.9k+208TypeScriptMITMarkdown-backed agent memory with Postgres hybrid search and cited retrieval
firecrawl216.5k+4.6kTypeScriptAGPL-3.0Local and hosted web ingestion that turns sites into RAG-ready Markdown
claude-mem121.7k+1.4kTypeScriptApache-2.0Hook-driven memory and hybrid search for coding agents that need cross-session r
markitdown199.7k+909PythonMITPython library and CLI that turn mixed-format documents into Markdown for RAG in

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/garrytan/gbrain.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

garrytan/gbrain Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about gbrain

How do I share one memory store between Claude Code and Codex?

Import Markdown into a PGLite or PostgreSQL brain and point both clients at that same brain over MCP. Local clients can use stdio; for concurrent clients, use PostgreSQL or route access through one shared HTTP server rather than opening the same PGLite database from independent writers. Verify the setup by saving a note in one client and retrieving it with its source in a new session in the other.

Does a local deployment need a GPU, and what should I size for?

Keyless keyword and graph retrieval makes no model calls and does not require a GPU. Size the local deployment for the corpus, the index and the expected query load. Provider-backed embeddings and CLI synthesis add network calls and separate provider costs. There are no verified RAM, VRAM or throughput targets to size against, so measure import time and concurrent query performance on your own corpus.

Can a company self-host GBrain, and what needs a compliance review?

The MIT license permits commercial self-hosting, subject to its notice requirements; it does not settle data-handling obligations. Telemetry is off by default, but enabling provider-backed features can send indexed content, including archived sessions, to the configured provider. Review what gets archived, which sources are exposed to each member over HTTP MCP, and how database-only pages are backed up.

When is GBrain a better choice than grep or plain PostgreSQL hybrid search?

Use grep for exact text lookups in one user's files, or pass the full context when it fits comfortably in the prompt. Plain PostgreSQL hybrid search is a simpler fit if ranked passages are all you need. GBrain earns its extra setup when you also need typed links, citations, trust labels or remote access controls across agents. Test your own workloads: it trailed grep on BEAM-10M and full-context input on LoCoMo.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining garrytan/gbrain? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature garrytan/gbrain on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare