---
title: "Say so when nothing relevant was found · Agent Wranglers"
url: https://agentwranglers.se/playbook/ai-features/retrieval/no-match-answer
updated: 2026-10-20
licence: "All rights reserved"
---

# Say so when nothing relevant was found

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Retrieval](https://agentwranglers.se/playbook/ai-features/retrieval)
- Rule: When search finds nothing above a set relevance threshold, reply that the documents do not cover the question. Do not let the model answer from its general knowledge.
- How: Pick a threshold from the retrieval evals, such as the lowest score that still found a right document in 95 of 100 cases. Below it, skip the model and send a fixed reply with a link to search or support. Log these questions, because they show which documents are missing.
- Check: Ask a question the documents do not cover, such as one about a product you do not sell. The reply says the documents do not cover it, and the log shows a no-match event.

Example:

```ts
if (!hits.length || hits[0].score < MIN_RELEVANCE) {
  log.info({ event: 'retrieval.no_match', feature: 'help-search' });
  return { text: NO_MATCH_REPLY, sources: [] };
}
```

```python
if not hits or hits[0].score < MIN_RELEVANCE:
    log.info("retrieval.no_match", feature="help-search")
    return {"text": NO_MATCH_REPLY, "sources": []}
```

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers ai features playbook: https://agentwranglers.se/playbook/ai-features/retrieval/no-match-answer`.

- Previous: [Cite a source for every answer](https://agentwranglers.se/playbook/ai-features/retrieval/cite-sources)
- Next: [Keep the index as fresh as its sources](https://agentwranglers.se/playbook/ai-features/retrieval/index-freshness)
- [Retrieval](https://agentwranglers.se/playbook/ai-features/retrieval)
