# Brain

A Rust memory database for AI agents that stores typed memories, entities, statements and relations with provenance and bi-temporal validity, and answers queries by fusing semantic, lexical, graph and temporal retrieval.

Brain is a single Rust engine, with one wire protocol and one schema, that replaces the usual stack of a vector database, a graph database, a full-text store and an orchestration layer used to keep them consistent. It exposes cognitive-verb operations, encode, recall, plan, reason and forget, instead of plain CRUD, and combines three retrievers, semantic, lexical and graph, through weighted reciprocal rank fusion rather than plain top-k cosine search.

It stores four record types: raw memory entries with embeddings and salience, canonical entity records with stable identity and aliases, typed statement claims such as facts, preferences or events with confidence and bi-temporal validity, and relation records linking entities. Every typed claim carries an evidence list back to its source memories. The engine is built for predictable tail latency using a thread-per-core design with io_uring, single-writer-per-shard access and a group-commit write-ahead log, and is Apache-2.0 licensed.

Website: https://github.com/arc-labs-ai/brain-db
