Expand description
SQLite storage for Troupekit. One SqliteStore over one file implements
CheckpointStore, MemoryLog, BlobStore, JobQueue and UsageLedger,
so a run survives a process kill and resumes from its last saved step.
SqliteStore::vectors opens named vector indexes in the same file.
Structs§
- Hnsw
Params - Build and search settings of an HNSW index.
Fields are private; start from
Defaultand use thewith_*setters.new_indexvalidates the values. - Open
Report - How often the index behind a handle was loaded from the file and how often its pages were refused and rebuilt from vectors, counted since the store opened. Shared by every handle of the same name.
- Sqlite
Store - Durable Troupekit store over one SQLite file in WAL mode. Cheap to clone; clones share one connection. Every call runs on tokio’s blocking pool, so it needs a tokio runtime. A caller that stops waiting does not stop the call: it runs to its commit or rollback.
- Sqlite
Store Builder - Settings for
SqliteStore, each with a safe default: full durability, the system clock, 64 MiB caps on one state and one blob, 100 000 history steps, a 5 000 ms busy timeout and secure delete on.openvalidates them and opens the file. - Sqlite
Vectors - A named vector index in the store file, with text, metadata and a
keyword index kept in the same transactions. Cheap to clone; clones
and other handles of the same name share one in-memory index. Every
call checks the dimension and the bounds of its
VectorSettings. - Vector
Settings - Settings of one named vector index.
dimsis required; the rest has safe defaults: brute force, f32 in memory, 1 MiB of text per chunk, 64 meta pairs of at most 256 and 4 096 bytes, 10 000 records per call, keyword queries of 32 terms and 2 000 chars. Built withnew(dims).
Enums§
- Durability
- How hard a commit is pushed to disk, per connection.
Fullsurvives power loss: every commit usesfullfsync, which Apple platforms need.Normalis faster and can lose the last commits on power loss, never on a process kill; WAL checkpoints still usefullfsync, so no corruption. - Index
Kind - Which index to build. Default
BruteForce, which is exact.Hnswis approximate and faster on large sets. Passed tonew_index. - Quantization
- In-memory format of stored vectors. Queries stay f32.
F32is exact,F16halves memory,I8quarters it with one f32 scale per vector. DefaultF32.
Constants§
- SCHEMA_
VERSION - The schema version this troupekit writes and reads up to. It equals the number of migration steps. A file at a higher version is refused, a file at a lower one is migrated on open.