Agent

Updated at:

Definition

The Agent node is a powerful component in AI Studio. It allows a large language model (LLM) to dynamically select and run tools or MCPs. This enables complex, multi-step inference. By integrating different Agent inference policies, the Agent node helps the LLM better understand and respond to user instructions.

Prerequisites

Create an AI Studio service

Configuration steps

Add a node

In the AI Studio editor, click image next to Start to add an Agent node.

Select an Agent policy

In the Agent node configuration pane, click Agent Policy. Currently, only MCP FunctionCalling is supported.

MCP FunctionCalling

MCP FunctionCalling maps user instructions to predefined functions or MCP services. The LLM first detects the user's intent. Then, it decides which function to call and fetches the necessary parameters. The core of this policy is to call external functions or MCPs. This is a specific type of tool calling.

Advantages:

  • Precise: Directly calls the correct tool for specific tasks. This avoids complex inference.

  • Easy integration: You can encapsulate external APIs or tools as functions that the model can call.

  • Structured output: The model provides structured function calling information. This makes it easy for descendant nodes to process.

Node configuration

After you select an Agent policy, the related configuration items appear in the configuration pane. AI Studio supports the following MCP configuration items.

  1. Model: Select the large language model that drives the Agent.

  2. MCP: The Agent policy defines how to use an MCP. Click image to add and configure an MCP service that the Agent can call.

    Configuration: From the drop-down list, select an existing MCP service or enter a custom one.

    • Select an existing MCP service: Select a method from an MCP service that you have already created.

    • Enter a custom MCP service: Enter the MCP URL, service name, and other details to configure a custom MCP service.

  3. Instruction: Define the task objective and context for the Agent. Use Jinja syntax to reference variables from ancestor nodes.

  4. Query: Accepts user input.

  5. Maximum Iterations: Set the maximum number of execution steps for the Agent.

  6. Output Variables: Defines the data structure for the node's output.

View logs

An Agent node generates detailed logs during its execution. These logs show overall information about the node's execution, such as inputs and outputs, token overhead, execution time, and status. Click Details to view the output information from each round of the Agent policy execution.