divergence user:ada · memories
added0
changed0
removed0
kept0
statusidle

worked example · dreams

A memory that reorganizes itself. And shows you the diff.

Anthropic’s Dreams let Claude re-read an agent’s memory store and up to 100 past sessions, then hand back a second, reorganized store — duplicates merged, stale entries replaced, new insights surfaced, input never touched. On memseek the same idea is one bounded, cited derivation you own, and what you adopt is a classified diff rather than a store to eyeball.

Design simulation · example walkthrough. The memories, sessions, and proposed diff below are illustrative. Memseek supports the required snapshot, draft, diff, and promotion primitives, but this repository does not yet ship the exact dream catalog shown on this page.

output store · draft awaiting review
changed Prefers 4-space indentation.
added Always adds type hints to new functions.
removed Debugged a flaky CI job by bumping the timeout.
kept Works in the payments service.
input · immutable snapshot promotion · compare-and-set

00 · the problem

Memory that tidies itself. Who checks what it threw out?

Nobody, usually — and that is the problem. You would review it if the system told you what changed. A background model re-reading an agent’s memory can genuinely merge duplicates and retire stale entries. But hand back a whole second store and nobody can see which memories moved — so nobody reviews it, and everybody hopes.

a second store

Get back a new store and compare by hand.

  • You get a store, not a diff.
  • Reviewing means eyeballing, which nobody does twice.
  • A cleanup can land on top of newer memory.
with memseek

Get back a labelled draft you adopt or decline.

  • The result is a draft. Live memory is untouched.
  • Every slot is labelled, with the evidence behind it.
  • Adoption is refused if the store moved while you read.
  1. the store gets messy

    Two memories say the same thing, and one of them is out of date.

    “Prefers tabs.”  +  “Uses tabs for indentation.”
  2. the cleanup runs

    It reads the recent sessions and proposes a tidier version.

    “Prefers 4-space indentation.” Changed, and it says why: a later session standardised on four spaces.
  3. you get a diff, not a store

    Every slot is labelled, including the one it wants to throw away.

    removed — “Debugged a flaky CI job by bumping the timeout.” kept — “Works in the payments service.”
  4. what you write

    Read the diff. One line adopts it — and only you can run that line.

    review = await memseek.run(run_id)
    review["candidate_set"]["divergence"]  # what moved
    
    await memseek.promote(...)  # nothing is live until this
4 slots in, every one accounted forA missing entry has to be a deliberate removal, not a model’s omission.
0 live changes before approvalDeclining costs nothing: the draft stays on the record and memory never moved.
A diff, not a storeYou review changes with reasons attached, not two lists side by side.

New to Memseek? You write one small configuration file describing what your application should remember. After that your application only appends what happened; Memseek does the deriving, keeps every conclusion linked to the evidence underneath it, and hands your agent a bounded briefing instead of a pile of text. Everything below is that file and what it produces — how it works.

the words the rest of this page usesplain english
candidate, draft
A proposed result that is stored but not in use.
divergence
The diff: which slots were added, changed, removed, or kept.
promotion
The single act that makes a draft live. A person does it.
blueprint
The design on this page is not shipped yet, though the pieces it needs are. The runnable version today is the CRM rebuild.
1
freeze the evidence

The run reads a checkpoint, not a store that can move underneath it.

The blueprint takes a bounded snapshot of recent sessions and the current heads of four memory keys. A separate policy record states what curation should value. These source records and their versions become the evidence contract for this one run.

blueprint · derivations/dream.yamlnot checked in
sources:
  sessions:
    kind: snapshot
    collections: [sessions]
    max_records: 100
    max_tokens: 24000
  store:
    kind: current
    collections: [memories]
    keys: [style, tools, domain, workflow]
  policy:
    kind: record
    collection: playbooks
    key: curation_policy
kind: snapshot

Resolve a stable session corpus at one checkpoint, so later messages cannot appear halfway through the rebuild.

kind: current

Read exactly the live heads the candidate proposes to replace and remember their versions for stale-write protection.

keys

Define the entire target store. The model cannot invent a fifth memory category.

writes now

A queued run and a frozen copy of its inputs: the four current memories (“Prefers tabs.” · “Uses tabs for indentation.” · “Debugged a flaky CI job by bumping the timeout.” · “Works in the payments service.”) and three recent sessions. The live memories heads do not change.

2
curate inside hard limits

The model receives a specific job, an output shape, and a budget.

The task may merge duplicate preferences, replace a stale tabs preference with four spaces, omit a one-off CI incident, preserve a stable domain fact, and add a cited type-hint pattern. It cannot read beyond the sources or call the model indefinitely.

blueprint · derivations/dream.yamlthe bounded task
model: strong
limits:
  max_llm_calls: 2
  max_total_tokens: 40000
  max_wall_s: 120
tasks:
  - id: curate
    use: llm
    with:
      output_schema: # records + citations
      prompt: |
        Merge duplicates, replace stale entries,
        remove noise, and cite visible UUIDs.
model: strong

Choose a versioned model alias in catalog configuration rather than hard-coding a provider name in application logic.

limits

Cap calls, tokens, and wall time before the run begins. A “dream” is not an open-ended autonomous loop.

output_schema

Require one legal record shape with citations. A prose essay cannot accidentally become the new store.

writes next

Model-call receipts and a proposed four-key result attached to the run: style → “Prefers 4-space indentation.”, workflow → “Always adds type hints to new functions.”, tools → dropped, domain → unchanged. It is still not active memory.

3
stage a complete candidate

The emission flags turn generated records into a review surface.

The runtime compares every proposed key with the captured live head and classifies it as added, changed, removed, or unchanged. Completeness matters: a missing key must be an explicit retraction, not an ambiguous omission.

current memory style

Prefers tabs.

current memory duplicate

Uses tabs for indentation.

current memory one-off incident

Debugged a flaky CI job by bumping the timeout.

current memory domain

Works in the payments service.

recent sessions

Now prefers four spaces and consistently adds type hints to new functions.

curate
complete + reviewed
changed

Prefers 4-space indentation.

why
newer session evidence supersedes tabs
also
duplicate merged
added

Always adds type hints to new functions.

removed

The flaky-CI note is classified as a one-off incident, not durable memory.

unchanged

Works in the payments service.

live store · unchanged

These effects exist only in the candidate until promotion succeeds.

Visible effect: every input key has an explicit disposition; nothing disappears because the model omitted it.

blueprint · derivations/dream.yamlthe guarded emission
emit:
  from: "{{curate.records}}"
  collection: memories
  type: memory
  keys: [style, tools, domain, workflow]
  complete: true
  review: required
keys

Map each output to one of the four legal current heads and reject any extra category.

complete: true

Demand that the candidate accounts for the whole store so review can distinguish “remove this” from “the model forgot it.”

review: required

Stage candidate records and divergence metadata instead of advancing live heads automatically.

writes next

One inert candidate set plus a per-key diff: the tabs duplicate merged, style changed to “Prefers 4-space indentation.”, the flaky-CI note removed, “Works in the payments service.” kept, and “Always adds type hints to new functions.” added.

4
you adopt it, or you don’t

Approval succeeds only if the store is still the one that was reviewed.

A person inspects the candidate and chooses adopt or decline. Promotion rechecks the captured input heads. If another process updated style during review, the operation is rejected as stale instead of overwriting newer memory.

review decisionApprove the classified diff only after verifying every changed or removed key and its evidence.
reviewed artifact contractruntime behavior
lifecycle: reviewed
candidate:
  covered_keys: [style, tools, domain, workflow]
  divergence: [added, changed,
               removed, unchanged]
promotion:
  precondition: captured_input_heads
  on_stale: reject
covered_keys

Prove the draft accounted for every store slot defined by the emission contract.

divergence

Give the reviewer semantic change classes instead of asking them to compare opaque store IDs.

on_stale: reject

This is explanatory pseudoconfiguration for the runtime’s compare-and-set behavior—not a field in the unfinished dream.yaml.

final state

On approval, four new current heads are promoted at once and “Prefers tabs.” moves into history. On decline or staleness, live memory still says “Prefers tabs.” and the draft stays on the record.

Continue into the interactive blueprint and diff →

01 · the mapping

The same idea, in surfaces you already have.

A dream is an async job over an existing memory store plus 1–100 sessions, producing a new store. Every part of that is already a memseek primitive: nothing here is built for dreams specifically.

memory_store inputthe store Claude verifies and reorganizes
snapshot Sourcecomplete bounded corpus at one checkpoint
sessions input1–100 past transcripts to mine
changes Sourcethe transcripts collection, windowed
the dreaming pipelinereads, merges, resynthesizes
a bounded derivationan llm Task under strict limits
“input never modified”output store is separate
immutable recordsemission stages a new candidate
merge / replace / surfacededupe, freshen, add insight
Divergenceadded · changed · removed · unchanged
review, then adopt or discardattach or delete the output
review: required → Promotioncompare-and-set activation
pending → running → completedasync job status
run lifecycleaudited, streamable, cited outputs
instructions (steering)focus areas, 4,096 chars, a synthesis pass — not a line editor
a guarded policy recordrewriting it supersedes; the old policy stays on file

02 · run it

Walk through a dream-shaped rebuild and inspect every proposed change.

Steer the curation policy, pick how many sessions to mine, then open any curated memory to see the records it cites. The tally above fills as the divergence resolves.

dream request
recent 3

The input store is read as a snapshot — the dream can’t alter it. Output is staged for review; nothing goes live until you adopt it below.

output memory store · staged draft idle
Press Run dream to synthesize the curated store.
Every memory opens to show what it cites.

03 · the lifecycle

Async, auditable, and reversible.

The dream is a run you can poll or stream. When it completes, the output is a draft you explicitly adopt — or discard, leaving the original untouched and still addressable.

pending → running → completed → adopt
01 · pendingQueued

The run is created against a snapshot checkpoint of the input store.

02 · runningRead

The store snapshot and the windowed sessions load as cited, fenced sources.

03 · runningSynthesize

One bounded LLM Task merges, freshens, and surfaces — under strict budgets.

04 · runningDiverge

Output is compared to the active heads: added / changed / removed / unchanged.

05 · completedStaged

A draft candidate awaits Promotion. The input store is unchanged.

Ready to replay.

04 · how you write it

The hosted job, and a Memseek implementation blueprint.

One is a research-preview endpoint you call and poll. The other shows how the same workflow can be composed from Memseek primitives in a definition you author and version.

# Anthropic Managed Agents — a hosted async dream.
# Research preview, gated by dreaming-2026-04-21 alongside
# managed-agents-2026-04-01.
dream = client.beta.dreams.create(
    inputs=[
        {"type": "memory_store", "memory_store_id": store_id},
        {"type": "sessions", "session_ids": [session_a, session_b]},
    ],
    model="claude-opus-4-8",
    instructions="Focus on coding-style preferences; ignore one-off debugging notes.",
)

# typically minutes to tens of minutes, driven by input size
while dream.status in ("pending", "running"):
    time.sleep(10)
    dream = client.beta.dreams.retrieve(dream.id)

# the result is a whole second store, not a diff
store = next(o.memory_store_id for o in dream.outputs
             if o.type == "memory_store")

A single hosted job: it clones the store, runs a pipeline you don’t see, and hands back a second store id. Adopting means attaching that store to future sessions; discarding means deleting or archiving it. Nothing tells you which memories moved — that comparison is yours to make.

The one difference that matters: a dream hands you a second store and asks you to eyeball it — the API reports pending → running → completed and an output store id, but never which memories moved. memseek hands you the classified diff: every memory labelled added, changed, removed or kept, each one cited, over a key set the emission declared in advance — and adopting it is a compare-and-set promotion that is refused if the store shifted while you were reviewing.

05 · then take it further

The design can be extended with existing primitives.

Once the base catalog is implemented and tested, these are the next controls you can add deliberately.

Prepare drafts continuously
Swap the on-demand run for a write trigger that fires once a threshold of new sessions lands. New drafts can arrive without a cron; promotion can remain an explicit human decision.
Detect contradictions
Add a contradiction pass so “replace stale entries” becomes explicit: the diff shows which session overturned which prior memory, with both cited.
Scope per entity
Every dream is entity-scoped for free. One definition curates a separate, isolated store for each user, agent, or account — no cross-contamination.
Anchor on a graph
Feed a graph-boosted retrieval as a Source so the dream weights memories near an anchor entity — curate “everything about the payments project” more tightly.
Branch experiments
Stage several drafts from different instructions at once. Compare their divergences, promote the best, discard the rest — all against the same immutable input.
Time-travel & retention
Because the input is never mutated, every past store is still addressable. Pair with a retention job to purge tombstones on your own schedule.

start building

Use this blueprint to build a bounded memory rebuild.

The necessary engine behavior already exists: bounded sources, model limits, a complete keyed candidate, a visible diff, and explicit promotion. Your catalog supplies the domain.

derivations/dream.yaml
emit:
  from: "{{curate.records}}"
  collection: memories
  keys: [style, tools, domain, workflow]
  complete: true
  review: required

In a completed catalog, complete and review are the two emission flags that make the run stage a full, reviewable draft instead of overwriting live memory.

Design simulation, not a captured or checked-in run. The memories, citations, counts, and dream.yaml model how a bounded reviewed rebuild can be implemented from supported primitives. Use the runnable CRM rebuild as the current executable reference.