# AI Agent

### Overview

The **AI Agent** action lets you apply Large Language Model (LLM) driven actions on incoming data streams. You can provide instructions or prompts, optionally use variables from the **fx** panel, preview the output, refine prompts, and save the final instruction set to execute at runtime.

### Configure and run the AI Agent action

To configure and run the **AI Agent** action, follow these steps:

{% stepper %}
{% step %}
On the **Flow** tab, drag the **AI Agent** action from the action palette and drop it onto the **Flow** panel so that it becomes a sub-action of the flow.

<div data-with-frame="true"><figure><img src="/files/Aglv60NR2YTpAkMIl9TG" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
Click **Configure**.
{% endstep %}

{% step %}
Optional: Enter a custom name for this step, such as `Get SF lead summary`.
{% endstep %}

{% step %}
In the **LLM** list, select a connected LLM app or connector.
{% endstep %}

{% step %}
In the **Model** list, select an available model.
{% endstep %}

{% step %}
In the **Batch Size** list, select a value: **1**, **10**, **50**, **100**, **200**, or **500.**
{% endstep %}

{% step %}
Click **Configure** to open the prompt setup and preview window.

<div data-with-frame="true"><figure><img src="/files/V5990jUP46x1KkPT4PfZ" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
If a prompt isn't configured, this default screen appears. Enter a prompt and click **Submit** ![](/files/33X7E28maH5xN87fVKDF) to process it and view the preview.&#x20;

<div data-with-frame="true"><figure><img src="/files/QCq6r5t26P1v5gx3tQq5" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
In the **User Prompt** section, you can enter:

* Plain text instructions
* Multi-line prompts
* Data variables inserted via **fx** panel (for example, `{{name}}` or `{{date}}`)

<div data-with-frame="true"><figure><img src="/files/DihezNOFsH1NiojCTHNf" alt="" width="375"><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
Optional: To configure models and tools to your agent, select from the following available options:

* In the **LLM Model** list, you can view the LLM app that you selected on the previous page. You can also select a different LLM connector from the list.<br>

  <div data-with-frame="true"><figure><img src="/files/H8qUPj42BcqoxawWVTyb" alt="" width="375"><figcaption></figcaption></figure></div>
* **MCP Server:** Select an MCP server from the list, or click **Add New MCP Server** to connect a new one.<br>

  <div data-with-frame="true"><figure><img src="/files/0yhTuvVPK8Z9TfxryEfg" alt=""><figcaption></figcaption></figure></div>
* **Vector Database:** Select a connected vector database, and then select a vector store or table from the **Collection** list.<br>

  <div align="left" data-with-frame="true"><figure><img src="/files/XwSnlLd8iJYyyxUlSfc1" alt=""><figcaption></figcaption></figure></div>
* **Web Search:** Configure parameters to enable web search. This feature lets you scope and localize web searches to improve relevance, compliance, and intent-matching by constraining search domains and applying geographic and contextual filters.<br>

  <div data-with-frame="true"><figure><img src="/files/n3KoQ3UwsJGmSGgriUqJ" alt=""><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}
Optional: To insert variables into your prompt, expand the **fx** panel to view workflow variables and the structure of the incoming data stream. Drag a variable and drop it into the instruction box. Variables appear in curly braces (for example, `{{name}}`).

<div data-with-frame="true"><figure><img src="/files/KbXlVxBpjcMhQu5DKa9E" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
Click **Preview** to process the prompt and generate a preview. The **Preview Output** panel displays the generated output and refreshes automatically whenever you change the instructions.

<div data-with-frame="true"><figure><img src="/files/0jjYFE9gUY4KwGYcCHrl" alt=""><figcaption></figcaption></figure></div>
{% endstep %}

{% step %}
Click **Save & Close**.
{% endstep %}

{% step %}
Click **Run** <img src="/files/ucLaz5UBEMNlMYWKS3YY" alt="" data-size="line"> to initiate the integration. The console appears at the bottom of the screen, displaying logs and operations. When the process completes successfully, the console status updates to **Process Completed** and displays the **Data In** and **Data Out** details.

<div data-with-frame="true"><figure><img src="/files/8mbX3Y78QKZjny4aHj73" alt=""><figcaption></figcaption></figure></div>
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.mydbsync.com/cloud-workflow/create-your-workflow/actions/ai-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
