Runnable examples of building agents on Zavu.
Zavu is an agent-first platform. Most of the people who read this repo are not
people. They are coding agents, writing code on top of Zavu to create other
agents. Every example here is written for that reader: one folder, no build
step, no framework, and a verify script that proves it worked.
Start with AGENTS.md if you are an agent.
| Example | What it proves | Costs money |
|---|---|---|
| 01-hello-agent | Zero to a live agent over REST. No browser, no CLI, no phone number. | No |
| 02-agent-as-code | defineAgent + defineTool, with a local harness that runs handlers before you deploy. |
No (deploy is free) |
| 03-voice-agent | A voice agent declared in code, a real outbound call, and its transcript. | The call only |
| 04-knowledge-base | RAG. Create a knowledge base, add documents, prove the answer was grounded. | No |
| 05-deterministic-flow | A flow: the steps you wrote, in the order you wrote them, when the model must not improvise. | No |
| 06-webhook-receiver | Both kinds of Zavu webhook: events into your backend, and the endpoint your agent's tool calls. Verification that accepts either signature format. | No |
| 07-transactional-notifications | An order update on the channel that reaches the customer, with fallback, idempotency and delivery tracked to your webhook. | The message only |
| 08-otp-verification | A login code: validate the number, send by SMS, read it aloud by voice when the text does not land. | The messages only |
| 09-sms-and-numbers | Two-way SMS from a number you own: search, buy, route it to a sender, send, read the cost. | The number and the message |
| 10-whatsapp-templates | Message first on WhatsApp: create a template, submit it to Meta, send it with variables and a URL button once approved. | The message only |
| 11-email-from-your-domain | Email from your own domain: DNS records by API, verify, attach an address to a sender, validate the recipient, send with HTML and an attachment. | The email only |
| 12-telegram-and-meta-channels | A Telegram bot connected with one request, and a Facebook Page's Messenger inbox connected through an invitation link. | No |
| 13-broadcast-campaign | One message to a list with per-contact variables, reviewed, scheduled or sent, followed to the last delivery. | The sends only |
| 14-inbox-and-contacts | A shared inbox in your backend: one contact per person, one thread per customer across channels, replies from the number they know. | The reply only |
| 15-scheduled-function | Your code on a cron schedule with nothing to host, texting the team when a check fails. | The alert only |
| 16-platforms-and-agencies | A project per client with its own key and spending cap, and one link for them to connect their WhatsApp or Page. | No |
Run 01 to 06 in order the first time: 01 creates the sender and agent
that 04, 05 and 06 reuse. 07 onwards are independent; each says at
the top what it needs and what it charges.
One thing: an API key.
export ZAVUDEV_API_KEY="zv_live_..."Get one from the dashboard under Settings, API keys. Everything in this repo reads that variable. Nothing here needs an interactive login.
Node 18 or newer. The examples use native fetch and have no dependencies
unless a README says otherwise.
Most examples cost nothing to run end to end, because Zavu separates what you can prove for free from what has to touch a carrier. The ones that send or buy say so in the table and gate that step behind an env var.
POST /v1/agents/{id}/test the agent's reply, nothing delivered, nothing charged
zavudev fn invoke --tool one tool handler, in the deployed runtime, no conversation
zavudev agents executions what actually ran, with tokens and cost
a real message or call everything else
test returns a warnings array. Read it. It is where Zavu tells you what a
dry run could not prove: a disabled agent, tools its channels will never call,
a sender with no channels. A green reply with warnings is not a working agent.
- One folder, self-contained. Copy the folder, not the repo.
AGENTS.mdin each. What to change, what not to change, how to verify..env.example. Every variable the example reads, with no secrets.node index.mjs. No build, no bundler, no install, unless stated.- Cleanup included. Examples that create resources can delete them again.
MIT.