Skip to main content

Module sqlite

Module sqlite 

Source
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§

ExactChannelIds
Exact channel-id comparison, no channel derived from session ids.
ExportFile
One file of a readable export.
FoldCandidate
An active fact as the fold planner sees it.
MemoryClaimRecord
MemoryRetention
One pass of retention over a database holding the memory tables.
MemoryRetentionPolicy
How long each kind of memory is kept, in days. Zero keeps it forever.
MemoryRetentionStats
Rows removed by one pass.
PlannedFold
One fact to retire into the fact that keeps its knowledge.
SqliteMemory
Long-term memory in SQLite.

Enums§

FoldRule
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§

ChannelIds
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_name and daughter_name are both Mia, birth_place and hometown one 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. channels derives the span’s channel from its session.
rebuild_memory_fts_projections
Recreate the memory search indexes from their authoritative source tables.