Skip to content
Sign in

memory

v0.3.17

Durable cross-session agent memory — named banks of always-injected markdown rules and auto-extracted memories, hybrid BM25 + entity recall, pinning, and supersede-never-delete history. Plain files on disk; every operation is a traced function.

license: Apache-2.0Used in 1 kitagentbm25contextmemoryragrecall

Install

bash
iii call compose::add worker=memory@0.3.17

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions28

memory::bank::create

Function

Create a named memory bank: an isolated scope of rules and memories, e.g. one per project or persona; its description tells extraction what the bank is for, narrowing what is kept. Idempotent; sessions select it via metadata `memory_bank`.

Request
  • descriptionstring

    Human description shown in listings and the console, and told to extraction as what this bank is for: it narrows what is kept.

  • namestringrequired

    Bank name, `[a-z0-9][a-z0-9_-]{0,63}` (it becomes a folder name).

Response
  • bankobjectrequired

    Summary row for `memory::bank::list` and the console page.

    • descriptionstring
    • memoriesinteger· uintrequiredmin 0

      Live memory (memory) count.

    • namestringrequired
    • pinnedinteger· uintrequiredmin 0
    • rulesinteger· uintrequiredmin 0

      Rule (always-injected markdown) count.

  • createdbooleanrequired

    False when the bank already existed (create is idempotent).

memory::bank::delete

Function

Delete a memory bank: the folder moves to the store's .trash, recoverable by hand.

Request
  • namestringrequired
Response
  • okbooleanrequired
  • trashed_tostringrequired

    Where the bank folder was moved (under the store's `.trash/`).

memory::bank::list

Function

List every memory bank with memory/rule/pin counts.

Request
Empty object
Response
  • banksobject[]required
    • descriptionstring
    • memoriesinteger· uintrequiredmin 0

      Live memory (memory) count.

    • namestringrequired
    • pinnedinteger· uintrequiredmin 0
    • rulesinteger· uintrequiredmin 0

      Rule (always-injected markdown) count.

memory::correct

Function

Internal: replace a memory its source transcript contradicts. One append writes the new record (the old provenance and statement date, plus the reason) and retires the old one into it; `expected_memory` must still match the old record.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • expected_memoryunknownrequired

    The snapshot of the memory the correction was judged on, as `memory::supersede` takes it.

  • idstringrequired

    The memory to correct.

  • reasonstringrequired

    Why, stored on the new record and carried on the events.

  • textstringrequired

    Its corrected text.

Response
  • correctedbooleanrequired
  • memoryany of

    The record that now holds the corrected text.

    any of (2)
    Variant 1
    • confidenceone ofrequired

      How a memory entered the store.

      Show 3 nested
      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      Show 2 nested
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0
    Variant 2
    valuenull
  • skippedstring

    Why nothing was written: `changed`, `pinned`, `edited`, `no_change`, `text_exists`, `invalid_text` or `flagged`.

  • supersededany of

    The retired record.

    any of (2)
    Variant 1
    • confidenceone ofrequired

      How a memory entered the store.

      Show 3 nested
      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      Show 2 nested
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0
    Variant 2
    valuenull

memory::delete

Function

Delete a memory (tombstone: sets invalid_at). It leaves recall immediately but stays on disk, readable with include_superseded. From a turn: a memory the turn reads (its bank's, or one recalled from a bank read under it); a pinned memory is refused.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • idstringrequired
Response
  • memoryobjectrequired

    One memory item. Serialized whole as a `memories.jsonl` line; replay is last-wins by `id`, so an update appends a full record with a bumped `revision` and a delete appends a tombstoned record (`invalid_at` set) — history is never destroyed, only superseded.

    • confidenceone ofrequired

      How a memory entered the store.

      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0

memory::doctor

Function

Self-test memory end to end: data-dir writability, a scratch-bank write/read/delete roundtrip, sibling reachability (router, session-manager, state), whether embeddings answer, whether recent extraction passes failed, which model extraction calls and why, how many extraction jobs wait in the dead-letter queue, and what extraction spent (model calls, tokens, the router's cost) and wrote since boot. Reports degraded states explicitly, not a bare process-up health.

Request
Empty object
Response
  • checksobject[]required
    • detailstringrequired
    • namestringrequired
    • okbooleanrequired
  • extractionall ofrequired

    Extraction passes since boot: how they went, what the model calls cost and what they wrote.

    all of (1)
    Variant 1
    • failed_in_a_rowinteger· uint64requiredmin 0

      Passes failed since the last one that succeeded.

    • lastall ofrequired

      The latest counted pass.

      Show 1 nested
      all of (1)
      Variant 1
      • callsinteger· uint64requiredmin 0

        `router::complete` calls made, failed ones included.

      • continuation_input_tokensinteger· uint64requiredmin 0

        Of `input_tokens`, what the continuations took.

      • continuation_output_tokensinteger· uint64requiredmin 0

        Of `output_tokens`, what the continuations took.

      • continuationsinteger· uint64requiredmin 0

        Calls made after one whose memories reached `max_memories_per_turn`, asking the same piece for what it left out; failed ones included. Each is also in `calls`.

      • cost_usdnumber· double

        The router's own cost, summed over the calls that carried one; absent when none did.

      • createdinteger· uint64requiredmin 0
      • droppedobject

        Memories the model returned that were not written, by reason, and items that did not parse, as `malformed`. A rule item that parsed is counted in `rules` only.

      • input_tokensinteger· uint64requiredmin 0

        Prompt tokens the router reported, cached ones included.

      • no_arrayinteger· uint64requiredmin 0

        Replies with no JSON array (prose, one word, no text); a `[]` reply is not one. A piece's first call is asked once more after one, and a second reads as nothing to keep; a continuation's is not asked again and leaves the piece `saturated`.

      • output_tokensinteger· uint64requiredmin 0
      • reinforcedinteger· uint64requiredmin 0
      • returnedinteger· uint64requiredmin 0

        Items in the replies' arrays before any check: memories, rules and malformed ones.

      • rulesinteger· uint64requiredmin 0

        Of `returned`, the rule items: they become learned rule lines, never memories, so `created` and `dropped` never count them.

      • saturatedinteger· uint64requiredmin 0

        Pieces that ended at the cap: the last reply read still reached `max_memories_per_turn` and no further call was made or could be read. The model may have left facts out, and nothing else shows that.

      • supersededinteger· uint64requiredmin 0
    • last_errorstring
    • passesinteger· uint64requiredmin 0
    • pendinginteger· uint64requiredmin 0

      Passes that ended with runs left for the queue's retry: a backlog draining, not a failure.

    • totalall ofrequired

      Every counted pass since boot.

      Show 1 nested
      all of (1)
      Variant 1
      • callsinteger· uint64requiredmin 0

        `router::complete` calls made, failed ones included.

      • continuation_input_tokensinteger· uint64requiredmin 0

        Of `input_tokens`, what the continuations took.

      • continuation_output_tokensinteger· uint64requiredmin 0

        Of `output_tokens`, what the continuations took.

      • continuationsinteger· uint64requiredmin 0

        Calls made after one whose memories reached `max_memories_per_turn`, asking the same piece for what it left out; failed ones included. Each is also in `calls`.

      • cost_usdnumber· double

        The router's own cost, summed over the calls that carried one; absent when none did.

      • createdinteger· uint64requiredmin 0
      • droppedobject

        Memories the model returned that were not written, by reason, and items that did not parse, as `malformed`. A rule item that parsed is counted in `rules` only.

      • input_tokensinteger· uint64requiredmin 0

        Prompt tokens the router reported, cached ones included.

      • no_arrayinteger· uint64requiredmin 0

        Replies with no JSON array (prose, one word, no text); a `[]` reply is not one. A piece's first call is asked once more after one, and a second reads as nothing to keep; a continuation's is not asked again and leaves the piece `saturated`.

      • output_tokensinteger· uint64requiredmin 0
      • reinforcedinteger· uint64requiredmin 0
      • returnedinteger· uint64requiredmin 0

        Items in the replies' arrays before any check: memories, rules and malformed ones.

      • rulesinteger· uint64requiredmin 0

        Of `returned`, the rule items: they become learned rule lines, never memories, so `created` and `dropped` never count them.

      • saturatedinteger· uint64requiredmin 0

        Pieces that ended at the cap: the last reply read still reached `max_memories_per_turn` and no further call was made or could be read. The model may have left facts out, and nothing else shows that.

      • supersededinteger· uint64requiredmin 0
  • okbooleanrequired

    True only when every REQUIRED check passed (the store roundtrip; the rest are reported but advisory).

memory::extract-job

Function

Internal: target of the queue::on-message observer on the memory-extraction topic and of the memory-extraction function queue — runs one extraction job; errors propagate so the queue retries and dead-letters instead of losing the pass. A job this worker did not queue is refused, whoever calls it.

Request
  • agentstring

    The session's agent profile, its bank read under `bank` (`scope::Resolved::agent`).

  • bankstring

    The bank the turn was injected with. Absent: resolved when the job runs (the worker never saw the turn, or the job predates this).

  • derivedboolean

    The turn's directory chose `bank`: `default_bank` is read under it (`scope::Resolved::layer`).

  • session_idstringrequired
  • skipboolean

    The turn ran without memory (an invalid or deleted bank): the job only steps the cursor past it.

  • turn_idstring

    The turn that queued the job. Absent on jobs queued before it existed.

  • untilstring

    The turn's last user/assistant entry: the pass reads no further.

Response
  • okbooleanrequired

memory::get

Function

Fetch one memory by id, including superseded/tombstoned records.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • idstringrequired
Response
  • memoryobjectrequired

    One memory item. Serialized whole as a `memories.jsonl` line; replay is last-wins by `id`, so an update appends a full record with a bumped `revision` and a delete appends a tombstoned record (`invalid_at` set) — history is never destroyed, only superseded.

    • confidenceone ofrequired

      How a memory entered the store.

      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0

memory::hook::pre-generate

Function

Internal: target of the harness::hook::on-pre-generate observer — injects the session bank's rules into the system prompt and its pinned and recalled memories as one appended message. Never denies.

Request
  • generateany of
    any of (2)
    Variant 1
    • messagesunknown

      Transcript messages as assembled so far — the window this step sends, persisted notices (earlier rules updates included) replayed in place (schema-free: shapes belong to the router).

    • system_promptstring
    Variant 2
    valuenull
  • metadataunknown

    Turn metadata (`harness::send` options.metadata); `memory_bank` here overrides the session-level selection for this turn.

  • parentunknown

    The turn's parent as `harness::on-turn-completed` will report it ([`TurnCompletedInput`]). Absent on a top-level turn, and on a harness that predates it: the session record alone then decides the header.

  • parent_session_idstring
  • recall_contextunknown

    Delivery context the harness attaches to this hook call. Absent on a harness that predates it: recall then reads the last user message. Its `extraction_history` is imported, then dropped before the hook runs.

  • session_idstring
  • stepinteger· uint64min 0

    Step within the turn; 0 is the step that opens it.

  • turn_idstring

    The turn this step belongs to; its bank is recorded under it.

Response
  • annotationsobject
  • decisionstringrequired
  • mutationsany of
    any of (2)
    Variant 1
    • append_messagesunknown[]required
    • system_promptstring
    Variant 2
    valuenull

memory::list

Function

List a bank's memories page by page, newest first. `include_superseded` shows history too.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • include_supersededboolean

    Include superseded/tombstoned records (the history view).

  • limitinteger· uintmin 0

    Page size, default 50, max 500.

  • offsetinteger· uintmin 0
  • tagstring

    Only memories carrying this tag.

Response
  • memoriesobject[]required
    • confidenceone ofrequired

      How a memory entered the store.

      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0
  • totalinteger· uintrequiredmin 0

memory::on-bank-changed

Function

Called when a memory bank is created or trashed, or its rules change. Returns the event: { event_type: created | trashed | rules-changed, bank }. Observe it; filter on input.bank or input.event_type.

Request
  • bankstringrequired
  • event_typestringrequired

    `created`, `trashed` or `rules-changed`.

Response
  • bankstringrequired
  • event_typestringrequired

    `created`, `trashed` or `rules-changed`.

memory::on-config-change

Function

Internal: hot-reload memory from the authoritative configuration when it changes — reopens the store on a data_dir change and swaps the per-call tuning snapshot otherwise.

Request
  • idstring

    Configuration id that changed (advisory; the handler re-fetches).

Response
  • okbooleanrequired

memory::on-item-changed

Function

Called when a memory is created, updated, superseded, or deleted in a memory bank. Returns the event: { event_type, bank, memory, reason? } (reason on consolidation changes, and `redacted: <labels>` when secrets or invisible characters were removed on save/update). Observe it for console/live views; filter on input.bank or input.event_type.

Request
  • bankstringrequired

    The bank the memory lives in.

  • event_typestringrequiredenum created, updated, superseded, deleted

    Memory event kinds carried in `event_type`.

  • memoryall ofrequired

    The memory as stored after the change (a tombstone for `deleted`).

    all of (1)
    Variant 1
    • confidenceone ofrequired

      How a memory entered the store.

      Show 3 nested
      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      Show 2 nested
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0
  • reasonstring

    Why the change happened: `memory::supersede`'s reason, or `redacted: <labels>` when a save or update removed secrets or invisible characters.

Response
  • bankstringrequired

    The bank the memory lives in.

  • event_typestringrequiredenum created, updated, superseded, deleted

    Memory event kinds carried in `event_type`.

  • memoryall ofrequired

    The memory as stored after the change (a tombstone for `deleted`).

    all of (1)
    Variant 1
    • confidenceone ofrequired

      How a memory entered the store.

      Show 3 nested
      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      Show 2 nested
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0
  • reasonstring

    Why the change happened: `memory::supersede`'s reason, or `redacted: <labels>` when a save or update removed secrets or invisible characters.

memory::on-session-deleted

Function

Internal: target of the session::on-deleted observer — drops the session's extraction cursor and state. A direct call is refused.

Request
  • activation_idstringrequired
  • callerany of
    any of (2)
    Variant 1
    • function_idstring

      The handler the call was made from; absent for a top-level call.

    • invocation_idstring
    • parentany of

      The caller of that handler, one level only.

      Show 2 nested
      any of (2)
      Variant 1
      • function_idstring
      • invocation_idstring
      • worker_idstring
      • worker_namestring
      Variant 2
      valuenull
    • worker_idstring
    • worker_namestring
    Variant 2
    valuenull
  • duration_msnumber· doublerequired
  • errorany of
    any of (2)
    Variant 1
    • codestringrequired
    • messagestringrequired
    Variant 2
    valuenull
  • function_idstringrequired
  • inputunknown
  • invocation_idstringrequired
  • metadataunknown
  • namespacestring
  • observer_idstringrequired
  • outputany of
    any of (2)
    Variant 1
    • session_idstring
    Variant 2
    valuenull
  • started_at_msinteger· uint64requiredmin 0
  • statusstringrequiredenum success, error
Response
  • okbooleanrequired

memory::on-turn-completed

Function

Internal: target of the harness::on-turn-completed observer — enqueues one durable extraction job (a single router::complete call) for the finished turn; inline fallback without a queue. A direct call is refused.

Request
  • activation_idstringrequired
  • callerany of
    any of (2)
    Variant 1
    • function_idstring

      The handler the call was made from; absent for a top-level call.

    • invocation_idstring
    • parentany of

      The caller of that handler, one level only.

      Show 2 nested
      any of (2)
      Variant 1
      • function_idstring
      • invocation_idstring
      • worker_idstring
      • worker_namestring
      Variant 2
      valuenull
    • worker_idstring
    • worker_namestring
    Variant 2
    valuenull
  • duration_msnumber· doublerequired
  • errorany of
    any of (2)
    Variant 1
    • codestringrequired
    • messagestringrequired
    Variant 2
    valuenull
  • function_idstringrequired
  • inputunknown
  • invocation_idstringrequired
  • metadataunknown
  • namespacestring
  • observer_idstringrequired
  • outputany of
    any of (2)
    Variant 1
    • parentunknown

      Set on a sub-agent's turn (its live parent link).

    • parent_session_idstring

      Set on a parentless spawn's turn (its display parent).

    • session_idstring
    • turn_idstring
    Variant 2
    valuenull
  • started_at_msinteger· uint64requiredmin 0
  • statusstringrequiredenum success, error
Response
  • okbooleanrequired

memory::pin

Function

Pin or unpin a memory. A pinned memory is shown on every turn that reads its bank, first in the memory message and under a cap (`pinned_limit`, `pinned_max_chars`), ranks higher in recall and is untouchable by every automatic path. Refused from inside a turn.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • idstringrequired
  • pinnedbooleanrequired
Response
  • memoryobjectrequired

    One memory item. Serialized whole as a `memories.jsonl` line; replay is last-wins by `id`, so an update appends a full record with a bumped `revision` and a delete appends a tombstoned record (`invalid_at` set) — history is never destroyed, only superseded.

    • confidenceone ofrequired

      How a memory entered the store.

      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0

memory::preview

Function

Preview the memory injection for a hypothetical chat message: the exact system-prompt memory section a new session gets (rules, budgets, truncation markers; running sessions receive changes as an appended update), the memories the turn would be handed (past the relevance cut and token budget), and the appended message verbatim. Runs the pre-generate hook's own code.

Request
  • bankstring

    Bank to preview; a directory's bank (`<name>-<6 hex>`) reads `default_bank` under it, as its turns do. Omitted: the calling session's bank with its layers (its agent profile's bank too), else the configured default.

  • querystringrequired

    The hypothetical user message (what someone would type in chat).

Response
  • bankstringrequired
  • memoriesobject[]required

    Memories the turn would be handed, in injection order: the pinned ones first (`pinned_limit`, `pinned_max_chars`), then the recalled ones past the relevance cut and token budget.

    • bankstring

      The bank holding it, when not `bank`: the default bank, read under a bank the session's directory chose, or its agent profile's bank.

    • memoryobjectrequired

      One memory item. Serialized whole as a `memories.jsonl` line; replay is last-wins by `id`, so an update appends a full record with a bumped `revision` and a delete appends a tombstoned record (`invalid_at` set) — history is never destroyed, only superseded.

      • confidenceone ofrequired

        How a memory entered the store.

        Show 3 nested
        one of (3)
        Variant 1
        valuestringenum extracted
        Variant 2
        valuestringenum inferred
        Variant 3
        valuestringenum stated
      • corroborationinteger· uint32min 0

        Times this memory was independently re-observed. Boosts recall rank.

      • created_atinteger· uint64requiredmin 0

        Milliseconds since epoch.

      • entitiesstring[]

        Entity handles used as an exact-match retrieval signal.

      • idstringrequired

        Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

      • invalid_atinteger· uint64min 0

        Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

      • pinnedboolean

        Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

      • revisioninteger· uint64min 0

        Bumped on every appended revision of this id; replay keeps the highest.

      • sourceany of
        Show 2 nested
        any of (2)
        Variant 1
        • agentstring
        • correction_reasonstring

          Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

        • entry_idstring

          The last entry of the run the memory was extracted from.

        • first_entry_idstring

          The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

        • session_idstring
        • turn_idstring

          The turn an explicit save was called from (`memory::save` inside a turn).

        Variant 2
        valuenull
      • stated_atinteger· uint64min 0

        When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

      • superseded_bystring

        Memory id that replaced this one, when superseded by content.

      • tagsstring[]

        Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

      • textstringrequired
      • updated_atinteger· uint64requiredmin 0
    • scorenumber· floatrequired

      Recall score; 0 for a pinned line, shown whatever the message asks.

  • messagestring

    The appended `<memory>` message body, verbatim. With rules it can hold only the rules reminder while `memories` is empty; absent when neither a memory fits the budget nor a reminder applies.

  • pinned_skippedstring[]required

    Pinned memories past the cap, by id: the least recently updated.

  • retrievalstringrequired

    Retrieval mode that ran (`bm25-entity` or `bm25-entity-semantic`; `none` when memories are not injected).

  • rulesinteger· uintrequiredmin 0

    Rules included, and whether any were cut by `max_rule_chars`.

  • rules_truncatedbooleanrequired
  • system_prompt_sectionstringrequired

    The memory section appended to the system prompt (ambient header + rules) as the user's own session gets it, truncation markers included; a sub-agent's or automation session's header says nothing is captured.

memory::recall

Function

Search a bank's memories relevant to a query (BM25 + entities + corroboration + recency; no LLM). The same scorer the pre-generate hook uses; the hook injects only the hits with evidence, one line per fact and the newer of a stated change, and memory::preview shows exactly what it injects. mode lexical/semantic returns one raw arm (plain BM25, or cosine).

Request
  • bankstring

    Bank to search; omitted: the calling session's bank (with the default bank's memories about the user under one its directory chose, and its agent profile's bank, as the hook reads), else the configured default.

  • include_supersededboolean

    Also rank superseded/tombstoned records (the history view).

  • limitinteger· uintmin 0

    Max memories returned (default: the configured recall_limit).

  • modeall of

    `hybrid` (default) is the fused scorer the hook uses. `lexical` and `semantic` return ONE raw arm (plain BM25, or cosine as the score) for callers that fuse arms themselves — consolidation interleaves both so a near-duplicate is never buried by the fused rank.

    all of (1)
    Variant 1
    valuestringenum hybrid, lexical, semantic
  • querystringrequired
  • tagstring

    Only rank memories carrying this tag.

Response
  • bankstringrequired
  • memoriesobject[]required
    • bankstring

      The bank holding it, when not `bank`: the default bank, read under a bank the session's directory chose, or its agent profile's bank.

    • memoryobjectrequired

      One memory item. Serialized whole as a `memories.jsonl` line; replay is last-wins by `id`, so an update appends a full record with a bumped `revision` and a delete appends a tombstoned record (`invalid_at` set) — history is never destroyed, only superseded.

      • confidenceone ofrequired

        How a memory entered the store.

        Show 3 nested
        one of (3)
        Variant 1
        valuestringenum extracted
        Variant 2
        valuestringenum inferred
        Variant 3
        valuestringenum stated
      • corroborationinteger· uint32min 0

        Times this memory was independently re-observed. Boosts recall rank.

      • created_atinteger· uint64requiredmin 0

        Milliseconds since epoch.

      • entitiesstring[]

        Entity handles used as an exact-match retrieval signal.

      • idstringrequired

        Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

      • invalid_atinteger· uint64min 0

        Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

      • pinnedboolean

        Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

      • revisioninteger· uint64min 0

        Bumped on every appended revision of this id; replay keeps the highest.

      • sourceany of
        Show 2 nested
        any of (2)
        Variant 1
        • agentstring
        • correction_reasonstring

          Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

        • entry_idstring

          The last entry of the run the memory was extracted from.

        • first_entry_idstring

          The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

        • session_idstring
        • turn_idstring

          The turn an explicit save was called from (`memory::save` inside a turn).

        Variant 2
        valuenull
      • stated_atinteger· uint64min 0

        When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

      • superseded_bystring

        Memory id that replaced this one, when superseded by content.

      • tagsstring[]

        Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

      • textstringrequired
      • updated_atinteger· uint64requiredmin 0
    • scorenumber· floatrequired
  • retrievalstringrequired

    Retrieval mode actually used — degradation is explicit, never silent. `hybrid`: `bm25-entity`, or `bm25-entity-semantic` when the query was embedded through `router::embed`. `lexical`: `lexical`. `semantic`: `semantic`, or `semantic-unavailable` (empty result — NOT "no matches") when the query could not be embedded. A label with semantic does not say every memory has a vector: see `vector_coverage`.

  • vector_coverageany of

    How much of `bank` the semantic signal could reach. Present when the query was embedded and `bank` exists, so never in `lexical` mode. `covered < live` means some live memories have no vector in the query's model yet (backfill or a re-embed is still running), and the semantic arm cannot find them; `retrieval` does not change.

    any of (2)
    Variant 1
    • coveredinteger· uintrequiredmin 0
    • liveinteger· uintrequiredmin 0
    Variant 2
    valuenull

memory::reload

Function

Drop all in-RAM state and reload every bank from disk — the recovery hatch after editing bank files by hand.

Request
Empty object
Response
  • banksinteger· uintrequiredmin 0
  • okbooleanrequired

memory::rest

Function

Internal: target of the memory REST routes, the http::on-request observers with args { method: POST, path: /memory/... }. Receives the HttpRequest, runs the memory::* function the route's path names with the request's JSON body, and returns the HttpResponse { status_code, body }: 200 with the function's result, or 400/403/404/500/503 with { error: { code, message } }.

Request
  • bodyunknown

    The request body parsed as JSON; `null` when it is empty or not JSON.

  • pathstringrequired

    The matched route's path: `/memory/...`, the function id with `::` as `/`.

Response
  • bodyunknownrequired
  • status_codeinteger· uint16requiredmin 0

memory::rule::list

Function

List a bank's rules (markdown, injected whole into the system prompt on every turn). Stored as plain files under the bank's rules/ folder; editing them by hand is equivalent. Content is returned redacted, as it is injected.

Request
  • bankstring

    Bank whose rules to list; omitted: the calling session's bank, else the configured default.

Response
  • bankstringrequired
  • rulesobject[]required
    • contentstringrequired
    • namestringrequired
    • updated_atinteger· uint64requiredmin 0

      Milliseconds since epoch (file mtime).

memory::rule::set

Function

Create or replace one rule (atomic write; empty content removes it). With `expected`, the write is refused as `rule_changed` when the rule no longer holds that content. Rules are plain markdown files under the bank's rules/ folder.

Request
  • bankstring

    Bank to write into; omitted: the calling session's bank, else the configured default. Created on first use.

  • contentstringrequired

    Markdown content. Empty removes the rule.

  • expectedstring

    The rule's content as the caller last read it (`memory::rule::list`). The write is refused with `rule_changed` when the rule holds anything else by then. Empty: the rule must not exist yet. Omitted: replace without checking.

  • namestringrequired

    Rule name, `[a-z0-9][a-z0-9_-]{0,63}` (it becomes `<name>.md`).

Response
  • existsbooleanrequired

    False when the empty content removed the rule.

  • okbooleanrequired

memory::save

Function

Save one memory explicitly. Content-fingerprinted: re-saving the same text reinforces the existing memory instead of duplicating it. A text a newer memory superseded is refused with `memory_retired`, naming that memory. Called from a turn it is the agent's note: 3 to 500 characters, in the turn's own bank, at most `max_memories_per_turn` new notes per turn, with that session and turn as its source; a pin, another bank, the `user` entity and the `demoted-rule` tag are refused there, and so is a save from an automation or test session. From a turn a repeat adds no corroboration: it restates the turn's own note and leaves any other memory as it is. Needed where the `# Memory` header asks for it (a sub-agent, extraction off): save what a later session would need.

Request
  • bankstring

    Target bank; omitted: the calling session's bank, else the configured default. From a turn only the turn's own bank.

  • entitiesstring[]

    Entity handles (people/projects/tools) used as a retrieval signal. None into the default bank from outside a turn (the memory page, the CLI): `user`, read under every repository's bank. From a turn `user` is refused.

  • pinnedboolean

    Refused from a turn.

  • session_idstring

    Provenance session for a save made outside a turn on behalf of a conversation. A save from a turn records that turn's session and turn id instead.

  • tagsstring[]

    Topical labels for filtering within the bank (organization, not ranking).

  • textstringrequired

    The memory, one self-contained sentence.

Response
  • createdbooleanrequired

    False when the text fingerprint matched an existing memory (it was reinforced instead, or, from a turn, left as it was).

  • memoryobjectrequired

    One memory item. Serialized whole as a `memories.jsonl` line; replay is last-wins by `id`, so an update appends a full record with a bumped `revision` and a delete appends a tombstoned record (`invalid_at` set) — history is never destroyed, only superseded.

    • confidenceone ofrequired

      How a memory entered the store.

      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0

memory::supersede

Function

Retire one memory in favor of another: tombstone with a superseded_by pointer, never a plain delete. The consolidation seam; pinned memories cannot be superseded. reinforce makes it a merge (the non-pinned survivor absorbs the retired record's observations); reason is carried on the memory::on-item-changed events.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • expected_memoryunknown

    Optional proof-bound snapshot of the loser; compared under the same storage lock as the winner snapshot and both writes.

  • expected_superseded_byunknown

    Optional proof-bound snapshot of the winner. Legacy callers may omit both.

  • idstringrequired

    Memory to retire.

  • reasonstring

    Why — carried on the `memory::on-item-changed` events this call emits (not persisted on the record). Trimmed, capped at 500 chars.

  • reinforceboolean

    Merge semantics: the survivor absorbs the retired record's observations (corroboration += retired + 1) in the same call. A pinned survivor is never written. Default false (a state change: the new record replaces the old, nothing to absorb).

  • superseded_bystringrequired

    Live memory that replaces it.

Response
  • memoryall ofrequired

    The retired record.

    all of (1)
    Variant 1
    • confidenceone ofrequired

      How a memory entered the store.

      Show 3 nested
      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      Show 2 nested
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0
  • reinforcedbooleanrequired

    True when the survivor was reinforced (`reinforce` asked and the survivor is not pinned).

  • survivorany of

    Post-commit survivor snapshot for a subsequent proof-bound absorption.

    any of (2)
    Variant 1
    • confidenceone ofrequired

      How a memory entered the store.

      Show 3 nested
      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      Show 2 nested
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0
    Variant 2
    valuenull

memory::tags

Function

List the tags across a bank's live memories with usage counts, most used first — the filter source for tag-scoped list/recall.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

Response
  • bankstringrequired
  • tagsobject[]required
    • countinteger· uintrequiredmin 0
    • tagstringrequired

memory::transcript

Function

Internal: the source transcript of one live memory, as redacted lines, a long line as its head and tail (its recorded span, or the turn it was saved from). `missing` says why there is none.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • idstringrequired
Response
  • linesobject[]required
    • datestringrequired

      The day the line was sent, `YYYY-MM-DD Weekday` in local time.

    • rolestringrequired

      `user`, `assistant`, or `notice` (written by the harness or a bot).

    • textstringrequired
  • missingstring

    Why there are no lines: `not_found`, `edited`, `no_span`, `session_not_found`, `entry_not_found`, `off_path`, `turn_not_found`, `too_long`, `unreadable` or `empty`.

memory::ui-content

Function

Serve the memory worker's injected console UI assets (the target of its ade::ui::asset observers; the console calls it through each asset's observer with {path}).

Request
  • pathstringrequired

    The asset path from the observer's args (e.g. `state/page.js`).

Response
  • contentstringrequired

    The asset source, verbatim.

  • content_typestringrequired

    MIME type the console should serve the asset with.

memory::update

Function

Revise a memory's text, entities, or pin flag in place (same id, bumped revision; the prior revision stays in the on-disk log). A retired memory is refused with `memory_retired`, naming the memory that replaced it. From a turn: only a note saved from a turn, in the turn's own bank, never a pinned one, never the pin flag.

Request
  • bankstring

    Bank; omitted: the calling session's bank, else the configured default.

  • entitiesstring[]
  • expected_memoryunknown

    Optional snapshot of the memory as the caller read it (a full record or a revision-bound projection): the write is refused when the memory changed since.

  • idstringrequired
  • pinnedboolean
  • reasonstring

    Why, carried on the `memory::on-item-changed` event this call emits (not persisted on the record). Secrets redacted, trimmed, capped at 500 chars.

  • tagsstring[]

    Replace the tag set (empty list clears).

  • textstring
Response
  • memoryobjectrequired

    One memory item. Serialized whole as a `memories.jsonl` line; replay is last-wins by `id`, so an update appends a full record with a bumped `revision` and a delete appends a tombstoned record (`invalid_at` set) — history is never destroyed, only superseded.

    • confidenceone ofrequired

      How a memory entered the store.

      one of (3)
      Variant 1
      valuestringenum extracted
      Variant 2
      valuestringenum inferred
      Variant 3
      valuestringenum stated
    • corroborationinteger· uint32min 0

      Times this memory was independently re-observed. Boosts recall rank.

    • created_atinteger· uint64requiredmin 0

      Milliseconds since epoch.

    • entitiesstring[]

      Entity handles used as an exact-match retrieval signal.

    • idstringrequired

      Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.

    • invalid_atinteger· uint64min 0

      Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.

    • pinnedboolean

      Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.

    • revisioninteger· uint64min 0

      Bumped on every appended revision of this id; replay keeps the highest.

    • sourceany of
      any of (2)
      Variant 1
      • agentstring
      • correction_reasonstring

        Set on a record written by `memory::correct`: why the old text was replaced, quoting the source conversation.

      • entry_idstring

        The last entry of the run the memory was extracted from.

      • first_entry_idstring

        The first entry of that run: with `entry_id` it bounds the span of transcript the memory came from. Absent on records written before spans were kept.

      • session_idstring
      • turn_idstring

        The turn an explicit save was called from (`memory::save` inside a turn).

      Variant 2
      valuenull
    • stated_atinteger· uint64min 0

      When the fact was last STATED (said, re-observed, text edited): an extracted memory takes its message's time, not the pass's. Unlike `updated_at`, pin/tag/entity edits never bump it, so recency, the shown date and "which statement is current" go by it. Legacy records load as None.

    • superseded_bystring

      Memory id that replaced this one, when superseded by content.

    • tagsstring[]

      Topical labels for filtering WITHIN a bank ("iii", "workers", "billing") — organization, not ranking. Normalized lowercase, capped like entities. Old records without the field load as untagged.

    • textstringrequired
    • updated_atinteger· uint64requiredmin 0

Search the registry

Find workers, kits and executables, or jump to a page.