GBrain
GBrain is a self-hostable memory layer for AI agents that stores sourced facts, supports corrections, and offers keyword, semantic, graph, and optional cited synthesis retrieval.
Visit garrytan/gbrainOverview
GBrain is an MIT-licensed, self-hostable memory system for existing AI agents. It stores explicit facts with their sources, supports corrections and withdrawal, and makes the same memory available across agents. It combines keyless keyword retrieval with optional semantic search, typed graph traversal, cited synthesis with gap analysis, background enrichment, and configurable schema packs.
Key Features
- Explicit fact memory with sources, corrections, withdrawal, and shared access across agents.
- Keyless keyword retrieval plus optional semantic search, reranking, and cited synthesis with gap analysis.
- Typed knowledge graph with breadth-first relationship walks and auto-linking on trusted local page writes.
- Cron-driven background enrichment that deduplicates people pages, fixes citations, scores salience, and finds contradictions.
- Bundled schema packs plus custom schema detection and authoring for different knowledge layouts.
- MCP connectivity for supported AI clients and CLI operations for search, synthesis, import, and health checks.
Use Cases
- Giving an existing coding or personal agent durable, portable memory with provenance.
- Preparing for meetings by retrieving sourced context and identifying gaps or stale information.
- Operating a shared company brain with source and operation grants plus visibility filters.
- Organizing personal or team knowledge across notes, people, companies, meetings, email, and other sources.
Getting Started
- Install GBrain with bun install -g github:garrytan/gbrain#stable, then run gbrain setup claude-code or gbrain setup codex.
- For CLI-only use, initialize with gbrain init --pglite --no-embedding, import Markdown, search, and verify health with gbrain doctor.
- Connect MCP clients through gbrain setup or publish a local brain with gbrain mcp expose.
Deployment & Requirements
- Bun 1.4.4 or newer is required.
- PGLite is the default for personal brains up to about 50K pages; Postgres with pgvector is for shared, large, or multi-machine brains.
- Always-on ingestion and overnight enrichment need a server with 8GB+ RAM and its own API usage.
- Keyless PGLite setup needs no server or Docker.
Before You Adopt
- License: MIT. Review its terms before using, modifying, or distributing the project.
- GBrain is not distributed through npm; installation should use the documented Bun/GitHub method.
- Optional cloud embedding, reranking, extraction, and synthesis providers may receive text; keyless keyword search avoids a model API.
- For shared company brains, grants and filters constrain remote clients, but authorization tests cover specific access paths rather than a universal no-leak guarantee.
- Always-on ingestion and overnight enrichment need their own server compute and API usage.
- Database-only pages, unresolved facts, history, and operational state require a database backup.