Introduction
twin memory is a hosted memory API for AI apps. Add what your users say, search it with dates and sources, and erase it with a receipt.
Your backend sends twin memory what its users say: chat messages, documents, notes. Each end user's memory is kept apart from every other, and search returns what a model needs to answer, with the date it was said and the address it came from.
What you can do
| Call | What it does |
|---|---|
add | Write messages, documents or notes for one end user. The same id again is an edit. |
search | Ask a question in plain words. Returns what is known now, dated facts, and the passages behind them. |
history | Every value a subject's attribute has had, each with the day it held from. |
versions | Every version of one item you added, and when and why it went. |
forget | Erase items, sessions or threads with every copy, and get a per-table receipt. |
correct | Retract one fact for good, with an optional replacement. |
lineage | Follow an item to what it became, or a fact back to the words it was read from. |
| MCP | Give Claude Code, Cursor, VS Code and other MCP clients the same memory, at one URL. |
The API reference lists every route.
How it is shaped
- One key per project. A key belongs to an organisation and one of its projects, and is either read-only or read and write. Give an agent that only reads a read key, and an agent that saves a key that writes. Keep every key on a server, never in a browser.
- One header per end user.
X-Twin-Accountnames whose memory a request reaches. It is never a field in a request body, so a model calling your tools cannot name somebody else. - Adding is quick; reading happens later. An add is accepted at once and is searchable by its words a moment later. In the background, each new window of a conversation is read once into dated facts. A search makes at most one model call.
- You can see where everything came from. Every fact names the passage it was read from, every item's versions are kept until it goes, and every erasure returns a receipt.