Documentation Index
Fetch the complete documentation index at: https://docs.zavu.dev/llms.txt
Use this file to discover all available pages before exploring further.
Functions
A Zavu Function is a serverless TypeScript snippet that runs in Zavu Cloud and reacts to messaging events or AI agent tool calls. You write the code locally, runzavu deploy, and seconds later your agent is live with tools backed by real business logic — no servers, no Docker, no webhook receivers to maintain.
What is a Zavu Function?
Think of a Function as the code-side counterpart to an AI Agent. Where an Agent decides what to say, a Function executes the actions the Agent needs — query a database, check inventory, book a reservation, call your own API.- Declare an agent in code with
defineAgent— config stays in sync with your repo. - Declare tools with
defineTool— handlers run inside Zavu Cloud when the LLM decides to call them. - React to events with
defineFunction—message.inbound,broadcast.completed, etc. - Auto-provisioned API key — the function can call any Zavu API endpoint without you handling credentials.
zavu deploy, done.
How it relates to AI Agents
| Need | Use |
|---|---|
| A no-code agent configured from the dashboard | AI Agents |
| An agent with custom business logic in your own code | Zavu Functions |
| Both — start no-code, evolve to code | Start with AI Agents, migrate when you need real tools or custom flows |
defineAgent call creates and keeps the agent config in sync with your code on every deploy. The dashboard surfaces “managed by function” on these agents and disables manual edits to prevent drift.
Mental model
- Fully managed runtime. Each function runs in Zavu’s serverless cloud. No consoles to log into —
zavu deployhandles bundling, dependencies, and publishing. - Internal invocation. When the agent calls a tool, we use signed internal invocations — your function is not publicly exposed. No HTTP, no HMAC secrets to rotate, no DDoS surface.
- Native event binding. Functions can also subscribe to Zavu events (
message.inbound,broadcast.completed, etc.) via triggers. - Auto-provisioned credentials. Every function gets a scoped
ZAVU_API_KEYin its environment so it can call our SDK without you handling key distribution.
Lifecycle
zavu fn init— scaffolds a project withindex.ts,package.json, and a.zavu/config that links the local directory to a Function record in your Zavu project.zavu fn secrets set KEY value— encrypts and stores secrets that will be injected as env vars at runtime.zavu deploy— bundles your code + dependencies, ships them to Zavu Cloud, syncs the agent + tool declarations from your code into your project, and starts serving traffic. The dashboard reflects the new state immediately.zavu fn logs --tail— streams runtime logs from invocations as they happen.zavu fn versions— list deploys and roll back to any previous one.
Pricing model
Functions are metered by invocation units, where one unit equals one invocation of a 128 MB function. Higher memory configs cost proportionally more units per invocation — a 256 MB function costs 2 units per invocation, 512 MB costs 4, 1024 MB costs 8. Each paid plan includes a generous monthly quota; overage is billed automatically on your next invoice via Stripe Meters.| Plan | Included units | Overage |
|---|---|---|
| Free | 100k | Hard cap — invocations blocked when reached |
| Hobby | 1M | $5 / 1M units |
| Standard | 5M | $4 / 1M units |
| Growth | 10M | $3 / 1M units |
Continue
- Quickstart — Full step-by-step from zero to live agent in 10 minutes.
- CLI reference — Every
zavucommand, flag by flag. - Defining agents —
defineAgentAPI, providers, prompts, models. - Defining tools —
defineToolAPI, schemas, handlers, error handling. - Secrets — Environment variables encrypted at rest.
- Triggers — Listen to Zavu events from your function.
- Runtime versions — How pinning works, when to upgrade.
- Advanced patterns — Persistent state, observability, retries, costs.
- Examples — Complete walkthroughs.
