Trust

Every memory keeps its chain of custody.

Trust is memory for AI agents. It records where each memory came from (a file, a contract, a web page, a record) and everything that has happened to it since: who agreed, who relied on it, and when the source under it changed.

Open source, MIT. Early: this is v1. Runs on Cloudflare Workers and Durable Objects with SQLite. Read the code.

All reads go through db.js

From
src/db.js at 4be81f2
By
ada; lin agrees
Relied on
3 times

Notice period is 30 days

From
Engagement letter, version 3
By
intake agent
Stale: letter revised to version 4
An example (illustrative). Memories are laid down over time, each tagged with where it came from. When the engagement letter was revised, the memory resting on it slipped and was marked stale; the ones resting on the policy, the code and the pricing page held.

The whole history, not just the latest note

Open any memory and read its custody, link by link. This is "Notice period is 30 days".

  1. 18 Nov, 9:12

    Collected by the intake agent from the engagement letter, version 3

  2. 18 Nov, 9:40

    Agreed by the review agent, reading the same letter

  3. 19 Nov

    Relied on 3 times, by the drafting agent writing two notices

  4. 20 Nov, 14:30

    Replaced by "Notice period is 45 days", collected from version 4

Agents remember things nobody can trace.

Give an agent memory and it starts writing down conclusions. Some come from the code. Some come from a stale doc, a flaky CI log, or another agent's guess. A week later, a different agent recalls one of them and acts on it.

Ask why it believes that, and there is no answer. Find out a source was wrong, and there is no way to know what it taught. One poisoned memory quietly steers every agent that comes after.

Trust treats where a memory came from as part of the memory.

How it works

Four ideas, all enforced by the server rather than left to the agent.

Provenance on every write

Each memory records its origin (agent, session, supervisor, step), the exact sources it was drawn from with content hashes, and the memories it was derived from. The server attaches the origin from the session, so an agent can't claim to be someone else. A memory with no sources is still stored, but capped at the lowest tier. The tiers are unverified, sourced and reviewed.

Recall receipts

Every recall is logged. Trace a memory forward with impact: which sessions recalled it, and which changes merged after. Trace it backward with why: the chain through parent memories to the original sources.

Remove by source, roll back a session

If a source turns out to be poisoned or wrong, remove it. Everything it taught is quarantined, and so is everything built on that. You can do the same for a whole session. When a source changes, what it taught is flagged stale until someone re-checks it. Every memory is signed with an HMAC over its origin and source versions.

A judge for every new memory

Before a memory is stored, a model compares it with its nearest neighbours and decides how they relate. Duplicates become corroboration. Contradictions go to review. When the judge isn't sure, nothing happens automatically. More on the judge.

A memory traced from sources to a merged change Two source files feed memory n-1, which feeds memory n-2. A session recalls n-2 and a change merges after. A third source, a CI note, feeds memory n-3, which is shown quarantined after that source is removed. Sources Memories Recall receipts Changes money.ts sha256:9c1e… billing.md sha256:41d0… ci-note.txt removed n-1 sourced n-2 sourced, derived from n-1 n-3 quarantined session s-91c0 recalled n-2 change #42 merged after recall
Read left to right for impact, right to left for why. Removing ci-note.txt quarantines n-3 and anything derived from it. Example data.

The memory judge

Agents repeat themselves, refine each other, and sometimes disagree. On every write, Trust finds the closest existing memories and asks a judge model how the new one relates to each.

The judge speaks the System One API, so you can swap models. Run Clef-Flash on Workers AI and memory never leaves Cloudflare. Or point it at a local Kev model, or TypeSafe's Jev.

Unsure goes to the agent

When the judge isn't confident, Trust takes no action. It tells the agent what it saw, with a second model's opinion if you've configured one. The agent checks the evidence and decides.

duplicate
Merged as corroboration. The existing memory keeps the second agent's origin and sources too.
refines
Logged.
supersedes
The old memory steps aside. A lower-trust write can't retire a higher-trust memory; it opens a review instead.
contradicts
Both memories are marked contested and a review opens.
unrelated
Logged.

How well the judge does

Judges were scored on 160 hand-labeled memory pairs, split into a core set and a harder set, plus 12 scenario tasks, in November 2026. With per-model thresholds, none of the three models made a wrong merge, a wrong retirement or a wrong conflict.

Judge eval, November 2026. Thresholds are each model's own.
Judge Right relation, core / hard Right action Wrong merges, retirements or conflicts Sent to the agent (of 160)
Jev98% / 93%96%08
Clef (Workers AI)92% / 97%89%021
Clef-Flash (Workers AI)97% / 90%88%019
Word-overlap heuristic58% / 48%54%0n/a

Read this with care

  • One annotator labeled every pair, and the pairs are synthetic: realistic, but invented.
  • Each model's thresholds were set on the same pairs they are scored on, so the action numbers are optimistic.
  • The set is small. One item moves a per-label score by about five points.
  • The heuristic was tuned against the core set, so its numbers are optimistic too.

The data, scorer and full results are in eval/. Recommended setup: Clef-Flash as the judge, Jev as the second opinion.

Walls that hold

  • Separate scopes. Matters for client work, projects for codebases. Each scope has its own store.
  • Checked on every call. Walls between people and scopes are enforced on every read and write, over HTTP and MCP. A refusal reveals nothing about the other side.
  • One reviewed way across. Knowledge reaches the shared precedent scope only through a promotion that is de-identified and approved by a person.

Identity on every call

  • Bearer tokens. One admin token per space. One agent token per session, valid for 12 hours and revocable.
  • Hashes only. Tokens are stored as hashes, so a copy of the database can't be replayed as credentials.
  • MCP built in. Agents connect at /mcp/<space> with their session token.

Why SQLite and not git? In a benchmark, a Durable Object SQLite write took 19 ms at p50, against about 180 to 240 ms for a git push. So writes go to SQLite. Batched git exports are planned, not built yet.

Run it yourself

You need Node and a Cloudflare account for deploys. Local development works without a login.

  1. Clone and install.

    git clone https://github.com/GeraniumLabs/Trust.git
    cd Trust
    npm install
  2. Start it locally. npm run dev uses Clef-Flash on Workers AI and needs wrangler login. npm run dev:offline needs no login and uses the heuristic judge.

    npm run dev          # http://localhost:8787
    npm run dev:offline  # no Cloudflare login
  3. Deploy to your own workers.dev URL.

    npm run deploy
  4. Point an agent at it over MCP, with the session token as a bearer token.

    POST https://<your-worker>/mcp/<space>
    Authorization: Bearer trust_agt_…

    Tools: memory_recall, memory_remember, memory_relate, memory_retract, memory_why, memory_impact.

Trust was built first for Mergery, git for agents. It is a separate, standalone project and works with any agent that speaks MCP or HTTP.