XML Agent
XML Agent answers each message with the AI model you connect and uses the available tools when it needs them. Instead of the tool calling many models offer, the agent explains to the model how to ask for a tool by writing text tags (for example <tool>search</tool>) and how to mark the final answer. That is why it also works with models that do not support tool calling.
It is an older component kept for compatibility with existing flows. For new flows, use Agent.
When to use it
- Maintaining existing flows built with this agent.
- Giving tools to a model that does not support tool calling.
Configuration
| Connection | What to connect |
|---|---|
| Model (required) | The AI model that answers and decides which tools to use. |
| Tools | The tools the agent can use. |
| Field | What it does |
|---|---|
| Input | The user’s message, usually from Chat Input. |
| Prompt | The agent’s full instructions. By default they already explain to the model how to use the tags and how to give the final answer. It must keep {tools} (the list of tools), {input} (the user’s message) and {agent_scratchpad} (the steps the agent has already taken). |
Advanced options
| Field | What it does |
|---|---|
| Handle Parse Errors | If the model returns an answer in an unexpected format, the agent tries to recover instead of stopping. Default: on. |
| Verbose | Logs the agent’s steps in detail. Default: on. |
| Max Iterations | The maximum number of steps (tool calls) before stopping. Default: 15. |
| Disable Streaming | When on, the model answers in one piece instead of word by word. Default: off. |
Using it as an agent tool
You can connect this component to an agent’s Tools input. In the Tool tab, Tool Name and Tool Description are the name and explanation the agent uses to recognise the tool and decide when to call it: write a clear description of what it does.
Output
- Response: the final answer as a message. Connect it to Chat Output or to any component that takes text.
- Agent: the configured agent, to connect it to components that take an agent.
Example
A small tax advisory firm uses a model installed on its own computers that does not support tool calling, and wants it to use an internet search tool:
- Connect Chat Input to Input and the model to Model.
- Connect an internet search tool to Tools.
- At the start of Prompt, replace the first sentence with: “You are the firm’s assistant. Answer in Spanish.” and leave the rest of the instructions as they are.
- Connect Response to Chat Output.
When someone asks about a filing deadline, the model asks for the search using the tags, receives the results and answers.
Good practices
- If you edit Prompt, keep the instructions about the tags and the
{tools},{input}and{agent_scratchpad}variables: without them the agent cannot use tools. - If the connected model supports tool calling, use Agent.
Related components
- Agent: the recommended agent for new flows.
- Tool Calling Agent: another older agent with tools.