Guides
Task-shaped walkthroughs — adding memories, recall, building context, streaming, idempotency, multi-tenant, error handling, and more.
Core paths
Adding memories
Encode text with encode (POST /v1/memories), read the structured outcome, and control content dedup and event time.
Recall
The one read verb: a membership verdict — Single, Many, or None — over the caller's memory pool.
Building context
Assemble recall output into a prompt block yourself — Brain has no build-context verb.
Streaming
The wire client's *Frames methods drain a response frame-by-frame; HTTP has none.
Production patterns
Was this page helpful?
Architecture
Brain is one Rust binary with a strict one-way crate graph — an mmap arena, a WAL, redb, HNSW, tantivy, and bundled models, sharded thread-per-core. No external database.
Adding memories
Store text with encode (POST /v1/memories), read the structured outcome, and control content dedup, event time, and idempotent retries.