> For the complete documentation index, see [llms.txt](https://docs.ebbot.ai/ebbot-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ebbot.ai/ebbot-docs/core-capabilities/ebbotgpt/ebbotgpt-best-practices/optimizing-retrieval-precision.md).

# Optimizing Retrieval Precision

## Why does the AI agent use the wrong document as its source?

When the AI agent or LLM give answers using the wrong document in your EbbotGPT knowledge, it's an AI hallucination type of issue.

**Problem:** The Language Model (LLM) provides an answer sourced from a document other than the one intended and both relevant documents was retrieved.&#x20;

**Cause:** The LLM struggles to discern, based on the user's question or the content of the retrieved documents, which document contains the definitively "correct" answer. This often occurs when documents contain similar or overlapping information.&#x20;

### Potential solutions on optimizing retrieval precision

**Document improvement:** Enhance the target document's clarity and specificity. Make it easier for the LLM to identify it as the most relevant source for particular queries. This could involve:&#x20;

* Adding unique identifiers or key phrases.&#x20;
* Structuring information more clearly.&#x20;
* Ensuring the document directly answers common questions it's intended for.&#x20;

**Persona refinement:** Modify the persona or instructions to guide its behavior when faced with ambiguous document relevance. For example, instruct the AI agent to:&#x20;

* "If multiple documents contain similar information, always present information from all relevant documents, noting their distinct sources."&#x20;
* "If uncertain about the primary source, state the source of the information provided."
