Engrava: A Deterministic Memory Library for AI Agents Built on SQLite
Engrava is an MIT-licensed Python library storing agent memory as a typed graph in SQLite, with deterministic consolidation instead of LLM rewrites.
Engrava tackles a common failure mode in long-running AI agents: memory that either blurs into a vector average or requires standing up a separate graph database. The library stores a typed knowledge graph in a single SQLite file, combining vector similarity, keyword matching, recency and priority in retrieval instead of relying on cosine distance alone.
Its most distinctive piece is 'dreaming', a deterministic consolidation cycle that scores each stored thought on recency, staleness, confirmation, confidence and frequency, then promotes only what clears configurable YAML gates. No LLM or embedding calls run during this pass, so the same inputs always produce the same outputs — a design traced to sleep-consolidation research on selective memory stabilization.
Notably, the team behind Engrava reports that turning consolidation on or off barely changes accuracy on their own retrieval benchmark, and they treat this as a limitation of short-horizon QA benchmarks rather than evidence the mechanism doesn't matter. For engineers, the practical draw is SQLite-like packaging: pip install, one file on disk, MIT license, no server or auth layer to manage — a fit for single-agent systems rather than distributed fleets.