Memory Soda
Open source · Self-hosted · MIT
Memory for agents that
actually holds up over time.
Send Memory Soda your conversations. It works out which statements are worth keeping, resolves them against what it already believes, and hands back a prompt-ready block of text before your next model call.
npm create memory-soda@latestThe integration
Two calls per turn.
One before the model to fetch what is known, one after to hand over what was said. Extraction runs in the background, you never wait for it.
Your code
import { MemorySoda } from '@alagappan17/memory-soda';
const memory = new MemorySoda(); // reads the environment
// Before the model call.const { context } = await memory.recall({ dataset: userId, query: userMessage,});
const reply = await yourModel({ system: `You are a helpful assistant.\n\n${context}`, messages,});
// After the turn. Extraction runs in the background.await memory.addMessage(threadId, { role: 'assistant', content: reply,});What context contains
Known facts about the user, most relevant first.
# FACTS (format: fact (valid: from – to))- user drives tesla model 3 (valid: 2026-08-01 – present)- user likes sci-fi movies (valid: 2026-03-02 – present)- user does city commuting (valid: 2026-08-16 – present)
# ENTITIES- tesla model 3 (PRODUCT)- city commuting (TOPIC)A string. It goes straight into your system prompt, no formatting, no embeddings to handle, no JSON to walk.
What it stores
Three layers, one message stream.
- 01
Working
The live conversation window, compacted automatically.
- 02
Episodic
A summary of each stretch of a conversation, and where every fact came from.
- 03
Semantic
Durable subject–predicate–object facts with the window of time they are true for.
Why this one
It stores claims, not transcripts.
Embedding a conversation retrieves messages. “I drive a Honda Civic” and “I switched to a Tesla Model 3 last month” come back with similar scores and the model has to guess which is current. Every claim here carries the window of time it is true for.
Contradictions supersede
Say you switch to a Model 3 and the Civic fact is marked superseded, not deleted. An LLM judge decides which of two conflicting claims survives; exclusive states replace, compatible ones coexist.
Read moreThree retrieval signals, fused
Vector similarity, entity-anchored lookup and Postgres full-text run in parallel and are merged by rank. The anchor signal is what connects “anything on Netflix” to “favourite show is breaking bad”.
Read moreTime travel
asOf answers what the system believed at any past instant, because nothing is ever really deleted. Useful for auditing a decision, and for telling a retrieval bug apart from a memory that legitimately changed.
Read moreProvenance on every fact
Each claim keeps the verbatim quote it came from and the episode that produced it, so you can always answer why the assistant thinks it knows something.
Read morePostgres and nothing else
No vector database, no graph database, no queue, no vendor. CREATE EXTENSION vector, run one process, and you are done.
Read moreA pipeline you can watch
The bundled playground shows every request, every extracted triple and every contradiction verdict as it happens, so “why was that not remembered?” is a question with an answer.
Read moreBefore you adopt it
Memory Soda is pre-1.0. Facts can only be derived from conversation, there is no write API yet, every fact must be about the user, and a statement takes tens of seconds to become retrievable. Those limits are written down rather than glossed over.
Known limitations