Skip to main content

AI Agent Setup Guide

This guide walks you through setting up an AI Agent for your sender. You can configure agents through the Dashboard UI or programmatically via the API.

Via Dashboard

1

Navigate to Agent Settings

Go to Senders in the sidebar, select your sender, and click the Agent tab.
2

Enable the Agent

Toggle the Enable Agent switch to activate automated responses for this sender.
3

Configure LLM Provider

Choose your AI provider and model:
  • Provider: Select OpenAI, Anthropic, Google, Mistral, or Zavu (managed)
  • Model: Choose from available models (e.g., gpt-4o-mini, claude-3-5-haiku)
  • API Key: Enter your provider API key (not needed for Zavu provider)
4

Write System Prompt

The system prompt defines your agent’s personality and behavior. Write clear instructions:
You are a helpful customer support agent for [Company Name].

Guidelines:
- Be friendly and professional
- Keep responses concise (under 160 characters for SMS)
- If you don't know the answer, say so
- For billing issues, direct customers to billing@company.com
- Never share sensitive information
5

Set Trigger Channels

Select which channels should trigger the agent:
  • SMS: Text messages
  • WhatsApp: WhatsApp messages
You can enable the agent on both channels or just one.
6

Configure Advanced Settings

Adjust these optional settings:
SettingDescriptionDefault
TemperatureCreativity level (0-2)0.7
Max TokensMaximum response length500
Context WindowPrevious messages to include10
7

Save and Test

Click Save to apply your configuration. Send a test message to your sender’s phone number to verify the agent responds correctly.

Via API

Create Agent

import Zavudev from "@zavudev/sdk";

const zavu = new Zavudev({
  apiKey: process.env["ZAVUDEV_API_KEY"],
});

const agent = await zavu.senders.agent.create("sender_abc123", {
  enabled: true,
  provider: "openai",
  model: "gpt-4o-mini",
  apiKey: process.env.OPENAI_API_KEY, // Not needed for Zavu provider
  systemPrompt: `You are a helpful customer support agent for Acme Corp.
Be friendly and concise. If you don't know the answer, say so.`,
  temperature: 0.7,
  maxTokens: 500,
  contextWindowMessages: 10,
  triggerOnChannels: ["sms", "whatsapp"],
});

console.log("Agent ID:", agent.id);

Update Agent

const agent = await zavu.senders.agent.update("sender_abc123", {
  systemPrompt: "Updated system prompt...",
  temperature: 0.5,
  model: "gpt-4o", // Upgrade to more powerful model
});

Enable/Disable Agent

// Disable agent
await zavu.senders.agent.update("sender_abc123", {
  enabled: false,
});

// Re-enable agent
await zavu.senders.agent.update("sender_abc123", {
  enabled: true,
});

Get Agent Configuration

const agent = await zavu.senders.agent.retrieve("sender_abc123");

console.log("Provider:", agent.provider);
console.log("Model:", agent.model);
console.log("Enabled:", agent.enabled);
console.log("Stats:", agent.stats);

Configuration Options

OptionTypeDescription
enabledbooleanWhether the agent responds to messages
providerstringLLM provider: openai, anthropic, google, mistral, zavu
modelstringModel ID (e.g., gpt-4o-mini, claude-3-5-haiku)
apiKeystringProvider API key (not needed for zavu provider)
systemPromptstringInstructions that define the agent’s behavior
temperaturenumberResponse creativity (0 = deterministic, 2 = creative)
maxTokensnumberMaximum tokens in the response
contextWindowMessagesnumberNumber of previous messages to include as context
triggerOnChannelsarrayChannels that activate the agent: ["sms", "whatsapp"]

System Prompt Best Practices

Be Specific

Define exactly what the agent should and shouldn’t do. Include examples of good responses.

Set Boundaries

Specify what topics to avoid and when to escalate to humans.

Match the Channel

For SMS, instruct the agent to keep responses under 160 characters when possible.

Include Context

Mention your company name, products, and common customer questions.

Example System Prompts

Customer Support Agent:
You are a friendly customer support agent for TechCo.

Your responsibilities:
- Answer questions about our products and services
- Help troubleshoot common issues
- Direct billing questions to billing@techco.com
- Escalate complex technical issues to our support team

Guidelines:
- Be concise and helpful
- Use simple language
- Never share customer account details
- If unsure, say "I'll connect you with a specialist"
Lead Qualification Agent:
You are a sales assistant for RealEstate Inc.

Your goal is to qualify leads by collecting:
1. Their name
2. Type of property they're looking for
3. Budget range
4. Preferred location
5. Timeline for purchase

Be friendly and conversational. After collecting this info, let them know an agent will contact them within 24 hours.

Testing Your Agent

After configuring your agent, test it thoroughly:
  1. Send test messages from different phone numbers
  2. Test edge cases like questions the agent shouldn’t answer
  3. Verify escalation works correctly
  4. Check response quality across different topics
  5. Monitor logs in the Dashboard under Agent > Execution Logs
Always test your agent before enabling it for production traffic. Poorly configured agents can frustrate customers.

Next Steps