t1-p1-04draft3–5h
Retrieval endpoint with k and a similarity threshold
requires: t1-p1-03
Spec
POST /query accepting {question, k, threshold}. Embed the question, retrieve the top-k chunks by cosine similarity, and return them raw with their scores and metadata. No generation yet.
Why this matters
Separating retrieval from generation is what makes the system debuggable. When an answer is wrong you must be able to ask "did we retrieve the right context?" without an LLM in the loop confusing the evidence.
Verify
No result yet. Run `learn verify t1-p1-04` locally, or push to trigger CI.
contract
unrun