Skip to main content

Crate khive_pack_memory

Crate khive_pack_memory 

Source
Expand description

Memory pack — memory.remember and memory.recall verbs with decay-aware ranking.

Modules§

config
Recall configuration types — scoring weights, decay models, and FTS gather options.
handlers
Memory verb handlers — split by concern.
recall_feedback
Recall-domain posterior updates — direct update functions replacing fold-based replay.
rerank
Weighted feature-combination reranking for memory recall candidates.
scoring
Composite memory scoring — ported from the archived internal service (v1 archive).
tunable
Brain-tunable parameter surface for the memory pack’s recall scoring pipeline.

Structs§

MemoryPack
Pack implementation providing memory.remember and memory.recall verbs.

Functions§

bump_memory_ann_epoch
Bump the durable memory-ANN corpus epoch (#812 review REQUEST CHANGES HIGH). kkernel reindex mutates note vectors and deletes the persisted Vamana snapshot directly, out of process from any running khive daemon — its in-memory write-generation counter (ann::bump_generation) is simply unreachable from a separate process. Call this after invalidating the snapshot so a warm daemon sharing the same database file has a durable signal to observe on its next amortized freshness check (ann::maybe_check_durable_epoch, sampled from the recall path) and schedules a rebuild instead of serving pre-reindex vectors indefinitely.
ensure_ann_epoch_schema
Ensure the memory_ann_epoch table exists on rt (idempotent, #812 review REQUEST CHANGES MEDIUM — pack schema contract). Declared via MemoryPack::SCHEMA_PLAN for daemon boot (server.rs/serve.rs apply every loaded pack’s schema plan up front), but kkernel reindex runs directly against a raw KhiveRuntime without ever booting a pack registry — it calls this explicitly, once, before its first bump_memory_ann_epoch, so a reindex against a brand-new database (no daemon ever started) doesn’t fail before this table exists.