Long-term memory for AI agents that runs on your own machine, remembers where every fact came from, and keeps every user's memories apart.
Severian gives an agent a memory it can trust. It saves what was said exactly as it was said, derives short searchable memories from it, and hands the answering model a compact, cited context block for each question. It runs on SQLite out of the box (PostgreSQL + pgvector when you need it), works fully offline, and plugs into Hermes Agent, any MCP client, a CLI, an HTTP API or plain Python.
Severian on the OmniMemEval
long-term-memory leaderboard (October 2026). Every other row is OmniMemEval's own published record, copied verbatim;
Severian's row (β ) is our run through the same public harness, answer model (gpt-4.1-mini), judge (gpt-4o-mini),
prompts and metrics, not an official board entry. π₯ marks the best score in each column; - means not run.
| Backend | LoCoMo | LongMemEval | BEAM 100K | BEAM 10M | PersonaMem v2 | HaluMem |
|---|---|---|---|---|---|---|
| Mem0 | 77.68 | 56.00 | 70.41 | 43.33 | 36.76 | 73.64 |
| Zep / Graphiti | 63.83 | 79.80 | 68.70 | 56.11 | 32.34 | 81.71 |
| Supermemory | 73.53 | 66.07 | 65.98 | 52.49 | 39.64 | 52.61 |
| Viking | 69.33 | 61.07 | 70.76 | 58.14 | 30.80 | 77.39 |
| Cognee | 83.48 | 51.80 | 59.30 | 56.02 | 26.46 | 72.60 |
| Letta | 77.12 | 77.67 | 69.22 | 52.30 | 35.12 | 85.43 |
| Hindsight | 81.99 | 72.20 | 70.22 | π₯ 59.75 | 37.98 | 83.99 |
| Memori | 41.34 | 20.80 | - | - | 33.16 | 49.38 |
| EverOS | 82.75 | 80.40 | 58.64 | 47.73 | 35.94 | π₯ 88.66 |
| MemMachine | 73.90 | 63.60 | 64.80 | 51.90 | 34.14 | 47.02 |
| mem9 | 73.64 | 78.00 | 65.75 | 57.30 | 30.76 | 72.80 |
| MemoryLake | 72.49 | - | - | - | - | - |
| Backboard.io | 22.40 | - | - | - | - | - |
| MemOS | π₯ 88.83 | 89.20 | 66.87 | 56.75 | π₯ 40.58 | 80.91 |
| LCM-X | 78.83 | 87.00 | π₯ 71.84 | - | 33.96 | 81.68 |
| Severian 0.3.11 β | 87.34 | π₯ 90.60 | 71.62 | - | - | - |
Configuration for the Severian row above and every Severian number below: 0.3.11, commit 4467853, board depth (top-20, no
character cap), answer gpt-4.1-mini, judge gpt-4o-mini-2024-07-18. The Hermes-default comparison uses
top-10 with an 8,000-character cap; the 16,000-character side test is labelled where it appears. 0.3.12 and
0.3.13 are byte-identical with their switches off, so the results stay labelled 0.3.11. Every later release
(0.4.0 to 0.6.3) was checked to return byte-identical search results and context on 50 fixed benchmark queries with
its new switches off.
- 1st on LongMemEval, 2nd on LoCoMo, 2nd on BEAM 100K (0.22 behind LCM-X). The board has no error ranges, and on 400 questions a gap that small is noise; Severian has not been run on BEAM 10M, PersonaMem v2 or HaluMem yet.
- We checked the board before building on it. Re-running LCM-X through the same pipeline gave its published scores back within 0.65 points. Compared question by question, Severian is ahead of it on LoCoMo (+7.9, 95% range +6.0 to +9.7) and LongMemEval (+4.0, +1.2 to +6.6) and level on BEAM, and a stricter second marker (Claude Opus) agrees.
- Trade-offs, stated plainly. Severian hands the answering model more text than most systems and makes model calls when it saves memories. Hermes ships it at top-10 with an 8,000-character cap, which costs little on LoCoMo but about 8 points on BEAM and LongMemEval; raising that to 16,000 characters with the pre-registered 0.3.12 candidate fill + compact switches wins back about 5 points on each (settings).
- We found a marking flaw in BEAM that rewards made-up answers to "the chat never said" questions. It inflates every system's BEAM score, ours included (details).
- Zero leaks, zero stale facts. On Severian's own adversarial quality gate (0.3.11, default configuration), a corrected fact never comes back in search (0.000 stale-fact rate) and no query ever returns another scope's memory (0.000 leakage).
Per-benchmark tables for every system (LoCoMo, LongMemEval, BEAM, PersonaMem v2, HaluMem), the LCM-X validation, the plan and its changes, and the limitations are in docs/benchmarks/omnimemeval-2026-10.md. Our earlier internal round against Mem0, Mnemosyne, Hindsight and Honcho (different harness and marker) is in docs/benchmarks/competitor-round-2026-10.md.
- Kept unless an operator purges it, and every claim carries its source. Raw observations are append-only and hashed. Every memory and every search hit cites the observation it came from, and corrections create a new revision instead of overwriting history, so any earlier version can be restored. Erasure hides records; an explicit purge removes text from the store and its indexes, subject to the backup and PostgreSQL caveats in docs/threat-model.md. Derived text is model-generated, so provenance shows where a claim came from; it does not make the claim true.
- Scope is the security boundary. Every read and write names five levels: tenant, profile, collection, agent and session. There is no default scope, and another scope's memories are never returned or even hinted at. Agents can opt in to reading an explicit list of teammates' scopes.
- Built for real conversations. Short facts per turn, real dates for relative times, newer facts that close older ones, and a note when two memories disagree, so the agent answers with the current truth.
- Hybrid search that holds up. BM25 and vector search fused with reciprocal rank fusion, an optional cross-encoder re-ranker, an entity graph for multi-hop lookups, and a context assembler that keeps the most useful items inside a character budget.
- Message-level units, opt-in.
SEVERIAN_MESSAGE_UNITS=1indexes the user and assistant lines separately, keeps their conversation order for same-date updates, and backfills existing stores with a dry-run-first migration. It is off by default; with it off search and context are byte-identical. - Local-first. No network call from the engine; cloud derivation needs an explicit per-collection opt-in. Qwen3 0.6B embeddings run locally or in a shared sidecar; a deterministic hash embedding needs nothing at all.
- Offline maintenance ("dreaming"), opt-in. With
SEVERIAN_DREAMING=1,severian dream --mode <m>merges duplicate memories, scores and reviews them, applies a retention policy or reports contradictions. It is a dry run unless you add--confirm, every write is audited, repeat runs converge, and erased or purged content never comes back. Code decides what is a duplicate, a restatement or a contradiction before any model is involved. Run it from your own scheduler or switch on the worker tick; nothing runs unless you ask. Salience weighting in ranking is opt-in and off by default. - Operable. Crash-safe leased worker jobs, dead-letter recovery, export/import, side-by-side vector rebuilds, an integrity audit, per-profile fact rollback and an optional Rust acceleration module.
- Harness-agnostic. The same engine serves any agent framework through the CLI, the Python SDK, the HTTP API or MCP, and runs unchanged on SQLite or PostgreSQL; the Hermes plugin is one adapter on top.
These are decisions, not omissions:
trust_stateis computed at read time. Severian does not store candidate/verified/rejected tiers. The truth answer depends on the active view plus the requestedas_oftime, so persisting a separate state would create a second truth to keep in sync.- There is no human-review queue. Approval-gated governance already exists outside the memory store; a per-memory review workflow was not built because there is no demonstrated need (W-9, decision N7).
- Tombstones are the erasure mechanism, not a separate feature. Erasure writes an auditable tombstone; explicit operator purge is the physical-removal path. Both are documented in docs/memory-engine.md and docs/operator-runbook.md.
ββββββββββββββββββββββββββββββββββββββββββββ
β SOURCE INPUT β
β text observation Β· attachments (multi- β
β modal metadata: image/audio/video/file) β
ββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββ
β IngestionService β
β normalise Β· hash raw Β· source identity β
ββββββββββββββββββββ¬ββββββββββββββββββββββββ
β
βββββββββββββββββββββββββββΌββββββββββββββββββββββββββ
βΌ βΌ βΌ
βββββββββββββββββββββββββ βββββββββββββββββββββββββ βββββββββββββββββββββββββ
β CANONICAL STORE β β derive job queue β β Entity/Relation β
β (SQLite | PostgreSQL)ββββΆβ (leased, crash-safe, ββββΆβ Graph (auto-populated β
β observations β β idempotent) β β by EntityExtraction) β
β memories β βββββββββββββββββββββββββ βββββββββββββββββββββββββ
β entities/relations β
β jobs Β· audit events β append-only Β· scoped Β· hashed Β· supersede-aware
βββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DerivationService (worker drains derive/episode jobs) β
β Β· dream modes exist but no production path queues them yet β
β Β· policy-gated (cloud_allowed false by default) β
β Β· deterministic hash OR Qwen 0.6B semantic opt-in β
β Β· skips superseded observations (P0-5) β
β Β· EntityExtractionService upserts entities + typed relationsβ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΊ ProjectionCoordinator
β ββββΊ FTS5 lexical projection (BM25)
β ββββΊ vector projection (hash default;
β Qwen 0.6B semantic opt-in, 384-dim)
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RetrievalService (hybrid RRF fusion) β
β Β· coverage abstention gate Β· optional salience weighting β
β (off by default) β
β Β· shared-scope read (search_shared, opt-in multi-agent) β
β Β· temporal query orientation (active head first for present)β
βββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββΊ ContextAssembler (bounded, source-cited)
β
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GraphRetrievalService β
β Β· BFS neighborhood over Entity/Relation (both directions) β
β Β· temporal validity filtering (expired relations excluded) β
β Β· related_memories by min graph distance β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
OFFLINE MAINTENANCE SERVICES (dream modes; no production
producer yet; non-destructive):
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ConsolidationService Β· Jaccard near-dup merge (>= 0.8) β
β CurationService Β· salience scoring (recency + β
β confidence; usage term inert) β
β RetentionPolicyServiceΒ· max_age/min_usage/kinds policy, β
β evaluate + opt-in archive β
β ContradictionScanService Β· report-only, never auto-resolves β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- The canonical store is the only source of truth. Search indexes are projections that can be rebuilt from it at any time.
- Worker jobs derive memories and facts in the background, so saving stays fast. A failed job retries and then dead-letters; it never silently disappears.
- Retrieval runs inside one exact scope, fuses lexical and semantic results, and drops memories a newer fact has closed from the current view (they stay in history).
More: architecture, memory engine, threat model.
Install from PyPI with pip install severian (or uv add severian). To work from source, you need Python 3.11+
and uv:
git clone https://github.com/Sahil-SS9/Severian.git
cd severian
uv sync
# Save an observation in a scope
uv run severian ingest \
--database data/severian.db --fts data/fts.db --vectors data/vectors.db \
--tenant acme --profile alice --collection main --agent cli --session ses-1 \
--content "Alice signed the Acme contract on Friday" \
--source '{"uri": "note://contract-1"}'
# Search it (--derive processes pending jobs first; production runs `severian work`)
uv run severian search \
--database data/severian.db --fts data/fts.db --vectors data/vectors.db \
--tenant acme --profile alice --collection main --agent cli --session ses-1 \
--query "contract" --deriveOr run the Python example, which saves memories for two users, searches one and builds a cited context:
uv run python examples/quickstart.py| Surface | How |
|---|---|
| Hermes Agent | Drop-in memory provider: hermes plugins install severian (or copy plugins/hermes/severian/ to $HERMES_HOME/plugins/severian/), set memory.provider: severian. Tools: search, ingest, correct, forget, shared search, task progress notes. |
| MCP | full seven-tool surface over stdio for Claude Code, Codex, OpenCode and Claude Desktop: docs/integrations.md. Tools: ingest, search, get, correct, forget, task progress, shared search. Launch is fail-closed: pin --tenant-id/--profile-id (or the SEVERIAN_MCP_* pair), or pass --trusted-single-tenant on a trusted single-user host. |
| Python | severian.composition.build_bundle(...); see examples/quickstart.py |
| HTTP | uv run severian serve (dev server); client in severian.sdk.client |
| CLI | severian ingest / search / work / export / import / audit / rebuild-vectors / jobs requeue / ... (--help lists all) |
The MCP launch binding pins tenant and profile only; collection_id, agent_id and session_id stay
caller-chosen for each tool call. Give every harness its own profile in docs/integrations.md.
Behaviour switches are environment variables, so the same code serves benchmarks, tests and production.
| Setting | Default | What it does |
|---|---|---|
SEVERIAN_EMBEDDING |
hash |
qwen (local Qwen3-Embedding-0.6B) or remote-qwen (shared sidecar at SEVERIAN_EMBED_SOCKET) |
SEVERIAN_USER_FACTS |
off (recommended on) | Short facts per conversation turn, extracted by a local model in the background |
SEVERIAN_FACTS_URL / SEVERIAN_FACTS_MODEL |
http://127.0.0.1:8091/v1/chat/completions / active:aux |
The local model the fact pass calls. Before each pass the worker checks it once (/health, else <base>/models); when it is down the fact jobs wait without spending attempts. SEVERIAN_FACTS_PROBE=0 skips the check, SEVERIAN_FACTS_PROBE_TIMEOUT (3 s) bounds it |
SEVERIAN_DATE_STAMPS |
off (recommended on) | Writes real dates next to relative times when saving |
SEVERIAN_TRUTH_RESOLUTION |
off (recommended on) | Memories a newer fact replaced leave the current view and stay in history |
SEVERIAN_RELATION_EVENT_TIME |
off | Dates graph relations from their source message: a relation starts when that message was written and a replaced value ends at the newer statement's time, with half-open windows |
SEVERIAN_RERANK |
off (recommended: cross-encoder/ms-marco-MiniLM-L6-v2) |
Re-ranks the fused candidates |
SEVERIAN_OPT_NUMPY |
on (0.6.4: NumPy is a dependency) | Fast exact vector scoring; 0 forces the pure-Python path (same results, slower) |
SEVERIAN_CONFLICT_NOTES |
on | Adds a short note when two returned memories disagree (0 turns it off) |
SEVERIAN_FILL_BUDGET |
off | Search over-fetches a bounded pool and the context keeps adding ranked items until its character budget is full, instead of stopping at limit |
SEVERIAN_COMPACT_CITES |
off | Cites the source observation ids in one bracket and drops the trailing source: line: about 45 characters less per item, every citation still resolvable through severian_get_observation |
SEVERIAN_SUFFICIENCY |
off | Adds one line after the results when no returned memory holds the specific detail the question names |
SEVERIAN_DREAMING |
off | The maintenance passes: severian dream --mode <m> (dry run unless --confirm) and the severian work --dream-tenant/--dream-profile tick. Off means no pass runs, nothing queues one, and the derive drain behaves exactly as before. See docs/memory-engine.md |
SEVERIAN_DREAM_URL / SEVERIAN_DREAM_MODEL |
http://127.0.0.1:8091/v1/chat/completions / active:aux |
The optional writer that words a merge summary. Loopback only unless SEVERIAN_DREAM_ALLOW_REMOTE=1: a remote model is a costed run, never a default |
SEVERIAN_STORAGE / SEVERIAN_DSN |
Hermes store / unset | SQLite directory, or a PostgreSQL DSN |
The recommended settings are the ones benchmarked above. PostgreSQL setup: docs/postgresql-backend.md. Day-to-day running: docs/operator-runbook.md.
Two moves carry the next round: per-person fact sheets to close the multi-hop gap, and a better rule for knowing when to answer "I don't know". Then a wider field (MemMachine, Graphiti/Zep, Letta, Cognee, LangMem, Memobase), a cloud-model check of the winning setup, and stricter marks: every in-house run re-marked by Opus, plus cost per memory, a 10x-size stress test, and a confident-wrong vs "I don't know" measure.
See CONTRIBUTING.md for the development loop and quality gates, and SECURITY.md to report a vulnerability. Release history: CHANGELOG.md. All documentation: docs/.
MIT. See LICENSE.