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.
MaintenanceOptions
Options for a maintenance 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.
ReembedReport
Result of replacing every retained fact’s embedding.
RememberInput
Input of remember and revise.
RememberOutcome
Result of remember/revise.
RemoveTagReport
Result of removing one tag from every current fact.
ShardLayout
Shard counts for every arena group.
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.
TagPage
One bounded page of active tags.
TagQuery
A bounded tag-catalog query.
TagSummary
One active tag and the number of current facts carrying it.
UnlinkInput
Input of unlink.

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.
GuardedRememberOutcome
Result of Memory::remember_guarded.
MaintenanceMode
The maintenance work requested by a caller.
ReembedError
Failure from either the engine-side rewrite or the caller’s embedder.
SimilarReason
Why a fact was flagged as similar.

Constants§

DEFAULT_TAG_PAGE_LIMIT
Default number of tags returned by one page.
MAX_TAG_PAGE_LIMIT
Hard public bound for one tag page.
MAX_VECTOR_SPACE_ID_BYTES
Maximum UTF-8 byte length of a persisted embedding-space identity.