Skip to content

GBrain

Self-hosted memory store for AI agents, with sourced facts, corrections, and shared access across agents.

Stars
31.4k
Forks
4.7k
Licence
MIT
Language
TypeScript
Last update
4 days ago
Type
App

What it is

GBrain is a memory layer for AI agents that you run yourself. It stores explicit facts along with their sources, lets you correct or withdraw them, and makes the same memory available to several agents. It starts with keyword retrieval that needs no API keys, and can add semantic search, synthesized answers, and background enrichment later.

  • Store meeting notes, people, and company pages, then ask the agent for a briefing before a meeting
  • Expose a locally running brain to cloud agents over MCP using the gbrain mcp expose command
  • Share durable preferences and facts across several agents while keeping task state local
  • Query relationships between people and companies through the optional typed knowledge graph

Great for

  • People who already use an AI agent such as OpenClaw, Hermes, Codex, or Claude Code and want it to remember things across sessions
  • Developers comfortable running a Bun-based TypeScript tool and a local database
  • Teams that want a shared, self-hosted knowledge base with explicit access controls
  • Users who want to start without paying for embedding or LLM APIs

Not ideal for

  • Non-technical users who want a simple consumer app; the README points them to the hosted gbrain.io service instead
  • Anyone who needs a guaranteed no-leak access model for shared brains; the README says the authorization tests cover specific paths, not every case
  • People who expect Markdown export to act as a full database backup, which the README says it is not
Step-by-step guide: how to use GBrainInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Bun 1.4.4 or newer

    Install globally from GitHub via Bun

    bun install -g github:garrytan/gbrain

    Or clone and link locally

    git clone https://github.com/garrytan/gbrain
  2. 2

    Run it

    • Install Bun 1.4.4 or newer
    • Install GBrain with bun install -g github:garrytan/gbrain, or clone the repository and run bun install && bun link
    • Follow the guide for your agent setup, such as the Codex / Claude Code tutorial linked in the README
    • Optionally run gbrain mcp expose to make the brain reachable over MCP on your Tailscale tailnet
  3. 3

    Get the most out of it

    • Use gbrain mcp expose with --funnel if cloud agents need access to your brain
    • Read the sharing boundaries and company-brain tutorial before enabling shared access
    • Read the memory boundaries guide to understand what is sent to cloud providers
    • Use the synthesis layer for briefings that include citations and gaps in what the brain knows
    • Enable auto-linking if you want the knowledge graph populated from local page writes without LLM calls

Downloads

Strengths

  • Facts are stored with their sources and can be corrected or withdrawn
  • Works in keyless mode with keyword retrieval before adding paid model services
  • Runs on your own hardware and database, with MIT licensing

Trade-offs

  • Setup involves a Bun runtime, database schema migration, and several optional services, so it is not a one-click install
  • Cloud embedding, reranking, extraction, and synthesis providers can receive your text, and the README notes the harness model sees recalled memory even in keyless mode
  • Access control has documented boundaries: local files and shared database credentials are not isolated by source grants alone

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.