Memory for AI agents
An agent remembers nothing between turns — everything it "knows" is whatever you rebuilt into the prompt. Brain is where what it learns actually lives: typed memories carrying provenance and time, so when two things you were told disagree, the system records which replaced which instead of silently keeping both.
- Verbs
encode·recall·forget- Runtime
- One Rust binary — no Postgres, no pgvector
- Licence
- Apache-2.0
Start where you are
Start hereLearnHow agent memory actually works — why a bigger context window doesn't fix forgetting, why RAG isn't memory, and what happens when two facts collide. Each page has something you can run in the playground, with no account.10 pagesYou have an agentBuildTask recipes for a loop you have already written: wiring in recall, handling corrections, combining with RAG, isolating tenants, and erasing a subject on request.15 pagesSelf-hostRunOperating Brain yourself — the two processes, the platform it needs, the three things it refuses to start without, and what to watch once it is up.7 pages
The shape of the API
Three verbs carry the common path. Everything else — extraction into the typed graph, embedding, indexing, ranking — happens inside the database.
// store what happened
await brain.encode({ text: "Priya manages the billing platform team" });
// answer a cue — Single, Many, or an explicit None
const answer = await brain.recall({ query: "who leads billing?" });recall never returns a fabricated hit. Same vocabulary in TypeScript, Python and Rust, or over plain HTTP.
Reference
ConceptsTyped memory, the two pipelines, identity, the graphREST APIBase URLs, auth, errors, pagination, every endpointTypeScript SDKHTTP + native wire clientsPython SDKHTTP + native wire clientsRust SDKHTTP + native wire clientsRecipesCopy-runnable, under a screen eachIntegrationsMCP, LangChain, OpenAI AssistantsSwitching to BrainHow the shapes and verbs line up