Ship the Notes Brain
Wire chunking, retrieval, the cited prompt, citation verification, and the no-match fallback into one command-line tool and ship it.
Part of: Personal Notes Brain
Every piece exists now: chunking, embedding, ranked retrieval with a threshold, a citation-aware prompt, citation extraction and verification, a graceful no-match fallback, and dedup to keep the index lean. This lesson wires them into one command-line tool and ships it. The end-to-end flow Read it top to bottom and you are reading the whole project: retrieve, gate on confidence, prompt with numbered sources, call the model, extract and verify citations, hand back an answer plus a clean footnote list. If verification fails, hand back an empty footnote list, which beats showing a broken citation. Cache the index, don't rebuild it every run Embedding every note on every question would be slow and wasteful. Real tools embed once, save the vectors with a hash of each chunk's text as the cache key, and re-embed only the chunks whose text changed since last time. That one habit is what turns a tool that runs once as a demo into one that runs instantly and cheaply every day on a growing vault. Wrap it as a CLI Now python notes brain.py "what did I decide about the budget?" reads your real vault and answers with footnotes, or admits it found nothing. What "shipped" means here It runs from a
Challenge: Assemble the Final Report