Skip to main content

Module memory

Module memory 

Source
Expand description

The engine: data model state, verbs, journaling and replay (/03, /05).

All state lives in the flat structures of plugmem-arena; every mutating verb journals itself through the caller’s Storage and is replayed through the same internal apply_* path on open — the journal’s ids are authoritative, so replay is deterministic and idempotent over a reapplied tail.

The engine carries the structural sources (facts, entities, edges, tags, BM25, temporal) and — when Config::dim > 0 — the vector layer: quantized vectors in a flat VecPool, searched as a fourth recall source and used by similar-detection. maintain (compaction) still lands separately.

Modules§

source
Source bits of RecalledFact::sources.

Structs§

FactView
A read view of one fact.
LinkInput
Input of link.
MaintainReport
Report of a maintain pass.
Memory
The memory engine. See the module docs for staging.
OpenReport
Report of an open: what the journal replay found.
RecallQuery
A recall request. Default-like construction via RecallQuery::text plus field overrides.
RecallResult
A recall response. Reusable: pass to Memory::recall_into repeatedly and the buffers are recycled.
RecallScratch
Reusable recall scratch — caller-owned, so Memory::recall and Memory::recall_into take &self: many readers can recall the same engine at once, each threading its own scratch (the host wraps one per thread). Carries every buffer a recall mutates — the query-side term/score vectors, the fusion map, and its own tokenizer and name-normalization buffer — so a recall never touches the engine’s write-side scratches. Reused across calls it upholds the zero-alloc invariant.
RecalledEdge
One edge the graph source walked (: agents want the relations, not only the facts).
RecalledFact
One recalled fact.
RememberInput
Input of remember and revise.
RememberOutcome
Result of remember/revise.
Similar
One similar-fact hint.
Stats
Engine size counters. Every field is an O(1) read; the struct is #[non_exhaustive] so later stages (database identity markers, HNSW state) can extend it without a breaking change.

Enums§

FactFault
The per-fact content problem Memory::faulty_facts attributes to a fact — the salvage predicate recover uses. It mirrors the content checks Memory::verify runs, split out per fact so a caller can drop the individual bad records instead of failing the whole image.
SimilarReason
Why a fact was flagged as similar.