Agent memory with dates, evidence and real deletion.
Quipu is an open-source memory layer that runs next to your agent. It keeps every original message, extracts dated facts from them, and returns the facts that were true on any given date.
MIT licensed. Runs locally. Works with any model provider.
A memory graph built from six messages
An illustration with made-up messages. Pick any node to see the messages behind it.
A pile of text chunks is not a memory
Most memory layers store fragments and search them by similarity. That fails in three ways once an agent has been running for a while.
Old facts come back as current
The repo moved from npm to pnpm. Both messages match the search, and the agent picks one.
Facts carry dates
A new value makes the old one history instead of deleting it. You can ask what is true now, or what was true on any earlier date.
Summaries lose their source
Once a conversation is summarised, nobody can say which message a claim came from, or whether anyone said it.
Every memory links to its evidence
Facts, summaries and patterns each point at the messages they rest on. memory.inspect shows the chain.
Deleted data still shows up in answers
Removing a message leaves behind the summaries and facts that were built from it.
Forgetting reaches every derived memory
Forgetting a message also suppresses every fact and summary built on it. A dry run shows the full list before any deletion.
How it works
One local process owns the memory. Your agent talks to it through an SDK, the command line or MCP.
-
Remember
Send sessions and messages during the conversation. Quipu stores them unchanged, scoped to a user, project or agent.
memory.remember -
Extract
Background jobs turn messages into dated facts, preferences, conversation summaries and recurring patterns, each linked to its evidence.
--background on -
Retrieve
Ask a question and get a prompt-ready context plus a structured packet, filtered by scope and held to a token budget.
memory.retrieve -
Forget
Select by ID or by query. Quipu removes the evidence and suppresses every memory that depended on it.
memory.forget
88.7% on temporal reasoning, from 3,800 tokens of context
LongMemEval-S, all 133 temporal reasoning questions, with a GPT-4o reader and the benchmark's GPT-4o judge. Quipu answers with one model call per question in about 1.1 seconds. With a budget of 1,024 tokens it still scores 85.0%.
Temporal reasoning is one of six question types in LongMemEval. Other systems' figures are their own published results. Full comparison and sources
A small context makes each answer cheap
Most of the price of an answer is the context the reader model has to read. Quipu sends about 1,000 to 4,000 tokens where other approaches send 30,000 or the whole history.
| Approach | Context per question | Reader cost per question | Time to answer |
|---|---|---|---|
| Quipu, 1K budget | 980 tokens | $0.004, measured | 1.1 s |
| Quipu, 4K budget | 3,800 tokens | $0.011, measured | 1.1 s |
| Zep | 1,600 tokens | about $0.004 | 2.6 s |
| Mastra OM | about 30,000 tokens | about $0.075 | 4.1 s |
| Full context | 115,000 tokens | about $0.29 | 28.9 s |
About 26 times cheaper than full context at the 4K budget, and about 70 times cheaper at 1K, with 40 points more accuracy on temporal questions.
About 7 times cheaper than a 30,000-token context at the 4K budget, and about 19 times cheaper at 1K, at a similar score.
About $0.03 per conversation history for the background jobs that extract facts and summaries, paid once at ingest with GPT-4o-mini.
Quipu's costs are measured from its own runs with GPT-4o. The other rows are calculated from each system's published context size at GPT-4o's list price of $2.50 per million input tokens, and leave out output tokens and any extra model calls. Times are each system's own report on its own hardware.
Start in a few minutes
The installer builds the core against LatticeDB 0.18.0. It needs
git, zig and the LatticeDB library on your machine.
- Python and TypeScript SDKs
- A command line for every memory operation
- An MCP adapter for tool-calling hosts
- OpenAI, Anthropic, Gemini, Ollama, OpenRouter and other providers
curl -fsSL https://raw.githubusercontent.com/jeffhajewski/quipu/main/scripts/install.sh | bash
export PATH="$HOME/.quipu/bin:$PATH"
quipu --db "$HOME/.quipu/memory.lattice" health
from quipu import Quipu
with Quipu.local(db_path="/tmp/quipu.lattice") as q:
q.remember(
scope={"projectId": "repo:quipu"},
messages=[{"role": "user", "content": "Use pnpm for this repo."}],
)
answered = q.answer(
query="What package manager does this repo use?",
scope={"projectId": "repo:quipu"},
needs=["current_facts"],
)
print(answered["answer"])
import { Quipu } from "@quipu/memory";
const q = await Quipu.local({ dbPath: "/tmp/quipu.lattice" });
await q.remember({
scope: { projectId: "repo:quipu" },
messages: [{ role: "user", content: "Run just test before committing." }],
});
const answered = await q.answer({
query: "What should I run before committing?",
scope: { projectId: "repo:quipu" },
needs: ["procedural"],
});
console.log(answered.answer);
q.close();
quipu --db "$HOME/.quipu/memory.lattice" remember \
--project repo:quipu \
--text "This repo uses pnpm. Run just test before committing."
quipu --db "$HOME/.quipu/memory.lattice" answer \
--project repo:quipu \
--query "What should I run before committing?" \
--need procedural
quipu --db "$HOME/.quipu/memory.lattice" forget \
--project repo:quipu --query "pnpm" --dry-run
Six rules enforced by the core
These are enforced in the core and checked by its tests, so every SDK and integration gets the same behaviour.
- Original messages stay intact
- Raw evidence stays as it was written unless you explicitly forget it.
- Derived memories cite evidence
- Every fact, summary and pattern links to the messages that justify it.
- Facts have dates and scopes
- Each has a period of validity and belongs to a user, project or agent.
- Contradictions stay on record
- Two statements that disagree are both kept, each marked as a contradiction.
- Forgetting reaches derived data
- Removing evidence suppresses the memories and indexes built on it.
- SDKs stay thin
- Clients only validate requests and pass them to the core. Memory behaviour lives in one place.
Project status
Quipu is a working prototype you build from source. It is not a hosted service, and there are no packaged releases yet.
Working today
- Remember, retrieve, answer, search, inspect and forget
- Durable storage on LatticeDB
- Background extraction, summaries and pattern detection
- Python and TypeScript SDKs, CLI and MCP adapter
Not built yet
- A long-running socket or HTTP server
- Release binaries and published SDK packages
- A full LongMemEval run on all 500 questions
- More host integrations