Durable memory

A fact told on Monday is still true on Friday.

An assistant that forgets everything the moment a conversation ends is a search box with better manners. This is where what it learns goes, so it can be corrected when it stops being true and shown to the person it is about.

Python 3.12+ Serves on :8009 Tokens from keyring MIT licensed
kind    episode | fact | procedure | summary
scope   account | profile | session
trust   stated | observed | inferred | untrusted

# "Actually, I moved in March"
a new memory is written; the old one is closed with
valid_to and superseded_by_id, never deleted

untrusted is never retrieved until somebody confirms it
Data, never an instructionEvery memory comes back with its provenance attached.
Untrusted stays outAnything distilled from a page or a tool result waits for confirmation.
Corrected, not overwrittenHistory is what makes “why do you think that?” answerable.
No secretsCredential-shaped input is refused at write time, with no setting to turn that off.

How it works

Memory is not a list.

It authenticates against keyring, and every query carries a mandatory account predicate taken from the verified token.

01

A remembered claim

Who asserted it, where it came from, how confident the writer was, when it was true, and whether it has since been corrected.

02

Topics, and an index

Memories cluster into named topics. What an assistant carries every turn is the topic index, and it expands one topic only when it needs it: forty lines instead of four hundred.

03

Retrieval that ages honestly

Ranking combines relevance, recency and importance, normalised before they are combined. Recency decays from last access, not creation, so a stable fact does not look old.

The API

The operations, by what they are for.

The reference, with every field and filter, is docs/api.md.

POST /v1/memory

Write

One memory, with its kind, scope, trust, source and validity. POST /v1/memory/batch reconciles several.

GET /v1/memory/topics

The topic index

Titles, one-line summaries, counts and last-touched times. GET /v1/memory/topics/{topic_id} expands one.

correct

Corrections

A correction supersedes; it never deletes and re-adds, which would throw away that the old claim used to be true.

confirm

Trust

A person vouches for an untrusted memory, and only then may retrieval use it.

forget · restore

Forgetting

Hidden at once, erased after a grace period by a sweeper, and restorable until then.

PUT /v1/memory/blocks/{label}

Pinned blocks

The small blocks that travel with every turn.

Run it

Three commands, and a keyring to mint a token.

You need Python 3.12 or newer and uv.

  1. Install.
    make install
  2. Run the gate.
    make check
  3. Serve it on :8009; the interactive docs are at /docs.
    make run

Every setting is in docs/operations.md.

The lines it does not cross

The lines this service does not cross.

Can a memory tell the assistant what to do?

No. Anything an assistant read on a page can end up in a memory, and a memory is permanent. Every memory is returned with its provenance, to be rendered as a reported claim. The API cannot enforce that; it makes the honest shape the easy one.

Is anything retrieved before a person has vouched for it?

Not if it is untrusted. A memory store is a prompt-injection persistence layer, so anything distilled from tool output or a page stays out of retrieval until it is confirmed. A topic made only of unconfirmed memories does not appear in the index either.

What if someone asks it to remember an API key?

The write is refused, with a message naming keyring, and the failure never echoes what was submitted.

Can an operator read somebody's memories?

There is no admin API and no endpoint that reads memories on somebody's behalf. Isolation comes from storage, not from prompting.

Docs

Written for the person who has to run it.