Docs Automation AI Agents

AI Agents

Create intelligent agents powered by knowledge base and tools that handle customer queries automatically across WhatsApp, Voice, Webchat, and API channels.

Overview

AI Agents are intelligent bots powered by your knowledge base and external tool integrations. They handle customer queries automatically across WhatsApp, Voice, Webchat, and API channels. Each agent can be configured with its own personality, AI model, language, and set of tools — allowing you to build specialized assistants for support, sales, scheduling, and more. Agents use Retrieval-Augmented Generation (RAG) to search your knowledge base and provide accurate, context-aware responses in real time.

Creating an AI Agent

1
Go to Automation → AI Agents
Click "Automation" in the sidebar, then select "AI Agents" from the submenu.
2
Click "Create Agent"
Click the "Create Agent" button to open the agent creation form.
3
Enter agent name
Give your agent a descriptive name that reflects its purpose, such as "Support Bot" or "Sales Assistant."
4
Write system prompt
Write a system prompt that describes the agent's personality and behavior. This is the core instruction set that defines how the agent responds in conversations. For example: "You are a friendly support agent for AcmeCo. Always be polite, concise, and helpful."
5
Select AI model
Choose an AI model for the agent. Options include GPT-4o Mini (faster, cheaper), GPT-3.5 Turbo, or the default model.
6
Configure greeting message
Optionally set a greeting message that is sent when a new conversation starts. The greeting can be toggled on or off.
7
Save
Click "Save" to create the agent. It will appear in your agents list and is ready for further configuration.
Warning
Each subscription plan has an agent creation limit. Check Billing → Plans to see how many agents your plan allows before creating a new one.

Agent Configuration

Fine-tune how your AI agent behaves by adjusting these settings in the agent configuration panel.

1
System Prompt
The core instruction set that defines the agent's personality, tone, and behavior rules. Write clear instructions describing how the agent should respond, what topics it covers, and how it should handle edge cases.
2
AI Model
Choose between GPT-4o Mini (faster and more cost-effective), GPT-3.5 Turbo, or the default model. Different models offer different trade-offs between speed, cost, and quality.
3
Temperature
Controls creativity vs. consistency on a 0 to 1 scale (adjustable in 0.1 increments). Lower values (0.1–0.3) produce more focused, deterministic responses ideal for support agents. Higher values (0.7–1.0) produce more creative, varied responses suited for marketing or brainstorming agents.
4
Response Language
Select the language the agent responds in. Over 17 languages are supported, including English, Hindi, Bengali, Gujarati, Kannada, Malayalam, Marathi, Tamil, Telugu, Arabic, Spanish, French, Portuguese, German, and more.
5
Greeting Message
A welcome message sent automatically when a new conversation begins. Can be toggled on or off depending on whether you want the agent to initiate the conversation.
6
Active / Inactive Toggle
Enable or disable an agent without deleting it. Inactive agents do not process incoming messages but retain their full configuration for later reactivation.
Tip
Start with a low temperature (0.2–0.3) for customer support agents where consistency matters. Use a higher temperature (0.7+) for creative or marketing agents where variety is desirable.

Voice Channel Setup

Voice agents use Sarvam AI for text-to-speech, enabling your agent to speak to callers in natural-sounding voices across multiple languages.

1
Select a voice
Choose from 12 voice options. Female voices: Priya, Neha, Ritu, Kavya, Shreya, Simran. Male voices: Aditya, Rahul, Dev, Rohan, Shubh, Amit.
2
Set voice language
Select the voice language from 11 supported options: English (India), Hindi, Bengali, Gujarati, Kannada, Malayalam, Marathi, Odia, Punjabi, Tamil, and Telugu. The voice language can be configured independently from the text response language.
3
Configure interruptions
Toggle "Allow Interruptions" to let callers interrupt the agent while it is speaking. This creates a more natural conversation flow for callers who want to clarify or redirect the conversation.
4
Per-channel language
Each channel can have its own language setting, so the same agent can speak Hindi on one voice channel and English on another.
Info
Voice testing requires Chrome or Edge browser with microphone access. Other browsers may not support real-time voice interactions.

Tool Integrations

Agents can call external tools during conversations to fetch data, perform actions, and integrate with third-party services. The AI decides which tool to use based on the tool's name and description.

Available tool types:

  • Webhook — Call any URL with a custom payload
  • REST API — Full REST integration supporting GET, POST, PUT, PATCH, and DELETE methods
  • Google Sheets — Read, append, or update spreadsheet data
  • Google Calendar — List, create, update, and delete events, or check availability
  • Google Meet — Create video call links
  • Google Docs — Create and manage documents
  • Google Drive — Access and manage files
  • Zoho CRM — Create, read, update, and search CRM records
  • Slack — Send messages to channels
1
Open the Tools tab
In the agent configuration panel, navigate to the "Tools" tab.
2
Click "Add Tool"
Click "Add Tool" and select the tool type you want to integrate.
3
Configure tool settings
Enter the tool name, description, and authentication settings. Authentication options include None, Bearer Token, API Key, and Basic Auth. You can also add custom headers and configure the request body template.
4
Define parameters
Add parameters the tool needs at runtime. Each parameter has a name, type, description, and a required flag. The AI extracts these values from the conversation context.
5
Save and enable
Save the tool configuration. Each tool has an enabled toggle so you can disable it without removing the configuration.
Tip
Give tools clear, specific descriptions — the AI uses the description to decide when to call each tool. For example, "Look up a customer's order status by order ID" is better than "Order tool."

Body Template & System Variables

For REST API and Webhook tools, you can define a JSON body template with dynamic placeholders. Use {{param_name}} to insert AI-extracted parameters, and system variables for automatic context injection.

Available system variables:

  • {{__sender_phone}} — The sender's phone number, automatically injected from the incoming WhatsApp message or voice call. No need to define this as a parameter.
  • {{__channel}} — The channel the message arrived on: whatsapp, voice, webchat, or api.

Example body template for an energy generation API:

{
  "credentials": "your-api-credentials",
  "phoneNumber": "{{__sender_phone}}",
  "date": "{{date}}"
}

In this example, {{__sender_phone}} is filled automatically from the caller's number, while {{date}} is extracted by the AI from the user's message (e.g., "today", "yesterday", "24 March"). Define date as a required parameter with the description: "The date in YYYY-MM-DD format."

Info
System variables ({{__sender_phone}}, {{__channel}}) are only included in the API request when you explicitly reference them in the body template. They are never sent automatically to protect user privacy.

Knowledge Base Integration

Connect your agent to knowledge base articles so it can answer questions using your own content. The agent uses RAG (Retrieval-Augmented Generation) to search linked articles by semantic relevance and craft accurate responses.

1
Open the Knowledge Base tab
In the agent configuration panel, navigate to the "Knowledge Base" tab.
2
Select articles
Browse available articles and select the ones relevant to this agent. Only active articles appear in the selection list — draft articles are excluded.
3
Save
Click "Save" to link the selected articles. The agent can now search these articles and use the most relevant content when responding to customer queries.

Agents can be linked to multiple knowledge base articles. When a message comes in, the agent searches all linked articles and retrieves the most relevant content based on meaning, not just keywords.

Tip
Write knowledge base articles in Q&A format for best retrieval accuracy. Start with the question a customer might ask, then provide a clear answer.

Testing in Playground

The Playground lets you test your agent in three modes before deploying it to live channels.

1
Open the Playground
Click "Playground" on the agent card from the AI Agents list page.
2
Chat Test
Send text messages to the agent and see its responses in real time. Each response displays latency in milliseconds, token usage, and cost per request so you can monitor performance as you iterate.
3
Voice Test
Start a live voice call with the agent. Speak into your microphone and hear the agent respond via text-to-speech. The interface shows a live transcript, call duration, and real-time call states: Connecting, Listening, Thinking, and Speaking.
4
Debug Tab
Inspect the full details of each interaction. View the system prompt sent to the model, retrieved knowledge base chunks with similarity scores, token usage breakdown, cost breakdown, cache hit/miss status, and the complete conversation history.
Warning
Voice testing requires Chrome or Edge browser and microphone permission. If the Sarvam AI TTS API is unavailable, the system falls back to browser-native text-to-speech.

Debug and Performance

Monitor and optimize your agent's performance using the detailed metrics available in the Playground debug tab.

  • Latency — Response time tracked in milliseconds per request
  • Token Usage — Number of input and output tokens consumed per request
  • Cost — Calculated cost in USD per request based on model and token usage
  • Cache Status — Shows whether a response was served from cache (hit) or generated fresh (miss). Cached responses are faster and cheaper
  • Knowledge Base Chunks — Retrieved articles displayed with relevance/similarity scores so you can verify the right content is being matched
  • Channel-specific Testing — Test the same agent on different channels (WhatsApp, Voice, Webchat, API) to verify behavior across all deployment targets
Tip
Use the debug tab regularly to optimize your agent's knowledge base and reduce costs. Low similarity scores on retrieved chunks indicate you may need to rewrite or add knowledge base articles.

Assigning to Channels

Once your agent is configured and tested, assign it to one or more channels so it can handle live customer messages.

1
Go to channel settings
Navigate to WhatsApp → Channels → select your channel → Settings.
2
Select your agent
Choose your agent from the "Default AI Agent" dropdown in the channel settings.
3
Save changes
Click "Save" to activate the agent on the channel. It will begin handling incoming messages immediately.

You can assign different agents to different channels, allowing specialized agents per use case. Per-channel language settings can also be configured independently, so the same agent can respond in different languages on different channels.

Agent Limits

Each subscription plan includes a maximum number of AI agents you can create. Your current usage is displayed as "X/Y agents" on the AI Agents page.

  • When the agent limit is reached, the "Create Agent" button is disabled and you cannot create new agents
  • Upgrade your plan in Billing → Upgrade Plan to increase your agent limit
  • Inactive agents still count toward your limit, but preserving them avoids losing their configuration
Info
You can disable unused agents instead of deleting them, preserving their configuration for later use. Disable agents from the Active/Inactive toggle in the agent configuration panel.