raven-memory gives AI agents a living memory substrate: Voronoi geometry, ternary logic, spectral optics — with synapses that learn, contradictions that inhibit, and nights in which it dreams.
Most agent memory is a cosine ranking over a static index. Every memory is equally true forever; contradictions live side by side; nothing consolidates. raven-memory replaces the index with a dynamical system.
Each memory lives in a spatial cell, carries a three-valued state, and resonates — or doesn't — with the spectral modes of the whole field.
Embeddings seed a Voronoi tessellation: each memory owns a cell, and cell adjacency defines hops. Recall activates a neighborhood, decaying as e^(−0.15·hops) — relevance has a literal shape.
States and links are three-valued. Memories are REINFORCED, NEUTRAL or FORGOTTEN; links are RESONANT, NEUTRAL or INHIBITORY. When a memory is validated, its inhibitory links silence contradictors: the field collapses around truth.
An SVD over all active embeddings extracts the field's eigen-modes — properties of the cavity, not of any source. A query that projects onto strong modes resonates. Resonance and coherence ship as epistemic metadata, never as score hacks.
This widget reimplements the engine's rules in the browser — ternary states, hop-decay recall, auto-inhibition, cluster-and-merge — so you can feel the dynamics. The production engine (FastAPI · SQLite · SVD · STDP) runs in Python; the README and demo video show it end to end.
An offline consolidator — run it like a cron at 3 a.m. — clusters redundant episodic memories and fuses each cluster into one semantic node, in a single atomic transaction. Then the spectral field is rebuilt over the new space.
Greedy cosine clustering (θ≈0.83) groups episodic NEUTRAL memories that say the same thing.
Recall-weighted centroid embedding + extractive summary. The memories the agent actually used weigh more.
Insert node, delete sources, cascade links — one BEGIN IMMEDIATE transaction. A crash can never duplicate the past.
The SVD spectral field is rebuilt over the consolidated space: the agent wakes with sharper eigen-modes.
Episodic and semantic memories share one spectral field — deliberately. Dreaming migrates clusters across layers, and the consolidated structure should shape how new experience resonates. The cavity is one.
Recalls, consolidations — every operation is chained with SHA-256 over its full payload, including the content hash of each retrieved memory. Click any block below to tamper with it, then verify.
This widget mirrors the production scheme exactly: hash = SHA-256(canonical payload + prev_hash), where the payload carries each retrieved memory's content hash. Tampering edits the memory content inside a block — recomputation then fails, just like editing a row in the real SQLite audit log.
Each memory carries its author's writing fingerprint: function-word frequencies, sentence rhythm, punctuation density — language-aware (ES/EN). A memory whose style breaks from its claimed author is degraded to FORGOTTEN and an alert is raised. A bilingual author switching languages is never flagged.
Embeddings fall back three tiers: local model → Qwen API (with retries) → deterministic dummy. The dummy tier screams: SEMANTIC QUALITY DEGRADED in the logs, degraded: true in /health and in every response. The agent always knows what its memory is made of.
A 55-finding internal audit plus an external review, mapped fix-by-fix: tamper-evident audit chain made cryptographically recomputable, WAL-mode SQLite, atomic consolidation, authenticated WebSockets, rate limiting, dimension-validated tensors.