feat(memory): ask the vault a question in plain words - #67
Conversation
The rewrite that turns "What do we still need to buy for the camping trip?" into keywords lived in the archivist, so a family question answered in chat and returned nothing from `stack memory search`. It now lives with the vault it searches, in memory.lib, and takes the caller's LLM rather than opening one. The archivist keeps what is its own: the `?` trigger, the Whoosh rendering for Paperless, and the "Searched for: ..." line. Refs FAM-21
|
Verification. Unit
Rig, against the Simpsons demo instance with a real model:
One judgement call to review. Noticed, not fixed here. Rewrite keywords are matched as a literal regex with no stemming, so |
`stack memory search --nl "what do we still need for the camping trip"`
turns the question into the words that are actually on disk, searches
for those, and prints what it searched for so a bad guess is visible:
Searched for: Zelt, Schlafsack
The default is unchanged and still a regex: no model, no container,
same speed. A single word never calls a model even with --nl, and when
no model is reachable the query is searched literally instead of
failing. Stacky now passes the flag, so its own searches stop coming
back empty on every question.
Refs FAM-21
The rewrite left sampling to the model, so asking twice picked different keywords and returned different results. One run of "what do we still need to buy for the camping trip" searched Travel, Holiday, Shopping and surfaced a vaccination record; the next run found the camping notes. Picking words a document already contains is a lookup, not a creative act, so it now decodes greedily, like the wiki generator does for the same reason. Refs FAM-21
Asked "what do we still need to buy for the camping trip", the rewrite answered Travel, Shopping, Receipt. All three are real topic names from the family's ontology, none of them appear in any camping note, and the search came back with a Kwik-E-Mart receipt. Handed a list of categories, the model was answering from the list. The question's own subject now comes first, and the topic list is context for spelling and language rather than a menu. Same question now searches camping, trip, shopping. Refs FAM-21
|
Rig evidence, all three surfaces, on the demo instance at CLI, the question that started this Agent. One The same string through the CLI, both ways: Archivist. Unchanged path, and better from the shared rewrite: the same question cited one camping note before, four now, including one it had been silently missing. The two rig-found defects. First Cost. Container exec plus imports 0.69s, the rewrite 3.84s on Qwen3.6-35B, vault walk ~0.1s. So Other scenarios. German question returns Checks: 1922 stacklet tests + 487 framework, |
The question-to-keywords rewrite moves out of the archivist into
memory.lib, where the vault is, and takes the caller's LLM rather than opening one.stack memory search --nlreaches it through the bot-runner the same waystack memory wikidoes, so a sentence finally finds something from a terminal and from Stacky, not just in chat.The default stays a regex: no model, no container, same speed. A single word never calls a model even with
--nl, and every failure falls back to searching the query literally. Chat keeps inferring from a trailing?, because here?is a quantifier.Two defects the rig turned up along the way: the rewrite sampled, so one question gave different answers run to run, and it answered from the ontology's category names instead of words documents actually contain. Both fixed, both shared with chat.
Refs FAM-21