About this project

GBrain is a memory system for AI agents, built by Garry Tan and used in his own OpenClaw and Hermes deployments. It stores explicit facts together with their sources, supports corrections and withdrawal of memories, and makes the same memory available across multiple agents. The project emphasizes that the user owns the brain: it runs on your hardware, your database, and your keys. Core capabilities described in the README: - Keyless start: keyword retrieval and agent-written memory work with zero API keys. Optional keys upgrade to semantic search (OpenAI or Voyage) and automatic fact extraction (OpenAI or Anthropic). - Synthesis layer: returns cited prose answers across people, companies, deals and ideas, plus an explicit note about what the brain does not yet know (gap analysis), rather than a list of matching chunks. - Self-wiring knowledge graph: each page write extracts entity references and creates typed edges such as attended, works_at, invested_in, founded and advises, without LLM calls. The README reports benchmark figures (P@5 49.1%, R@5 97.9% on a 240-page corpus) and says scorecards live in a sibling gbrain-evals repository. - Multi-tenant company brain: each team member gets a scoped slice of the brain by login, so queries only return what the user is allowed to see. The README states fuzz testing across search, list, lookup and multi-source reads produced zero leaks. - Background daemon: 24/7 ingestion, enrichment and an overnight consolidation cycle, described as running 66 cron jobs autonomously in the author's deployment. Installation and integration: - Requires Bun 1.3.11 or newer. The README warns that GBrain is not distributed on npm and that an unrelated npm package named gbrain exists; install via `bun install -g github:garrytan/gbrain` or clone plus `bun install && bun link`. - Multiple setup paths: adding memory to an existing agent (Grok Bot, Muse, Codex, Claude Code), connecting an existing hosted brain, or a full server-hosted deployment on OpenClaw or Hermes with one-click templates. - A local brain can be created in about two seconds with `gbrain init --pglite` (no Docker, no server), then connected to Claude Code or Codex via MCP. A `--surface verbs` mode exposes seven memory verbs: recall, remember, entity, synthesize, forget, context_pack and delta. - Remote brains can be connected with `gbrain connect <url> --token ...`, and `gbrain agent register` mints scoped OAuth clients and tokens for onboarding agent harnesses. - MCP integration guides exist for Claude Code, Codex, Cursor/Windsurf, Hermes, Grok Bot, Grok Build, opencode, OpenClaw, Claude Desktop/Cowork and Perplexity Computer. - Optional personal-agent bootstrap turns Codex or Claude Code into a persistent agent with identity files (SOUL.md, USER.md, MEMORY.md), a private GitHub repository, and a local PGLite brain. A `cold-start` skill imports Gmail, calendar and contacts via a native connector, ClawVisor, or offline archives such as Google Takeout. Operational notes: the README states that a Git clone alone is not a complete backup because the database also holds facts, corrections, jobs and accounting, and points to a full backup and restoration guide. It also notes that memories saved by agents default to brain-wide visibility unless marked private, and that upgrading an existing brain may require rebuilding search chunks.