---
description: Executes your AI agent using prompts and functions to produce a response.
---

# AI AGENT

ReplyCX's "Agent" action block is its most powerful feature for building intelligent, conversational AI agents. This guide will walk you through how to leverage it to handle complex user interactions, access knowledge bases, follow custom logic flows, and execute functions—all within a single, streamlined step.

The Agent block in ReplyCX empowers you to:

* Provide intelligent, context-aware responses to user queries
* Retrieve relevant information from connected knowledge bases
* Navigate dynamic conversation flows based on user intent
* Run backend functions to interact with external systems and services

To Use AI Agent block, go to Bot builder and in blocks select AI Agent block.

![Select the AI Agent acton block](https://1047404187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeyvV4WfyYBGZdBoAuetg%2Fuploads%2F1JYAUc1Dyuad3sx6aXud%2FAI%20Agent.png?alt=media\&token=2df37d05-cf42-40e1-8697-21fd17b3c6b7)

![](https://1047404187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeyvV4WfyYBGZdBoAuetg%2Fuploads%2Fw5GC9QTy43j0EZkMtA2a%2FAi%20Agent%201.png?alt=media\&token=19b44c0a-f553-4a58-b5d7-977c727ae894)

When using an "Agent" step, we need to configure the following:

### **Prompt:**

Crafting effective prompts is essential for developing a high-performing AI agent. The prompt we provide serves as the agent’s “brain,” influencing how it interacts with users in various scenarios.

![“Prompt section when creating an Agent”](https://1047404187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeyvV4WfyYBGZdBoAuetg%2Fuploads%2FnAeeumLBdvWMcyvzXhgE%2F2.png?alt=media)

#### Here’s what defines a well-crafted prompt:

* **Clear Instructions**: Clearly state the agent’s role and expected behaviour in different situations.
* **Defined Personality**: Establish the tone, level of formality, and communication style the agent should use.
* **Knowledge Boundaries**: Specify what information the agent should rely on and when to reference external data.
* **Context Awareness**: Offer guidance on handling sensitive topics and when to escalate the conversation to a human agent.

{% hint style="info" %}
You can learn to create a prompt [here](https://help.reply.cx/ai-studio/prompts).
{% endhint %}

Effective prompting keeps our agent focused—ensuring it knows what to prioritize, when to access the knowledge base, and how to maintain consistent responses. Taking the time to write clear, detailed instructions enhances both performance and simplifies your overall conversation flow.

### Prompt Generation Using AI

Now Prompts can be created and refined using AI prompt generation feature.

The AI-Powered Prompt Generator simplifies the process of writing prompts for your AI Agents. Just click on the **“Generate Prompt”** button and describe what you want the prompt to do. The system will instantly create a clear, relevant prompt tailored to your input.

Whether you're starting from scratch or refining an existing prompt, this feature helps you save time and ensures better, more effective AI instructions with less trial and error.

<figure><img src="https://1047404187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeyvV4WfyYBGZdBoAuetg%2Fuploads%2FpgW3kYQeDsylYg9hrhwT%2Fimage.png?alt=media&#x26;token=b080ae52-4fa5-41e8-80cd-7396d95b6806" alt=""><figcaption></figcaption></figure>

### **Function:**

Functions enable your agent to interact with external services to fetch or update data seamlessly.

You can either select an existing function from the dropdown menu or create a new one by going to **AI Studio > Functions**.

{% hint style="success" %}
Learn about creating a function [here](https://help.reply.cx/ai-studio/function-call).
{% endhint %}

![Select the function ](https://1047404187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeyvV4WfyYBGZdBoAuetg%2Fuploads%2FwyjCvkQZ4cuCIwPhwaWf%2F3.png?alt=media)

### **Path:**

Paths help your agent manage targeted conversation flows and respond with the right actions at the right time.

![Define the path for Agent to carry forward the conversation.](https://1047404187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeyvV4WfyYBGZdBoAuetg%2Fuploads%2Fz5kwgu9okKPqeqYaZiOa%2F4.png?alt=media)

#### Here’s what **Paths** make possible:

* **Automatic Routing**: The agent detects user intent and seamlessly guides the conversation down the appropriate path.
* **Data Collection**: Define specific variables that must be captured before a path can be activated.
* **Natural Flow**: Paths integrate naturally into the dialogue, eliminating the need for users to give precise commands.

#### To set up a **Path**:

1. Open the **Agent** step editor.
2. Click **“Add Path”** and assign it a clear, descriptive name.
3. Write a short description explaining when this path should be triggered.
4. _(Optional)_ Specify any required variables that must be collected before activation.
5. Link the path to the appropriate next steps in your chatbot flow.

### **Path Examples:**

Human Handoff Path

* **Path Name:** _Transfer to Human Agent_
* **Description:** Activate this path when the user clearly requests to speak with a real person. Common triggers include phrases like “I want to talk to a human,” “Can I speak to an agent?” or “I need help from a real person.”
* **Required Variable:** _None_
* **LLM Description:** This path enables the AI agent to transfer the conversation to a human representative. Ensure the system accurately detects requests for human assistance and initiates the handoff promptly.

### **LLM Settings:**

The LLM Settings section allows you to customize how the language model behaves:

* **AI Model:** Choose which AI model (e.g., GPT-3, GPT-4) you want to use for generating responses. Each model has different capabilities, with newer models generally offering more advanced features.
* **Max Tokens:** This setting controls the maximum length of the response. A higher token limit allows the model to generate longer responses, while a lower limit results in shorter replies.
* **Temperature:** This adjusts the randomness of the model’s responses. A higher temperature (e.g., 0.7) makes responses more creative and varied, while a lower temperature (e.g., 0.2) makes them more deterministic and focused.

These settings help fine-tune how the AI interacts with users based on your desired response style and length.

![Set LLM model settings ](https://1047404187-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeyvV4WfyYBGZdBoAuetg%2Fuploads%2FlQnqp0WUrgYeLGOlPf8g%2F5.png?alt=media)
