Skip to content

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@latest

The 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.

    prepare()Pure SQL, milliseconds.
  • 02

    Episodic

    A summary of each stretch of a conversation, and where every fact came from.

    recall({ include: ['episodes'] })One vector search.
  • 03

    Semantic

    Durable subject–predicate–object facts with the window of time they are true for.

    recall()One embedding, three parallel queries.

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.

Before 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

Start reading.