Expand description
The SQLite implementation of the crate::stores contract: facts with
privacy and channel provenance, episodes, the claim graph, structured
personal memory, people and learned habits.
SqliteMemory works on a pool the host opens, so memory can share one
database file (and its encryption) with the host’s other tables.
Structs§
- Exact
Channel Ids - Exact channel-id comparison, no channel derived from session ids.
- Export
File - One file of a readable export.
- Fold
Candidate - An active fact as the fold planner sees it.
- Memory
Claim Record - Memory
Retention - One pass of retention over a database holding the memory tables.
- Memory
Retention Policy - How long each kind of memory is kept, in days. Zero keeps it forever.
- Memory
Retention Stats - Rows removed by one pass.
- Planned
Fold - One fact to retire into the fact that keeps its knowledge.
- Sqlite
Memory - Long-term memory in SQLite.
Enums§
- Fold
Rule - Which rule found a fold.
Constants§
- ONE_
VALUE_ MIN_ SIMILARITY - Full-fact similarity at which a value of two or more words, identical under another key, is the same fact. Measured on a live store of 4,747 facts: from here up pairs are reworded keys for one value; below it different things start to share a value (two sites on one platform).
- ONE_
WORD_ VALUE_ MIN_ SIMILARITY - The same for a one-word value (
ddev,Rust), which also needs a key word in common: one word is shared by many unrelated attributes. - OWNER_
QUOTED_ SOURCE - Source of a per-turn fact the owner asserted, with a verbatim quote from their own message checked against it. Not owner-authored (the quote proves the words, not that the value follows from them, nor who wrote pasted text), but above anything a background extractor inferred.
Traits§
- Channel
Ids - How the host’s channel identifiers relate. The defaults suit a host whose ids are stable and carry no channel in the session id.
Functions§
- build_
fact_ embedding_ text - Build a natural-language embedding text for a fact.
- fact_
category_ is_ personal - Categories whose keys name a person or their attributes, where a key that differs by an entity token must stay separate even at high similarity.
- fact_
source_ rank - How close a fact’s source is to the owner’s own words: 2 stated explicitly, 1 quoted from the owner’s message, 0 inferred. A write may replace a different value only at equal or higher rank, and a restatement never lowers a row’s rank.
- facts_
are_ restatements - Whether two active facts in one category are the same knowledge.
- facts_
hold_ one_ value - Whether two active facts hold one piece of knowledge under different
keys: the same normalized value, similar enough as whole facts, and, when
either is about a person, keys naming the same attribute (
pet_nameanddaughter_nameare bothMia,birth_placeandhometownone city). - is_
owner_ authored_ fact_ source - Sources that record the owner’s own words. Background extractors can never overwrite these, only restate or add beside them.
- keys_
name_ same_ attribute - Whether two keys name one attribute (
editor/preferred_editor,oauth_expiry/oauth_expiration), as opposed to two attributes that share a word (dog_name_old/dog_name_new,age/child_age). - migrate
- Create or upgrade the memory tables in
pool. - plan_
folds - Plan every fold in
candidates. - project_
message_ span - Index a user message from the host’s log as a searchable span. The host
passes only messages memory may learn from.
channelsderives the span’s channel from its session. - rebuild_
memory_ fts_ projections - Recreate the memory search indexes from their authoritative source tables.