Skip to main content

Module sqlite

Module sqlite 

Source
Expand description

The one loader: build scorable Memory items from a MemoryWhale SQLite DB.

Both surfaces call this — the desktop app (documents + command_runs + agent_turns) and the CLI (sessions + command_runs + bookmarks). The two databases have different tables, so every source is queried independently and a missing table is treated as zero rows (not an error). That keeps a single loader honest across both schemas instead of two copies drifting apart.

Ids are namespaced per source so explain(id) stays stable and unique across sources; decode_id recovers the source + original row id for display (e.g. mw replay <id> / mw show <id>).

Enums§

Source
Which store a memory came from, plus its original per-table row id.

Functions§

decode_id
Recover the source and original row id from a namespaced memory id.
load_memories
Load everything MemoryWhale remembers as scorable memories, tolerant of any source table being absent (so it serves both the desktop and CLI schemas).