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

# Extract data

> Pull the same fields out of many documents into a structured result, using a schema you write or generate from the agent's instructions.

With **Advanced processing**, the agent reads many documents and pulls the same pieces of information out of each one, in a structure you define. Use it when you need a complete, structured list across a large set of documents, like every customer mentioned in last quarter's sales call notes with their budget and deal stage.

## When to use it

Search returns the passages that best match a question, so it can miss items in a long list. Advanced processing reads the selected documents in the time range and extracts what you asked for from each one. Use it for questions like:

* "List every feature request from customer calls this month, with the customer name."
* "Which candidates did we interview last week, and what was each interviewer's recommendation?"

## Set up extract data

**1. Add knowledge**

In the Agent Builder, in **Capabilities and knowledge**, click **Add knowledge**.

**2. Select data sources**

Pick a Space and select the folders, channels, or pages to process. Click **Next**.

**3. Choose Advanced processing**

Pick **Advanced processing**, set a time range, and describe what the data contains. To narrow the data with labels, click **Filters**.

**4. Define the schema**

In **Schema**, describe the fields to extract, or click **Re-generate from instructions** to build the schema from the agent's instructions. The schema is optional: without one, the agent decides what to extract from the conversation. Save the agent.

## Example

A sales team keeps call notes in a folder. They want an agent that lists every qualified opportunity from the last month. With this schema, the agent returns one entry per company:

```json theme={null}
{
  "type": "object",
  "properties": {
    "company_name": { "type": "string", "description": "Name of the prospect" },
    "budget": { "type": "string", "description": "Budget mentioned on the call" },
    "stage": { "type": "string", "description": "Deal stage, like discovery or negotiation" }
  }
}
```

In the instructions, tell the agent how to present the results, for example as a table sorted by stage.

## Limits

A single run reads up to 768 passages from the selected documents in the time range. The step details show how many documents the agent read, for example "Extracted from 42 documents over the last 30 days". For large sources, narrow the time range or the folders so the agent covers what matters.

## Related

> [card] [Knowledge](https://docs.dust.tt/docs/user-documentation/agents/knowledge)
>
> Compare the ways an agent can use your data.

> [card] [Include data](https://docs.dust.tt/docs/user-documentation/agents/knowledge/include-data.md)
>
> Load whole documents for summaries and reviews.

> [card] [Search data sources](https://docs.dust.tt/docs/user-documentation/agents/knowledge/search-data-sources.md)
>
> Find the most relevant passages for a question.

> [card] [Table queries](https://docs.dust.tt/docs/user-documentation/agents/knowledge/table-queries.md)
>
> Answer quantitative questions with SQL.


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