← All questions
RAGMedium· Retrieval Evaluation· Tool Use· Aggregates

How do you handle aggregate questions like 'how many' w...

Recall@20 measures if relevant passages appear, but an aggregate query requires all M items. If M is large, the retrieval pipeline’s coverage ceiling is too low to provide an accurate count. Instead of relying on retrieval, route these requests to a tool that can perform the computation over the entire dataset. If no SQL surface exists, use metadata-filtered counts where possible, or have the model abstain from answering if the data is unavailable.

Code playground (Python)