Components
parsers.pyparses raw history files into normalized turns.store.pyowns SQLite schema, writes, and retrieval.embeddings.pyprovides local hash or OpenAI embedding providers.search.pymerges lexical + semantic rankings.cli.pyexposesinit,index,search,recall,stats.
Storage model
promptstable: normalized turns + metadataprompts_ftsvirtual table: FTS5 index for keyword matchingprompt_embeddingstable: serialized vectorsindex_runstable: indexing run audit trail
Retrieval model
- Lexical candidate set via FTS5
- Semantic candidate set via sqlite-vec or fallback cosine
- Weighted hybrid score merge
recallformat adds next assistant turn as “What worked”