Data batch Agent
Data batch Agent goes through a list of items and, for each one, gives an agent the same task with that item’s data. The agent works as usual, with its instructions and tools, and its answer is added as a new field of each item.
It is similar to Data Batch Chain, but instead of sending each item straight to an AI model, it hands it to an agent. Use it when each item needs the agent to look something up or use a tool, for example to search the web or your order system.
When to use it
- For each company in a list of prospects, have an agent with web search prepare a summary of its business.
- For each delayed order, have an agent check its status in the logistics system and write a notice for the customer.
- For each application received, have an agent review the profile against the job requirements and give an assessment.
Configuration
| Field | What it does |
|---|---|
| prompt | The task given to the agent for each item. Mark with braces where the item’s data goes (see below). It must have at least one gap between braces. |
| Connection | What to connect |
|---|---|
| Data | The list of items you want to process, for example the output of CSV to Data List. |
| Worker Agent | The agent that does the task: the Agent output of a component such as Agent. |
Gaps between braces in the prompt
{Data}is replaced by the main text of each item.{Data.field}is replaced by the value of a specific field of each item. For example,{Data.company}takes thecompanyfield.- Any other name between braces, for example
{language}, creates a new field in the component. Its value is the same for all items; you can type it or connect it.
Advanced options
| Field | What it does |
|---|---|
| Output key name | The name of the new field where the agent’s answer is stored. Default: chain_result. |
| Max Concurrency | How many items the agent processes at the same time. Default: 5. |
| JSON Mode | Reads the agent’s answer as structured data in JSON format. Ask for a JSON answer in prompt. Default: off. |
| JSON Flatten | With JSON Mode on, stores each value of the JSON answer as its own field of the item. Default: off. |
Output
Data is the same list that came in, in the same order, with the agent’s answer added to each item. Connect it to a component that stores or transforms data, for example Data to CSV.
Example
Consultores Roble wants to prepare sales visits to a list of companies:
- Load the list with CSV to Data List and connect its output to Data.
- Set up an Agent with a web search tool and connect its Agent output to Worker Agent.
- In prompt write: “Find recent information about the company {Data.company} in {Data.city} and summarise its business and latest news in three sentences”.
- In Output key name type
summary.
Each company comes out with a summary field that the sales team reads before calling.
Good practices
- Test the task with two or three items before processing a large list: each item takes time and model usage.
- Lower Max Concurrency if the agent’s tools query a service that limits requests.