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

# Answer From Documents

> Answer a set of questions about a document collection in one step, each with an exact quote and page.

Answers questions about a [document collection](https://agents.nanonets.com/docs/tools/index_documents.md) in one call. Display name **"Answer From Documents"**.

For each question it searches the collection, answers only from the passages it finds, and checks the supporting quote against the page. Every answer comes back with its file, page and the exact words it rests on. In the task feed the answers show as a table. Each quote is shown in full, and its link opens the original page with those words highlighted.

Use it when an agent's job is to answer questions about a set of documents, for example a fixed list of claim questions or a user's ad hoc question about one claim. With it, the agent needs no separate list, read or verification steps. For looking around a topic or following up on one answer, use `retrieve_documents`.

## Authentication and enablement

* No integration needed.
* Off by default. Add it to an agent's tools.
* The workspace must have document collections switched on (runtime flag `document_collections.enabled`), and the platform's default model and embeddings must be configured.

## Inputs

* `collection` (required): collection key(s), matched case-insensitively, for example a claim number.
* `questions` (required): up to 40 questions, each `{"key": "vehicle", "question": "What vehicle was the insured driving?", "search": "insured driver vehicle make model"}`. `key` is optional and names the answer's row. `search` is optional: a few words to search the documents with, which defaults to the question. Give it when a question lists its allowed answers, because that list makes a poor search.
* `instructions` (optional): extra answer rules for this call, such as formats or allowed categories.
* `filters` (optional): the same filters as `retrieve_documents`, to narrow by `doc_type`, date and so on.
* `scope` (optional): `collection` (the default) or `workspace`.

The agent's approved learned rules are applied to every answer. These are rules of type `document_answer`, or all rules when the agent injects rules into every model call.

## Output

* One answer per question, in the order asked: the answer, the exact quote, the file, the page, and a link to the page.
* An answer whose quote could not be found in the passage is kept but marked **unverified**, never shown as exact. Rows of tables and forms that OCR read column by column are accepted when every number and most of the words are on the page.
* Questions the documents do not answer come back as **Not stated**.
* A question that fails, for example on a model error, reports its own error; the other questions still answer.

## Limits and side effects

* Read-only.
* Up to 40 questions per call, answered 6 at a time. Each answer reads the 8 best passages for its question.
* Shows the agent at most 30,000 characters of answers and says when it cut them.
* Asks the model for schema-checked JSON and retries a question once when its reply cannot be read.
* Cost grows with the number of questions: per question, one search, one re-rank and one model answer.

## Expected errors

* Document collections not enabled, or no model configured.
* No questions, an empty question, or more than 40 questions.
* `scope` set to `library`.
* A malformed filter.


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