memory::bank-changed
A memory bank was created or trashed. Payload: { event_type, bank }.
- bankstring
Only deliver events for this bank.
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.
iii call compose::add worker=memory@0.2.22Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.
A memory bank was created or trashed. Payload: { event_type, bank }.
Only deliver events for this bank.
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`.
Human description shown in listings and the console, and told to extraction as what this bank is for: it narrows what is kept.
Bank name, `[a-z0-9][a-z0-9_-]{0,63}` (it becomes a folder name).
Summary row for `memory::bank::list` and the console page.
Live memory (memory) count.
Rule (always-injected markdown) count.
False when the bank already existed (create is idempotent).
Delete a memory bank: the folder moves to the store's .trash, recoverable by hand.
Where the bank folder was moved (under the store's `.trash/`).
List every memory bank with memory/rule/pin counts.
Live memory (memory) count.
Rule (always-injected markdown) count.
Delete a memory (tombstone: sets invalid_at). It leaves recall immediately but stays on disk, readable with include_superseded.
Bank; omitted: the calling session's bank, else the configured default.
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.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
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, and whether recent extraction passes failed. Reports degraded states explicitly, not a bare process-up health.
True only when every REQUIRED check passed (the store roundtrip; the rest are reported but advisory).
Internal: queue-delivered extraction job — errors propagate so the queue retries and dead-letters instead of losing the pass.
The session's agent profile, its bank read under `bank` (`scope::Resolved::agent`).
The bank the turn was injected with. Absent: resolved when the job runs (the worker never saw the turn, or the job predates this).
The turn's directory chose `bank`: `default_bank` is read under it (`scope::Resolved::layer`).
The turn ran without memory (an invalid or deleted bank): the job only steps the cursor past it.
The turn's last user/assistant entry: the pass reads no further.
Fetch one memory by id, including superseded/tombstoned records.
Bank; omitted: the calling session's bank, else the configured default.
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.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
Internal: harness pre-generate hook — injects the session bank's rules into the system prompt and recalled memories as one appended message. Never denies.
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).
Turn metadata (`harness::send` options.metadata); `memory_bank` here overrides the session-level selection for this turn.
Step within the turn; 0 is the step that opens it.
The turn this step belongs to; its bank is recorded under it.
A memory was created, updated, superseded, or deleted in a memory bank. Payload: { event_type, bank, memory, reason? } (reason on consolidation changes, and `redacted: <labels>` when secrets or invisible characters were removed on save/update). Bind console/live views here.
Only deliver events for this bank.
List a bank's memories page by page, newest first. `include_superseded` shows history too.
Bank; omitted: the calling session's bank, else the configured default.
Include superseded/tombstoned records (the history view).
Page size, default 50, max 500.
Only memories carrying this tag.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
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.
Configuration id that changed (advisory; the handler re-fetches).
Internal: session::deleted handler — drops the session's extraction cursor.
Internal: harness turn-completed handler — enqueues one durable extraction job (a single router::complete call) for the finished turn; inline fallback without a queue.
Set on a sub-agent's turn (its live parent link).
Set on a parentless spawn's turn (its display parent).
Pin or unpin a memory. Pinned memories rank higher in recall and are untouchable by every automatic path.
Bank; omitted: the calling session's bank, else the configured default.
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.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
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.
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.
The hypothetical user message (what someone would type in chat).
Memories the turn would be handed, past the relevance cut and token budget, in injection order.
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.
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.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
Recall score.
The appended `<memory>` message body, verbatim; absent when no memory fits the budget.
Retrieval mode that ran (`bm25-entity` or `bm25-entity-semantic`; `none` when memories are not injected).
Rules included, and whether any were cut by `max_rule_chars`.
The memory section appended to the system prompt (ambient header + rules), exactly as injected — truncation markers included.
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).
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.
Also rank superseded/tombstoned records (the history view).
Max memories returned (default: the configured recall_limit).
`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.
Only rank memories carrying this tag.
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.
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.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
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.
Drop all in-RAM state and reload every bank from disk — the recovery hatch after editing bank files by hand.
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.
Bank whose rules to list; omitted: the calling session's bank, else the configured default.
Milliseconds since epoch (file mtime).
Create or replace one rule (atomic write; empty content removes it). Rules are plain markdown files under the bank's rules/ folder.
Bank to write into; omitted: the calling session's bank, else the configured default. Created on first use.
Markdown content. Empty removes the rule.
Rule name, `[a-z0-9][a-z0-9_-]{0,63}` (it becomes `<name>.md`).
False when the empty content removed the rule.
Save one memory explicitly. Content-fingerprinted: re-saving the same text reinforces the existing memory instead of duplicating it. Use when the user says `remember this`.
Target bank; omitted: the calling session's bank, else the configured default.
Entity handles (people/projects/tools) used as a retrieval signal. None into the default bank: `user`, read under every repository's bank.
Provenance session, when saved on behalf of a conversation.
Topical labels for filtering within the bank (organization, not ranking).
The memory, one self-contained sentence.
False when the text fingerprint matched an existing memory (it was reinforced instead).
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.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
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 item-changed events.
Bank; omitted: the calling session's bank, else the configured default.
Memory to retire.
Why — carried on the `memory::item-changed` events this call emits (not persisted on the record). Trimmed, capped at 500 chars.
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).
Live memory that replaces it.
The retired record.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
True when the survivor was reinforced (`reinforce` asked and the survivor is not pinned).
List the tags across a bank's live memories with usage counts, most used first — the filter source for tag-scoped list/recall.
Bank; omitted: the calling session's bank, else the configured default.
Serve the memory worker's injected console UI assets (content function for its console:script / console:style / console:module triggers).
The asset path from the trigger config (e.g. `state/page.js`).
The asset source, verbatim.
MIME type the console should serve the asset with.
Revise a memory's text, entities, or pin flag in place (same id, bumped revision; the prior revision stays in the on-disk log).
Bank; omitted: the calling session's bank, else the configured default.
Replace the tag set (empty list clears).
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.
How a memory entered the store.
Times this memory was independently re-observed. Boosts recall rank.
Milliseconds since epoch.
Entity handles used as an exact-match retrieval signal.
Content fingerprint (`fp` + FNV-1a of the normalized text), so re-ingesting the same source reinforces instead of duplicating.
Set when the memory stopped being true (superseded or deleted). The record stays on disk and remains queryable with `include_superseded: true`.
Pinned memories are never touched by any automatic path (consolidation, decay); only an explicit `memory::pin`/`memory::update` changes them.
Bumped on every appended revision of this id; replay keeps the highest.
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.
Memory id that replaced this one, when superseded by content.
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.
Find workers, kits and executables, or jump to a page.