The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Inite Brain listing page.
Open-source bitemporal knowledge graph — long-term memory for AI agents.
Typed facts on a graph, two clocks per fact, hybrid retrieval, conflict-aware ingest,
and a GDPR forget that actually deletes. Over REST and a native MCP endpoint.
Website · Docs · Blog · Quick start · Contributing
Most "memory" for AI agents is a vector store: embed text, return what looks similar. That can't tell you when something was true, can't reconcile two sources that disagree, and can't truly delete a user on request. Brain is a per-tenant knowledge graph built for those jobs — a system of insight, not a system of record.
✳ = extension points for third parties — see Build on Brain.
now, or replay
exactly what the graph knew on any past date. History is replayed, never
rewritten.graph_retrieve and the multi-hop planner walk the graph from entities.COMPETING, not a silent overwrite.data_class: pii), numeric trust
thresholds, and corroboration. Deny-overrides, report-only rollout, per-rule
explain, and a visual policy editor + Key Lens simulator in the admin UI.
See docs/abac.md.GET /v1/facts/:id/provenance shows why the system remembers, and
GET /v1/users/:id/profile assembles a deterministic, prompt-ready profile
from one user's own memory — no silent fact-mining, nothing you can't
inspect or erase.POST /v1/users/:id/forget).@inite/brain-mcp connector.Self-host the whole stack with Docker:
Ingest a fact, then search for it:
Prefer not to run it? The same API is hosted at brain.inite.ai. Full walkthrough: Getting started.
Brain is an MCP server, so any MCP-capable agent gets long-term memory by pointing at the per-tenant URL with a Bearer key — no glue code.
Harnesses with native remote MCP (Hermes, Claude Desktop, Cursor, Goose v2,
n8n, Continue.dev) connect directly. Add brain to the harness's MCP config with
url: https://brain.inite.ai/mcp/<companyId> and an Authorization: Bearer <key>
header. Example for Hermes
(~/.hermes/config.yaml):
stdio-only harnesses that can't attach an auth header (openclaw, Goose 1.x)
spawn the first-party @inite/brain-mcp
connector, which transparently proxies every scoped tool over Streamable HTTP:
Full per-client guide: MCP setup. Installed Domain Packs can extend the tool surface with their own consented, flag-gated tools — see MCP pack tools.
Beyond single facts and 16K mentions, Brain ingests whole normalized documents
through the Source → Indexer → Candidates → Brain pipeline (flagged off by
default — set DOCUMENT_INGEST_ENABLED=1):
The document is stored (content-hash deduped, PII-redacted, chunked), read by
the generalist indexer — plus any Domain Pack that opted into a dedicated
run and matched the relevance router — staged as candidates you can audit at
GET /v1/documents/:id/candidates, and only then committed through the same
conflict-resolution ladder as every other fact. Connectors own raw formats
(PDF, email, chat exports); Brain owns understanding what was read.
What that buys:
indexer: { mode: "dedicated" } in their manifest and are routed per
document (DOCUMENT_MULTI_INDEXER_ENABLED=1).POST /v1/admin/documents/reindex or automatically with
REINDEX_ON_PACK_INSTALL=1. The run ledger skips whatever a pack version
already processed.originKey = doc:<contentHash>;
agreement only counts as independent evidence when it comes from a
different document, not a different reader of the same one.storeContent: false keeps only the content hash and
metadata — extraction still runs, but nothing to re-index or leak later.Brain is a platform, not just a service: third parties extend the ontology, the ingestion plane, and the tool surface without a PR to this repo.
pnpm pack:init scaffolds a valid manifest;
edit → pack:validate → pack:sign (ed25519) → pack:publish →
pack:install. A pack is JSON — no compiled module, no fork.
Domain Packs.REGISTRY_UPSTREAM_URL). Public catalogue at GET /registry/ui.
Registry.domain_pack:<packId> gates the install, and a refused
install is a self-describing 402 with the checkout path. Billing off =
everything installs free. Marketplace.examples/reference-indexer.ts
(pnpm indexer:reference).acceptMcpTools). MCP pack tools.seedDocuments in the manifest are
ingested through the normal document pipeline on install — same chunking,
staging, conflict resolution, and provenance as any connector's document.
Seed documents.The platform surface is machine-described in
docs/openapi.json (OpenAPI 3.1, regenerate with
pnpm openapi:build).
CI floors: recall@1 ≥ 0.6, recall@3 ≥ 0.8, MRR ≥ 0.5, identity-F1 ≥ 0.8,
pii-gating = 1.0, memory-lifecycle = 1.0, faithfulness ≥ 0.8. Bootstrap-CI on
every retrieval metric, with a per-predicate breakdown and per-vertical +
temporal/current split in the report. Numbers from the multi-vertical scenario
suite plus 180 wikidata queries (90 Latin + 90 Cyrillic).
Methodology: docs/eval.md.
NestJS 11 + TypeScript on Node 22 · SurrealDB 3.x (HNSW + BM25, one database
per tenant) · BGE-M3 embeddings (ONNX, runs locally in a worker thread) ·
OpenAI gpt-4o-mini for extraction / synthesize / verifier · optional Cohere
Rerank or a local ONNX cross-encoder · a SurrealDB-native job queue ·
OpenTelemetry. CPU-heavy work (embeddings, cross-encoder, NLI intent routing,
local NER, label propagation, token counting) runs in worker_threads so the
event loop keeps serving HTTP, and PROCESS_ROLE=api|worker splits one image
into an HTTP pod and a jobs pod when a deployment outgrows a single process.
Ships as a Docker image; runs on any host.
The hub with per-persona routing lives at docs/README.md.
| Get going | Getting started · Migration guide |
| Understand it | Architecture · API reference · OpenAPI 3.1 spec (platform surface, generated) · Data model · Bitemporal semantics · Source reputation & trust · ABAC access policies · Document pipeline · Fact provenance API · User profile API |
| Extend it | Domain Packs (registry + marketplace + seed documents) · External indexer protocol · MCP pack tools · Listing playbook · Code memory |
| Run it | Operations · Operator playbook · Deploy runbook |
| Measure it | Eval methodology (strict-judge protocol + measured judge inflation) · Eval harness · LoCoMo benchmark |
A reader-friendly version of the docs lives at brain.inite.ai/en/docs (also in Russian).
PRs are welcome — from typo fixes to new retrieval legs. Good first issues are
tagged good first issue.
Two hard bars for every PR: tests + the eval gate pass (a retrieval
regression past tolerance blocks merge), and schema changes ship as new
numbered migrations in src/db/migrations/. Details in
CONTRIBUTING.md. Please also read the
CODE_OF_CONDUCT.md. Found a vulnerability? Don't open a
public issue — see SECURITY.md.
Shipped: bitemporal graph, hybrid retrieval pipeline, conflict resolution, domain-scoped source reputation + cross-source corroboration + a read-only trust-inputs API, identity merge, GDPR forget, native MCP, per-key ABAC policy sets, the document pipeline with an external-indexer protocol (pull work API + signed webhook hints + reference client), Domain Packs (industry library, signed global registry with verified badges, download counters and pull-only mirroring, marketplace with paid packs, pack-declared MCP tools, seed documents), OpenAPI 3.1 platform spec, worker-thread offloads
PROCESS_ROLE api/worker split, code memory (record why a decision was
made, drift-resistant symbol anchors), eval-gated CI, off-hours
self-improvement (dreams), the raw episode substrate with versioned derived
worlds (atomic per-run staged rebuilds, lease-fenced promotion, read pins),
end-to-end per-user memory scope (episode ingest → derivation → retrieval →
profile → ownership-fenced retraction), fact-provenance + rolling
user-profile read APIs, measured genre presets over the retrieval profile,
and long-horizon conversational memory benchmarks run under a strict judge
(LoCoMo, LongMemEval, BEAM — protocol in
docs/eval-protocol.md).Exploring (issues + ideas welcome): a non-conversational (document / KG) eval axis on the same harness, failure-memory for agents (distill what went wrong into reusable strategies), prospective-memory / preference-drift benchmarks, extractor span-grounding offload, and worker-pool right-sizing as more handlers move to threads. Temporal was evaluated and deliberately not adopted — the re-evaluation triggers live in docs/roadmap/platform-gap-2026-07.md. Have a use case? Open an issue.
AGPL-3.0-or-later. Brain is a hosted backend service, so AGPL is the honest choice: if you run Brain (modified or not) for users over a network, you make the corresponding source available to them under the same terms. If AGPL is incompatible with your downstream needs, open an issue — we may relicense specific modules when the request is reasonable.