Skip to main content

Module memory

Module memory 

Source
Expand description

memory.* (port of ultron/memory.ts NativeMemoryService and the memory dispatch of worker-services.ts).

These calls are the model’s, made on purpose; the session’s automatic memory (session-core auto_memory) uses the Rust-only MemoryService::recall_for_turn, MemoryService::retain_session_tail and MemoryService::project_digest. The journal ({version, namespace, operations}) records every prepare/propose/correct/forget/get with hashes and references, never memory text; text lives in the backend (Hindsight). memory.reflect and memory.invalidate (Rust-only) are journaled nowhere. Only propose-created documents can be read, corrected or forgotten. A correction supersedes the current claim on its document, and the local journal outranks a lagging backend index: recalled entries of a superseded claim or a forgotten document are withheld (excluded). Interrupted operations are settled on reopen and remote mutations are never replayed. A failed store write poisons the service.

Structs§

MemoryApi
memory.* as a host module; service is None in a worker without Hindsight.
MemoryError
A memory error: “Memory operation did not complete ()”. No raw backend, store or gate error is exposed. The one exception is a journal written in an unsupported format version, which reports that version (TS UnsupportedFormatVersionError) so an older Ultron never overwrites it.
MemoryService

Enums§

ErrorCode
The codes a MemoryError and a journal record’s error carry.

Constants§

BRIEF_MAX_CHARS
BRIEF_MAX_LINES
The startup brief’s budget: it opens every context, so it stays short.
OUTAGE_PAUSE
OUTAGE_PAUSE_AFTER
A memory server’s outage: after this many calls in a row without an answer (or, for automatic recall, too slow to wait for), calls stop for OUTAGE_PAUSE, so a server that is down costs a session no timeouts. One threshold for the memorantado client and automatic recall alike (session_core::auto_memory).
TOPIC_MAX_CHARS
TOPIC_MAX_LINES
A topic page’s budget.

Traits§

MemoryBackend
A Hindsight-shaped document backend. An Err whose text is a memory error code (for example “HTTP_ERROR”) reports that code; any other text is an OPERATION_ERROR.

Functions§

directory_identity
A stable, non-reversible id for a directory (projectIdentity of worker-services.ts).
handle
Serves one memory.* request as the session worker does. service is None when Hindsight is not configured.
page_budget
Whether text fits a page’s budget: the reason when it does not.
staleness
Why a memory is stale, from the quotes in its Hindsight metadata (autolith’s check, with no model call): a quoted file under root that is gone, or that no longer holds its quote (whitespace aside). None when every quote still holds, the memory quotes nothing, or a file cannot be read for another reason.
worker_gate
The worker’s gate: every recall runs; every write is kept unless it holds a secret.
worker_scope_tags
A session’s scope tags, the same for every backend: its own id, its project directory’s identity and the home directory’s identity.

Type Aliases§

Decide
judge.decide(state, questions, kind) as the session asks it: the verdict’s JSON.
MemoryGate
Decides whether a recall runs ({"retrieve", "probability"?}) and whether a write is kept ({"action": "keep" | "skip" | "sensitive", "confidence"?}).