Skip to main content

AI Agents Overview

AI Agents allow you to automate customer conversations using large language models. When a customer sends a message to your sender, the agent can respond intelligently, answer questions from your knowledge base, and execute actions via webhooks.

When to Use AI Agents

AI Agents are ideal for:
Use CaseDescription
Customer SupportAnswer common questions, troubleshoot issues, and escalate complex cases
Lead QualificationCollect contact information and qualify leads through conversation
Appointment BookingGuide customers through scheduling via conversational flows
FAQ AnsweringProvide instant answers using your knowledge base documents
Order StatusLook up orders and provide updates via webhook integrations

Supported Providers

Configure your agent with any of these LLM providers:
ProviderModelsNotes
OpenAIgpt-4o, gpt-4o-mini, gpt-4-turboMost popular, great general-purpose
Anthropicclaude-3-5-sonnet, claude-3-5-haikuExcellent reasoning capabilities
Googlegemini-1.5-pro, gemini-1.5-flashCost-effective for high volume
Mistralmistral-large, mistral-smallEuropean data residency option
ZavuManaged modelsNo API key needed, billed to your account
Using the Zavu provider means we handle the LLM API calls for you. Costs are charged directly to your Zavu balance at pass-through rates with no markup.

Quick Start

Here’s how to create an AI agent for a sender:
import Zavudev from "@zavudev/sdk";

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

// Create an agent for your sender
const agent = await zavu.senders.agent.create("sender_abc123", {
  enabled: true,
  provider: "openai",
  model: "gpt-4o-mini",
  systemPrompt: `You are a helpful customer support agent for Acme Corp.
Be friendly and concise. If you don't know the answer, say so.
For billing questions, ask the customer to email billing@acme.com.`,
  temperature: 0.7,
  contextWindowMessages: 10,
  triggerOnChannels: ["sms", "whatsapp"],
});

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

Agent Architecture

When a message arrives, the agent processes it through this flow:
                    Inbound Message
                          |
                          v
                  +---------------+
                  | Agent Enabled?|
                  +---------------+
                    |           |
                   No          Yes
                    |           |
                    v           v
              +---------+  +-----------------+
              | Webhook |  | Check Flow State|
              |  Only   |  +-----------------+
              +---------+       |         |
                          Has Active   No Active
                             Flow        Flow
                               |           |
                               v           v
                         +---------+  +-----------+
                         | Execute |  | Match Flow|
                         |   Step  |  |  Triggers |
                         +---------+  +-----------+
                               |           |
                               |      No Match
                               |           |
                               v           v
                         +---------+  +-----------+
                         |  Send   |  | Query KB  |
                         |Response |  | + LLM Call|
                         +---------+  +-----------+
                                           |
                                           v
                                     +-----------+
                                     |   Send    |
                                     |  Response |
                                     +-----------+

Key Components

LLM Configuration

Choose your AI provider and model. Configure system prompts, temperature, and context window size.

Conversational Flows

Create structured conversation paths for lead capture, booking, and multi-step processes.

Webhook Tools

Let the AI execute actions by calling your webhooks (check orders, create tickets, etc.).

Knowledge Base

Upload documents and FAQs. The agent uses RAG to find relevant context when answering.

Pricing

AI Agent costs are pass-through with no Zavu markup. You pay exactly what the providers charge:
ProviderModelInput CostOutput Cost~Cost per Message
OpenAIgpt-4o-mini$0.15/1M tokens$0.60/1M tokens~$0.0002
OpenAIgpt-4o$2.50/1M tokens$10/1M tokens~$0.003
Anthropicclaude-3-5-haiku$0.25/1M tokens$1.25/1M tokens~$0.0003
Anthropicclaude-3-5-sonnet$3/1M tokens$15/1M tokens~$0.005
Googlegemini-1.5-flash$0.075/1M tokens$0.30/1M tokens~$0.0001
For most use cases, gpt-4o-mini or gemini-1.5-flash offer the best balance of quality and cost. Reserve larger models for complex reasoning tasks.

Next Steps