Add store answer endpoint (query across a collection)#57
Conversation
Add store answer endpoint (query across a collection)
POST /v1/answer/store synthesises ONE grounded answer across a set of
documents (a store/collection), with per-document citations. It is the
map-reduce companion to the single-document tree-walk:
map — retrieval.MultiDoc fans the selection strategy across every
document_id and returns the relevant sections per document.
reduce — one LLM call reads the gathered, source-labelled evidence
([1], [2], … tagged with document title + page range) and
writes a single answer citing sources with [n] markers.
Response: {answer, citations[{index, document_id, document_title,
start_page, end_page, section_ids, quote}], documents_searched,
documents_with_matches, usage, elapsed_ms}. Empty evidence yields an
honest refusal rather than a hallucinated answer.
Org + store scope come from the injected headers, so a key only ever
reads its own documents. Wired from Deps (MultiDoc + LLM); returns 501
when no LLM is configured.
@
|
Warning Review limit reached
Next review available in: 52 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@
What
POST /v1/answer/store— ask a question over a set of documents (a store/collection) and get one synthesised answer with per-document citations. The map-reduce companion to the single-doc tree-walk.retrieval.MultiDocfans the selection strategy across everydocument_id→ relevant sections per doc.[1],[2], … tagged with document title + page range) → a single answer citing sources with[n]markers.Request:
{document_ids[], query, model?, max_sections_per_doc?, max_tokens?}Response:
{answer, citations[{index, document_id, document_title, start_page, end_page, section_ids, quote}], documents_searched, documents_with_matches, usage, elapsed_ms}Empty evidence → honest refusal, not a hallucination. Org + store scope come from the injected headers (a key only reads its own docs). Returns 501 when no LLM is configured. Wired from
Deps— no main.go change.Design notes
document_idsand passes them, so the engine stays scope-agnostic and this also works for an arbitrary ad-hoc doc set.document_id; the dashboard maps id→title for display (it already lists the store).[n]markers) so a formatting slip never drops the answer.Tests
TestParseStoreAnswer(clean/fenced/deduped/fallback),TestBuildStoreCitations,TestFormatPageRange.go build ./...+go test ./...green.Follow-up: SSE streaming variant + the dashboard "Store" playground mode.
@