# Introduction to Zavu

> Build and deploy AI agents that answer on WhatsApp, SMS, voice, email, Telegram and Messenger. One API, one webhook contract, one bill.

## What Zavu is

Zavu is the communication layer for humans and agents.

You get two things, and they are the same platform:

- **An API for messages.** Send and receive on WhatsApp, SMS, voice, email,
  Telegram, Instagram and Messenger through one integration.
- **A runtime for agents.** Declare an agent in TypeScript, deploy it with one
  command, and it answers on those same channels. Including phone calls.

Most teams start with one and end up using both. The agent that answers a
WhatsApp thread is the same object that answers the phone, and the message you
send by hand goes out the same pipe.

## Three ways to build

There is no wrong entry point. Pick the one that matches where your code lives,
or skip the code entirely.

  - [Deploy on our infra](https://www.zavu.dev/docs/quickstart): Write `defineAgent` and `defineTool` in a file, run `npx zavudev deploy`. Zavu runs the code, holds the conversation, and calls your tools.
  - [Call our API from yours](https://www.zavu.dev/docs/quickstart-messaging): Keep your stack. Use the REST API or an SDK to send, receive, and drive conversations from your own backend.
  - [Use an integration](https://www.zavu.dev/docs/guides/integrations/overview): n8n and more. Connect an account, switch on what you need, write nothing.

## Ship an agent

```ts
import { defineAgent, defineTool } from "@zavudev/functions"

defineAgent({
  senderId: process.env.SENDER_ID!,
  name: "Bella",
  provider: "zavu",
  model: "openai/gpt-4o-mini",
  prompt: "You are Bella, host at the pizzeria. Keep it short.",
  channels: ["whatsapp"],
})

defineTool({
  name: "check_availability",
  description: "Get free reservation slots for a date and party size.",
  parameters: {
    type: "object",
    properties: {
      date: { type: "string" },
      partySize: { type: "number" },
    },
    required: ["date", "partySize"],
  },
  handler: async ({ date, partySize }) => {
    // your real booking logic: DB, POS, external API, whatever
    return { available: true, slots: ["19:00", "21:00"] }
  },
})
```

```bash
npx zavudev deploy
```

Your code is the source of truth. Every deploy reconciles the live agent to
match what the file declares, so an agent you delete from the code is deleted
for real. See [How agents work](https://www.zavu.dev/docs/concepts/agent-architecture).

Not starting from scratch? `npx zavudev agents pull fermi` drops a ready-made
agent into your project as editable code. Seven of them ship today, for sales,
support, and front desk. See [Factory agents](https://www.zavu.dev/docs/guides/functions/factory-agents).

## Send a message

```typescript
import Zavudev from '@zavudev/sdk';

const zavu = new Zavudev();

await zavu.messages.send({
  to: "+14155551234",
  text: "Your order #1234 has shipped!"
});
```

No channel specified means `auto`: Zavu scores the channels your sender can
reach the recipient on and sends through the one that wins on cost and
deliverability, with fallback if it fails. See
[Smart routing](https://www.zavu.dev/docs/guides/sending-messages/smart-routing).

> **Note:**
> This page and the SDKs use API v1. [API v2](https://www.zavu.dev/docs/api-v2/overview) is a smaller
> version of the same API: you send from an address instead of a sender, and one
> webhook covers the project. Both are supported, and you can mix them.

## Channels

| Channel | Best for | Agents |
|---------|----------|--------|
| **WhatsApp** | Rich media, templates, high engagement | Yes |
| **SMS** | Universal reach, alerts, OTP, no internet required | Yes |
| **Voice** | Two-way phone calls, text-to-speech alerts | Yes |
| **Email** | Transactional and marketing mail, attachments, replies | Yes |
| **Telegram** | Bot messaging, large file sharing | Yes |
| **Messenger** | Facebook Page and Marketplace conversations | Yes |
| **Instagram** | Direct messages on a Business account | Yes |

Every channel shares one send contract, one set of
[webhook events](https://www.zavu.dev/docs/guides/receiving-messages/events), and one bill.

## Build with your coding agent

Zavu is designed to be operated by the agent you already code with. Give it the
skills and it writes correct Zavu code on the first try, instead of guessing at
endpoints.

```bash
npx skills add zavudev/zavu-skills
```

Fifteen skills cover agents, functions, voice, channels, conversations,
memory, webhooks, templates, broadcasts, contacts, phone numbers and API v2.
The agent acts on your account through the [CLI](https://www.zavu.dev/docs/guides/cli/overview): skills
decide what to do, the CLI does it.

## Next steps

  - [Agent quickstart](https://www.zavu.dev/docs/quickstart): Deploy an agent that answers a real channel, in about ten minutes
  - [Messaging quickstart](https://www.zavu.dev/docs/quickstart-messaging): Send your first message from your own backend
  - [How agents work](https://www.zavu.dev/docs/concepts/agent-architecture): From TypeScript on your machine to an agent answering a phone call
  - [CLI](https://www.zavu.dev/docs/guides/cli/overview): Every resource in the API, from your shell and your CI
  - [Authentication](https://www.zavu.dev/docs/authentication): API keys, environments, and the sender header
  - [API reference](https://www.zavu.dev/docs/api-reference): Every endpoint, with a live playground
  - [Integrations](https://www.zavu.dev/docs/guides/integrations/overview): n8n, Vercel and more, with no code to write
