Your voice agent found passages. Did it find the right ones?
A retrieval call can return a full list of passages and still leave a voice assistant with nothing useful to say. The request succeeded. The evidence failed. IBM Research's new CUGA voice-agent write-up describes exactl
A retrieval call can return a full list of passages and still leave a voice assistant with nothing useful to say. The request succeeded. The evidence failed.
IBM Research's new CUGA voice-agent write-up describes exactly that failure: regional-language questions were being searched against an English handbook with an English-only embedding model. The system returned passages, but the relevant evidence was missing. Its grounded answer then declined to help. The authors report switching to intfloat/multilingual-e5-large. [1]
I want a retrieval check before adding speech. Otherwise a pleasant voice can make a broken search sound very convincing.
A full result list earns no points by itself
Here is an invented retrieval fixture. en, hi and te label intended English, Hindi and Telugu test groups. The IDs stand for chunks in a tiny imaginary document. There are no embeddings, translations or model calls in this example.
Original diagram of the fixture below. Filled result slots and relevant evidence are different quantities.
For a query with a known set of relevant chunks, recall at k is:
distinct relevant IDs in the first k results / all known relevant IDs
The denominator comes from the answer key, not the result-list length. A query needing two chunks receives only half credit when one appears, even if the application asked for two results and got two back.
Save this as retrieval_check.py and run python3 retrieval_check.py. It uses Python's standard library.
from fractions import Fraction
def recall_at_k(gold, ranked, k):
if not gold or k < 1:
raise ValueError("Need relevant IDs and a positive k")
return Fraction(len(gold & set(ranked[:k])), len(gold))
gold = {"en": {"a", "b"}, "hi": {"a", "b"}, "te": {"c"}}
ranked = {"en": ["a", "x"], "hi": ["x", "y"], "te": ["c", "z"]}
scores = []
for language in gold:
score = recall_at_k(gold[language], ranked[language], 2)
scores.append(score)
print(language, len(ranked[language]), f"{float(score):.0%}")
print("macro recall", f"{float(sum(scores) / len(scores)):.0%}")
The checked output is:
en 2 50%
hi 2 0%
te 2 100%
macro recall 50%
All rows are equally full. Their usefulness is rather less equal. π
set(ranked[:k]) prevents a duplicate chunk from earning credit twice. Empty relevance labels are rejected because recall would have no denominator. In a real dataset, unanswerable questions need a separate abstention test; quietly treating them as perfect retrieval would inflate this score.
The macro average gives each query equal weight. Here it is (1/2 + 0 + 1)/3 = 1/2. Pooling the matching chunks instead gives 2/5, or 40%, because the queries have different numbers of relevant chunks. Choose the aggregation deliberately and retain the per-language rows.
Connect the check to real retrieval
Replace the invented ranked IDs with your search output. Keep the question ID, requested language, corpus revision and returned chunk IDs together. Have a qualified reader label the needed evidence before examining which model looks best. That turns a disappointing answer into a traceable question: was the needed passage available to the answer generator?
Changing the embedding model also has a formatting contract. E5's model card specifies query: for queries and passage: for documents, including non-English inputs. It also documents pooling and normalization. A multilingual model name alone doesn't verify those details. [2]
I would test text queries before introducing transcription, then compare the recognized text with the intended question. Those checks isolate retrieval failure from speech recognition failure. An answer can still misuse good evidence, so answer correctness needs its own check after retrieval passes.
This program tests metric bookkeeping on hand-written rankings. Its language labels do not measure language quality, and it does not reproduce IBM's application. The useful result is a runnable check that refuses to mistake a nonempty list for successful retrieval.
References
- IBM Research β An Indic Voice Agent with CUGA
- Multilingual E5 large β model card and retrieval input format
- Python β fractions
Asset credits
Original fixture diagram, released under CC BY 4.0. Credit: Shivam Dwivedi.
AI disclosure
AI was used to draft the article.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.