To build a Vapi-like voice agent with open-source tools, rebuild each assistant as a visual flow, turn squads into nodes or separate agents joined by a handoff tool, and point tools at your own endpoints. Teams leaving Vapi can do each of these in Dograh, the open-source AI voice agent platform, and self-host it or run it on Dograh Cloud.
Key Takeaways
- Keep one agent with several nodes until a job needs its own voice or tools.
- Dograh's Transfer To Agent carries the labeled transcript, so the next agent need not re-ask.
- End-of-call data goes out through a Webhook node, which retries temporary failures.
Vapi builds a voice agent from assistants, squads and tools, and that model works well for many teams. Here we build a Vapi-like voice agent, step by step, in Dograh, our open-source AI voice agent platform. Then we talk about starting outbound calls, testing on a phone line and launching.
What you need before you start
These steps follow the Dograh and Vapi docs. Try them on a trial server with a test number before any customer line points at the agent.
You need a server of your own or a Dograh Cloud account, a number on Twilio, Telnyx, Plivo, Cloudonix or Asterisk ARI for transfers, the API endpoints your tools will call, and an endpoint that takes end-of-call data. Our example is Northline Broadband, a home internet provider whose line has reception, billing and tech support. If you already run assistants on Vapi, our guide on how to migrate from Vapi covers the export and the number moves, while this post builds from Vapi's concepts.
Writing the pipeline yourself is the other route. A freeCodeCamp tutorial chains speech, language and voice models, with an open-source option for each, into an agent for web and device clients, which suits a team that wants to own each model. A platform suits a team that wants Vapi's assistant and squad model with the phone side done.
How Vapi's parts map to Dograh
Vapi retired Workflows on 18 August 2026, pointing its users to Assistants or Squads. Dograh builds the call as a visual flow of nodes and pathways on its Canvas tab, and the Agent Builder can draft that flow from a description, so you see the whole call on one screen.
The table maps Vapi's parts by what they do. Tool names follow Vapi's tool types, and the steps below follow the table's order.
| Vapi part | Dograh feature | Where you set it |
|---|---|---|
| Assistant | Agent, drawn as a workflow | Voice Agents, Canvas tab |
| System prompt | Global node for persona and rules, Agent nodes for each task | Canvas |
| First message | Greeting Text, or a pre-recorded clip | Start Call node |
| Squad members on one job | Agent nodes joined by pathways | Canvas |
| Squad member with its own role | A separate agent, reached by Transfer To Agent | Tools |
| Handoff tool | Transfer To Agent tool, one per destination | Tools |
| API Request and Function tools | External HTTP API tools | Tools |
| MCP tools | MCP Server tools | Tools |
| Transfer Call tool | Transfer Call tool | Tools |
| Hang Up tool | End Call tool or End Call node | Tools, Canvas |
| Query tool | Knowledge Base Files on the node | Files, then the node |
| Voicemail tool | Voicemail handling | Settings |
| end-of-call-report | Webhook node | Canvas |
| assistant-request | Pre-Call Data Fetch | Start Call node |
| Create call API | API Trigger node, or Campaigns for lists | Canvas, Campaigns |
Step 1: Run Dograh on your server or Dograh Cloud
Open code means you can read, change and run the platform itself. Dograh is open source under the BSD 2-Clause license, and the Docker Compose setup runs it on one server with at least 8 GB of RAM and 4 vCPUs. A server with a public IP gets a free, trusted HTTPS certificate during setup. On-prem deployment comes with Enterprise plans, and Dograh Cloud gives you the same product without an install.
A self-hosted Dograh carries no per-minute platform fee. Servers, model keys and phone minutes still cost money, and your team looks after the database and upgrades. The open-source community backs the free version, and Enterprise plans add custom SLAs. Dograh Cloud runs everything for a 1¢-a-minute platform fee.
Check: You can sign in, and the sidebar shows Voice Agents, Tools and Telephony.
Step 2: Draft the assistant as a visual flow
Describe the assistant, and let the builder draw the first flow. Open Voice Agents, select Create Agent and choose Use Agent Builder, or Blank Canvas to draw it yourself. The Agent Builder runs on Dograh's models, so a self-hosted install connects to a free Dograh account to use it.
In plain language, write something like "Build me an agent that answers calls for Northline Broadband, verifies the account holder, explains bills and reports outages". It shows Your agent requirements, with the information to collect, the business rules, the successful outcome and assumptions to confirm. Select Approve & build, or Request changes, and it draws the flow. Later edits save as drafts you can fine-tune on the canvas.
Then split what a Vapi system prompt held. Persona, tone and rules go in the Global node, which is added to every Agent node with Add Global Prompt on. Each task gets its own Agent node, and the first message goes in the Greeting Text on the Start Call node, which is spoken word for word.
Check: The Canvas tab shows Start Call, a Global node and one Agent node per task, joined by pathways.
Open Source Alternative to Vapi / Retell
Self-hosted voice agent platform — no per-minute fees
dograh-hq/dograh
Star on GitHub
Step 3: Turn a squad into nodes or separate agents
A Vapi squad can become either shape in Dograh, and the choice follows what each member needs. Vapi's squads are assistants that hand a call to each other with handoff tools. In Dograh, keep one agent with several Agent nodes when the members share a voice, a model and tools, as Northline's reception and billing steps do. Pathways move the call between nodes, and each node can carry its own tools and files.
Split into separate agents when a member needs its own voice, model, tools or phone number, or when another team owns it. Northline's tech support fits, since it has its own diagnostic tools. Build the tech support agent first. Then open Tools, select Create Tool, choose Transfer To Agent, pick the destination under Transfer to agent, and write a description that says exactly when to hand over, such as "The caller reports no internet or slow speeds after verification." Make one tool per destination.

The tool also takes a Handover message the current agent speaks, such as "Let me put you through to tech support." The destination opens in one of three greeting modes, Play its greeting, then wait, Continue the conversation, or Introduce itself, then continue. It receives a labeled transcript of the call so far, so tell its prompt not to ask again for what the caller gave. The Transfer to Agent page lists every setting.
Transfer To Agent runs on cascade agents, those with separate speech-to-text, language and voice models, including browser test calls. Our post on multi-agent voice AI covers router design and what carries over at the handoff.
Check: In a browser test, "my internet is down" after verification moves the call to tech support, which does not ask for the account again.
Step 4: Pick the models for each agent
Each agent has its own model setup, the way each Vapi assistant does. New accounts start on Dograh's own models. To use your own accounts, add keys on the Providers page with Add Provider, then open Models, select Add Configuration and pick a mode, Dograh, BYOK for your own providers, or Realtime for one speech-to-speech model. Pick it in each agent's Model tab under Preset configuration, and keep agents in a handoff chain on cascade models.
Check: Each agent's Model tab names the configuration you picked.
Step 5: Rebuild the tools
Most Vapi tools have a Dograh tool that does the same job. API Request and Function tools become External HTTP API tools, created under Tools with a name, a description, the URL and method, Authentication and the parameters the AI fills, as the HTTP API tool page lists. Dograh calls your endpoint directly with those parameters and gives the agent the whole reply, so return only what the agent should say.
Write each description as a rule, such as "Use only after the caller gave the account number and the ZIP code on the account." A tool waits 5 seconds by default and does not retry, so an error goes back to the agent. For a slow lookup, set lines in the tool's Messages, under When the tool starts and While the tool is running. Test Tool sends a real request before any caller does. MCP tools become MCP Server tools, and a Send Text tool becomes an HTTP API tool that asks your own messaging provider to send the text.
Vapi's Transfer Call tool becomes Dograh's Transfer Call, which works on Twilio, Telnyx, Plivo, Cloudonix and Asterisk ARI. Dograh calls the destination first and connects the caller only when someone answers. It rings for 30 seconds by default, a time you can change, and if nobody answers the agent gets "transfer_failed" and the call goes on. On Twilio an optional spoken introduction, off by default, plays to both the caller and the person answering. Our call transfer and human handoff guide covers writing notes to your helpdesk first.
Hang Up becomes the End Call tool. The Query tool becomes Knowledge Base Files, uploaded under Files and picked on each node under Knowledge Base Documents. The Voicemail tool becomes "Enable voicemail and screening handling" in Settings.
Check: Test Tool returns your sample reply, and a browser test shows each tool call in the transcript.
Join the Dograh Community
Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.
Step 6: Replace server events with the Webhook node
Vapi sends events such as end-of-call-report and assistant-request to your server URL. In Dograh, end-of-call data goes out through a Webhook node on the canvas, with an Endpoint URL, Authentication and a Payload Template. Values the agent recorded come from Enable Variable Extraction on each Agent node. The template below sends the run ID, the account number the caller gave and the reason for the call.
{
"run_id": "{{workflow_run_id}}",
"account": "{{gathered_context.account_number}}",
"reason": "{{gathered_context.call_reason}}"
}
What this does: After every call, your ticket system gets one record with the account and the reason. Dograh also adds a
call_dispositionkey with the call's outcome when the template does not set one.
The Webhook node retries temporary failures, up to five attempts in all. It also fires on every unanswered try, marked no-answer or busy, so your system sees each attempt.
For assistant-request, which let your server shape the assistant per call, Dograh has Pre-Call Data Fetch at the bottom of the Start Call node. It sends a POST with the caller's details to an endpoint you run, which can return the caller's name and plan before the greeting. Each phone number points at one agent through its Inbound workflow setting.
Check: A finished test call creates one record at your endpoint, and an unanswered call creates one marked no-answer.
Step 7: Start outbound calls with the API Trigger
Vapi's create-call API maps to an API Trigger node. Add one to the canvas, and it gives two URLs, a test URL that runs the latest draft and a production URL that runs the published agent. The request below calls the test URL with the number to dial and two values for the greeting, sent in initial_context.
curl -X POST https://your-dograh-instance/api/v1/public/agent/test/{uuid} \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{
"phone_number": "+1415555XXXX",
"initial_context": { "customer_name": "Jane", "plan": "Fiber 500" }
}'
What this does: Dograh dials the number on the draft agent, and the greeting can use
{{customer_name}}with a fallback, so Jane hears her name. Switch to the production URL once the agent is published.
Values you passed per call through assistantOverrides become template variables in initial_context. Our post on API triggers covers the response and errors. For a list, Campaigns dial from a CSV with a phone_number column. Each campaign runs its Call Schedule in one Timezone. It starts on your browser's time zone, or your last scheduled campaign's, so set it to your callers' zone. Max Retries, Retry Delay and Retry On are yours to set as well.
Check: The test URL rings your phone, and the agent greets you by the name you sent.
Step 8: Test it, then connect a number
Fill the Variables tab with sample values and select Test Agent. You can speak to the agent in Test Audio or type to it in Test Chat. Handoffs between agents work in the browser, but Transfer Call needs a real phone call. Most phone calls still reach the agent as 8 kHz audio, while a browser test runs at 16 kHz, so test speech on a phone line too. Connect your carrier under Telephony and set the number's Inbound workflow to the reception agent.
Check: A real call reaches reception, hands off to tech support, and one transfer to a person connects.
Before you ship it
Start with one line or after-hours calls, and keep people on the main number for the first weeks. Score a random 5 to 10% of live calls with a QA node, which in our work with teams is enough to catch most problems. Add a QA node to each agent in the chain, since each one has its own prompts to check.
When transcripts show a question nobody planned for, change the node or tool that should handle it, test it on the draft, then publish. The published agent keeps running until you do.
Glossary
- Transfer To Agent
- A Dograh tool that hands a live call to another Dograh agent, with a labeled transcript of the conversation so far.
- Greeting mode
- The setting that decides how the destination agent opens after a handoff, with its greeting, straight from the history, or with a short introduction.
- Handover message
- The line the current agent speaks before Transfer To Agent moves the call, such as 'Let me put you through to tech support.'
- Test URL
- The API Trigger address that runs the latest draft of an agent, so changes can be tried before they are published.

