> ## Documentation Index
> Fetch the complete documentation index at: https://docs.neuralfactory.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Knowledge and citations

> Where an agent's answers come from, what a source is, and how to check an answer.

When an agent answers a question, it can base the answer on your organization's documents, on web pages, or on what its AI model learned in general. The sources listed below an answer show which documents or pages it used, so you can check the answer against the original before you act on it.

## Where answers come from

An agent can draw on three things:

* Its knowledge bases, when **Knowledge search** is on for the agent: collections of your organization's documents, such as uploaded files, FAQ spreadsheets, or files synced from SharePoint or Google Drive.
* The web, when **Web search** is on for the agent.
* The model's general knowledge: what the AI model learned before your organization ever used it.

When the agent searches a knowledge base, it does not read every document. Each document was split into passages when it was added, and the search finds the passages that match your question, by its words and by its meaning, so your question does not have to use the document's exact wording. The agent then writes its answer from the passages it found.

## What a source is

A source is one passage or page the agent used: part of a document, an FAQ entry, or a web page. Sources appear only when the agent searched a knowledge base or the web while answering. Below such an answer, a bar reads **N sources used** (or **1 source used**). Each source shows its name (for example `Employee Handbook.pdf (page 12)`), a preview of the text, and a link to the original when there is one.

When **Cite sources** is on in the agent's guardrails, the answer also carries numbered markers such as **\[1]**. Clicking a number opens the list and highlights the source it rests on.

## What Knowledge only changes

By default, an agent combines what it finds in its knowledge bases with the model's general knowledge. The **Knowledge only** guardrail tells it to answer only from its knowledge bases, and to say so when they do not cover a question.

It is an instruction the agent follows. Nothing filters the answer afterwards. Test it with questions your documents do not cover.

## Why an answer can still be wrong

Sources make an answer checkable. They do not make it right. An answer can go wrong when:

* the search missed the passage that holds the answer, or found a similar one about something else;
* the document itself is out of date, or two documents disagree;
* the agent read the passage wrongly or left out a condition;
* the agent answered from general knowledge, and no source appears at all.

## An example

You ask: "Can I carry unused leave into next year?" The agent answers that up to five days carry over, with marker **\[1]**. You click **\[1]**, then the highlighted source, and the source viewer shows the passage from the leave policy. You read it and see the rule applies only to full-time staff, which the answer left out.

## How to check an answer

1. Open **N sources used** and see which documents the answer rests on.
2. Click a source to read the full passage in the source viewer. For a knowledge base, the viewer also names the data source under **Data Source:**.
3. Open the original with **Open PDF**, **Open source** or **Open original source** when the passage is not enough.
4. If there are no sources, treat the answer as unchecked.
5. If the answer is wrong, rate it with a thumbs down and say why, so the people who run the agent can fix it.

## Where you see this in the app

* Below an answer: **N sources used** and the source viewer. See [Citations and sources](https://docs.neuralfactory.ai/user-guide/chat/citations-and-sources.md).
* **Knowledge** › **Knowledge bases**: the documents agents search. See [Knowledge bases overview](https://docs.neuralfactory.ai/user-guide/knowledge-bases/overview.md).
* The agent's **Guardrails** section: **Cite sources** and **Knowledge only**. See [Knowledge only](https://docs.neuralfactory.ai/user-guide/agents/strict-mode.md).

## Next

* [Skills, knowledge and tools](https://docs.neuralfactory.ai/user-guide/concepts/skills-knowledge-and-tools.md)
* [Feedback](https://docs.neuralfactory.ai/user-guide/chat/feedback.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.