Retrieve KB Answer
Steps
- Run vector + keyword hybrid search over the project KB (likely under
docs/,kb/, or the README + CONTRIBUTING). - Compute reranker confidence. If ≥
confidence_threshold, draft a reply that cites every claim by source filename + section anchor. - If below threshold, return
{reply: null, reason: "low_confidence", topics: [...]}so the next step files a ticket instead. - Never guess: if the KB doesn't cover it, that's a ticket, not a wing-it.
Output shape
{
"reply": "...", // or null
"citations": [{"source": "docs/x.md#hdr", "snippet": "..."}],
"confidence": 0.84,
"reason": null // or "low_confidence"
}
Failure modes
- Citing a doc you didn't actually retrieve.
- Suppressing low confidence so the answer ships unticketed (looks productive; produces angry follow-ups).
- Replying with the user's question rephrased — say nothing rather than hallucinating an answer.