> For the complete documentation index, see [llms.txt](https://docs.stackai.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stackai.com/technical-reference/files-knowledge-and-retrieval/diagnosing-missing-stale-or-irrelevant-results.md).

# Diagnosing Missing, Stale, or Irrelevant Results

Missing or irrelevant results can originate in source selection, processing, permissions, filtering, or ranking. Diagnose these stages before changing the answer prompt.

{% embed url="<https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSQ1Sgy933krTyK0S4JpP%2Fuploads%2Fj3F04vpioCvuNyF6V1PS%2FG043.mp4?alt=media&token=9bea87bf-0e03-4f26-b85f-503611ebffd3>" %}

## Before you begin

Access to the target file’s processing state and the retrieval configuration.

## Key concepts

| Term               | Definition                                                                                                                                      |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Stale content      | Indexed or displayed content that no longer matches the current source. Check synchronization and processing before changing retrieval prompts. |
| Indexing status    | The reported progress or outcome of preparing a source for search. Check the individual resource when collection totals are insufficient.       |
| Filter             | A condition that narrows the records eligible for an operation. A filter can exclude relevant content before ranking occurs.                    |
| Ranking            | The ordering of eligible results by the selected retrieval method. A high position or score is not proof that a passage answers the question.   |
| Source permissions | Access rules for the original documents or records. Knowledge-base sharing does not necessarily grant access to every source.                   |

## Diagnose search results

1. Confirm that the source file exists and has completed indexing.
2. Check selected folders, metadata filters, connection validity, and user access.
3. Inspect the retrieved passages, then adjust the query strategy or result count if needed.

![Inspect the returned passage and its source to determine whether retrieval found the right evidence.](https://content.gitbook.com/content/SQ1Sgy933krTyK0S4JpP/blobs/W4E73dbXbrq0uTbJsUXO/assets/g043-g043-01-baseline.png)

Inspect the returned passage and its source to determine whether retrieval found the right evidence.

You identify the stage that excluded or misranked the expected evidence.

## Behavior and limitations

A successful upload is not proof of indexing. An empty result is not proof that the provider has no matching file. If the source is relevant but the answer is wrong, inspect how the retrieved text reaches the model. Keep retrieval failures separate from answer-generation failures.

## Related resources

[Evaluate retrieval](https://docs.stackai.com/guides-and-quickstarts/knowledge-and-retrieval/evaluate-retrieval.md)

[File Inputs, Supported Formats, and Size Limits](https://docs.stackai.com/technical-reference/files-knowledge-and-retrieval/file-inputs-supported-formats-and-size-limits.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.stackai.com/technical-reference/files-knowledge-and-retrieval/diagnosing-missing-stale-or-irrelevant-results.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
