Expand description
The storage backend abstraction — storage::MemoryStore and the
default, file-backed storage::NativeStore. Implement MemoryStore to
run the wedge over a different backend (e.g. an in-memory one for WASM).
Storage backend abstraction for crate::service::MemoryService.
The wedge orchestration (remember/recall/relate/forget/why/fusion) is
written once, generic over MemoryStore, so it runs unchanged over any
backend: the native, file-backed NativeStore (the default — nothing
changes for existing callers), or an in-memory backend such as the one
velesdb-wasm provides for the browser (no filesystem, no persistence
feature).
Structs§
- Native
Store - The default
MemoryStore: the native, file-backed engine (velesdb-core’sDatabase/AgentMemory, requiring thepersistencefeature). Existing callers ofMemoryService::opensee no change — this is exactly what they already ran. - RawListed
Fact - One fact as
FactStore::listhands it to the service layer: content split out, everything else — reserved keys and scaffolding markers included — still inpayloadso the service can apply its visibility policy exactly once for every backend.
Constants§
- AUTO_
DATE_ FIELD - Reserved metadata key
remember/remember_with_ttlauto-stamp with today’s date (aYYYYMMDDinteger, [crate::clock::today_ymd]) whenever the caller didn’t already set it — seecrate::service::MemoryService::remember_with_ttlfor the full contract. A deliberate, documented exception to every other_veles_-namespaced key: [is_reserved_key] still names it (so it can never be confused with an arbitrary caller field), but unlike a true system key — - CTX_
EVENT_ FIELD - Marks a compilation event recorded for
context_savings. - CTX_
SOURCE_ FIELD - Marks a stored compilation source, served back by
retrieve_context_source. - CTX_
WORKING_ FIELD - Marks a saved working context, served back by
load_working_context. - CTX_
WORKING_ INDEX_ FIELD - Marks a project’s working-context index, read by
list_working_contexts. - HUB_
FIELD - Marks an entity hub minted by
remember_extracted— graph scaffolding, never a fact the caller stored. - INTERNAL_
MARKER_ FIELDS - Every marker that identifies a stored fact as internal scaffolding rather than a caller memory. Facts of these five classes live in the same collection as caller facts and are written by exactly one path each; the markers are declared here, and imported by those paths, so the write and the exclusion cannot drift apart.
Traits§
- Column
Store - Structured columnar predicates fused with vector recall — one method
today, but the facet where field enumeration and richer predicates will
land (
ColumnFilter’s op set is alreadynon_exhaustive). - Fact
Store - Fact storage: write, by-id lookup, deletion, corpus size — the core
facet every backend must provide. The other facets (
RecallStore,GraphStore,ColumnStore) build on stored facts; a partial backend, or a test double, implements only the facets it serves and the compiler refuses calls to the rest (#1959). - Graph
Store - Typed graph edges between facts — the facet behind
relate/whyand the hub walks. A backend without a graph simply does not implement it, and the service methods that need it stop existing for that backend at compile time. - Memory
Store - The full storage surface
crate::service::MemoryServicehistorically required: every facet at once. Kept as a supertrait alias so existing callers and bounds (S: MemoryStore) compile unchanged; the blanket impl makes it automatic for any backend that implements the facets, so there is nothing extra to implement and nothing to forget. - Recall
Store - Vector recall over stored facts — the surface every
crate::service::MemoryService::recall/searchcall goes through.FactStoreis a supertrait because these queries return the content of the facts they rank; a backend cannot rank what it cannot store.
Functions§
- is_
internal_ scaffolding - Whether a raw payload belongs to one of the five internal classes.
- strip_
reserved_ keys - Drop reserved system keys from a raw payload, and collapse an
empty-after-stripping map to
None— the caller-facing shape everyRecollection::metadatais built from.pubbecause aMemoryStorebackend that assemblesRecollections itself (query_columnar) must apply the same stripping the service layer applies on every other recall path, or reserved keys leak to callers on that one path only. - strip_
reserved_ keys_ ref strip_reserved_keysover a borrowed payload: clones only the surviving non-reserved entries. Use this when the payload isn’t already owned — cloning the whole map first would deep-copy the reservedcontentvalue (the full fact text) per hit, only to discard it.- validate_
column_ filter - Validate one
recall_wherecolumn filter: a plain, non-reserved identifier field name and a scalar (string/number/boolean) value.puband shared so everyMemoryStorebackend enforces the same documented contract — the field-name rule keeps a filter safe to place into query text (NativeStorebuildsVelesQL; values are always bound parameters), and rejects the reserved system columns (content,_veles_*) regardless of backend; the scalar rule turns what would be an opaque engine error into a clear client-input error.