Skip to content

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

ConnectionWhat to connect
Model (required)The AI model that answers and decides which tools to use.
ToolsThe tools the agent can use.
FieldWhat it does
InputThe user’s message, usually from Chat Input.
PromptThe 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

FieldWhat it does
Handle Parse ErrorsIf the model returns an answer in an unexpected format, the agent tries to recover instead of stopping. Default: on.
VerboseLogs the agent’s steps in detail. Default: on.
Max IterationsThe maximum number of steps (tool calls) before stopping. Default: 15.
Disable StreamingWhen 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:

  1. Connect Chat Input to Input and the model to Model.
  2. Connect an internet search tool to Tools.
  3. 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.
  4. 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.