Dograh

How to Build a Retell-Like Voice Agent With Open Source Tools

How to Build a Retell-Like Voice Agent With Open Source Tools
TutorialDecember 4, 2026·13 min read

How to Build a Retell-Like Voice Agent With Open Source Tools

Abhishek Kumar
Abhishek Kumar·Co-founder, Dograh AI

Co-founder of Dograh, building the future of open-source voice AI agents. Own your voice AI stack.

To build a Retell-like voice agent with open-source tools, map each Retell part to an open platform feature, such as nodes and pathways for the flow and API tools for functions. For one platform that covers the whole map, Dograh, the open-source AI voice agent platform, matches each part. Self-host it or run it on Dograh Cloud.

Key Takeaways

  • Map Retell's parts by what they do, then build each one as a Dograh step.
  • Post-call fields come from extraction on each node, sent on by a Webhook node.
  • Transfers only run on a real phone call, so test them on a line.

Retell splits a call into nodes, functions, files and post-call fields, and many teams like building agents that way. Here we build a Retell-like voice agent, step by step, in Dograh, our open-source AI voice agent platform. Then we talk about testing it on a phone line before launch.

What you need before you start

These steps follow the published Dograh and Retell docs. Run them on a trial server before production, with a test phone number, so no real caller meets a half-built 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 the agent will call, and your documents as files. Our example is a car service center whose agent books service slots, says whether a car is ready, answers warranty questions and hands harder calls to a service advisor. If you already run agents on Retell, our guide on how to migrate from Retell AI covers the export and the number switch, while this post starts fresh.

How Retell's parts map to Dograh

Retell builds an agent from a few kinds of parts, and Dograh has a matching feature for each. In Retell's Conversation Flow, conversation nodes talk, subagent nodes talk and use tools, function nodes run API actions, logic nodes branch and end nodes close the call, while global settings hold the shared prompt. The steps below follow the table's order.

Retell partDograh featureWhere you set it
Conversation FlowA workflow of nodes joined by pathwaysCanvas tab
Global settingsGlobal node, shared by every node with Add Global Prompt onCanvas
Conversation and subagent nodesAgent nodes, each with its own prompt, tools and filesCanvas
Logic nodes and edge conditionsPathways, each with a condition in plain wordsCanvas
Function nodes and custom functionsExternal HTTP API toolsTools
MCPMCP Server toolsTools
Knowledge baseKnowledge Base Files, picked on each nodeFiles, then the node
Transfer callTransfer Call toolTools
Agent swapTransfer To Agent toolTools
Post-call analysisVariable extraction, call disposition and the QA nodeNode settings, Settings, Canvas
WebhooksWebhook nodeCanvas
DialerCampaignsCampaigns
Web call and chat widgetAdd to Website, with a Voice or Chat widgetSettings

Writing the speech pipeline yourself, instead of mapping these parts to a platform, is the other route. A Salesforce AI Research tutorial builds one in 9 chapters of code and reaches about 755 ms to first audio, which suits a team that wants to own the speech loop.

Step 1: Run Dograh on your server or Dograh Cloud

Self-hosting keeps the platform and the call records on servers you control. Dograh is open source under the BSD 2-Clause license. The Docker Compose setup runs it on one server with at least 8 GB of RAM and 4 vCPUs, and a server with a public IP gets a free, trusted HTTPS certificate during setup. Enterprise plans also cover on-prem deployment, and Dograh Cloud is the same product with nothing to install.

Self-hosting Dograh means no per-minute platform fee. Servers, model keys and phone minutes still cost money, and your team looks after the database and upgrades. Support on the open-source version comes from the community, and Enterprise adds 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, Files and Campaigns.

Step 2: Draft the flow in the Agent Builder

Start from a plain description of the call. In Voice Agents, select Create Agent, then Use Agent Builder, or Blank Canvas if you would rather draw the flow yourself. The Agent Builder runs on Dograh's models, so a self-hosted install connects to a free Dograh account to use it.

In the builder, describe the agent in plain language, something like "Build me an agent that answers calls for Riverside Auto Service, books service slots, tells callers if their car is ready and hands warranty disputes to an advisor". After a few questions it shows Your agent requirements, with the information to collect, the business rules, the successful outcome and assumptions to confirm. Read it like a spec, then select Approve & build, or Request changes, and it builds the flow. Later edits save as drafts, and you can fine-tune any node on the canvas. Our first-agent walkthrough shows the builder on a simpler agent.

Check: The editor shows Builder, Canvas, Model, Variables and Settings tabs, and the canvas has a Start Call node and Agent nodes.

Dograh

Open Source Alternative to Vapi / Retell

Self-hosted voice agent platform — no per-minute fees

dograh-hq/dograh

Star on GitHub

Step 3: Write the global prompt and the nodes

Retell's global settings become a Global node, and its conversation and subagent nodes become Agent nodes. Put the persona and house rules in the Global node, such as "You speak for Riverside Auto Service. Keep answers short. Never quote a repair price." Its prompt is added to every Agent node with Add Global Prompt switched on, which is the default.

Give each job its own Agent node, such as booking or car status, and keep each prompt to that job, for example "confirm the registration and the surname on the booking before reading any job details". Pathways join the nodes, and the AI picks the one whose condition matches the conversation. Write each condition as a clear event, such as "The caller has given a registration and wants to know if the car is ready", never "caller responds", since vague conditions send calls to the wrong node.

Lines that must be said word for word, such as a recording notice, go in the Greeting Text on the Start Call node. Inside an Agent node, the AI writes its own sentences.

Check: Every Agent node has an outgoing pathway, and each condition names a specific event.

Step 4: Pick the models for the agent

Models are chosen per agent. New accounts start on Dograh's own models, which need no keys. To use your own accounts, add each key on the Providers page with Add Provider, then open Models and select Add Configuration.

Each configuration has a mode. In Dograh mode the platform runs the transcriber, LLM and voice for you, BYOK uses your own providers, and Realtime uses one speech-to-speech model that listens and replies. Retell offers speech-to-speech models too, and the Realtime options include OpenAI, Google, Azure, Grok, Ultravox and AWS Nova Sonic. Select Make org default, or pick the configuration in the agent's Model tab under Preset configuration. Your own keys put the model contract in your name, while the audio still goes to those providers, so in-house audio means open-weight models on your own servers.

Check: A browser test speaks in the voice of the configuration you picked.

Step 5: Turn functions into HTTP API tools

Retell's function nodes and custom functions become tools the agent calls mid-call. Open Tools, select Create Tool and pick External HTTP API. Give it a name, a description, your endpoint's URL and method, any Authentication, and the parameters the AI fills, each with a type and a description, as the HTTP API tool page lists.

Write the description as a rule, such as "Use after the caller confirmed the registration and the surname on the booking, to check whether the car is ready." For bookings, add a Preset Parameter named workflow_run_id with the value {{initial_context.workflow_run_id}}, so your system can ignore a repeated request. Attach the tool to the right Agent nodes under the node's HTTP & Tools tab.

The agent gets your endpoint's whole reply, so return only what it should say. The reply below gives it two fields, ready and ready_time, plus the masked registration.

{
  "ready": false,
  "ready_time": "16:30",
  "registration": "AB12XXX"
}

What this does: The agent can say "Your car will be ready at 4.30 this afternoon." Leaving out job notes and prices keeps the reply short and keeps private details off the call.

A tool waits 5 seconds by default and does not retry, so an error goes back to the agent, which can offer a callback. For a slower 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 to your endpoint before any caller does. An MCP server you already run becomes an MCP Server tool. For a lookup before the greeting, Pre-Call Data Fetch, at the bottom of the Start Call node, sends a POST with the caller's details to an endpoint you run.

Check: Test Tool returns your sample reply, and a browser test that asks "Is my car ready?" shows the tool call in the transcript.

Step 6: Load the knowledge base files

Answers about opening hours and warranty rules belong in files rather than in the prompt. Open Files, the page headed Knowledge Base Files, and upload PDF, DOCX, DOC, TXT, JSON or Markdown files of up to 5 MB each. Full Document hands the agent the whole file, and Chunked Search fetches only the matching parts of a long one, using the embedding model in your model configuration.

Then open the questions node and pick the files under Knowledge Base Documents, since the agent searches only the files on its current node. Our post on knowledge-base grounding shows how to write files that read well aloud.

Check: In a browser test, "Do you do warranty work on hybrids?" gets the answer from your file.

Step 7: Hand calls to a person with Transfer Call

Some calls need a service advisor, such as a billing dispute. Create a Transfer Call tool, set the advisor's number or SIP address, attach it to the right nodes, and write the rule in the Global node, such as "Transfer when the caller disputes a bill or asks for a person."

Transfer Call 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. If nobody answers, the agent gets "transfer_failed" and the call goes on, so it can take a callback request through an HTTP API tool.

The advisor hears nothing about the call by default, so have an HTTP API tool write the reason to your job system first. On Twilio you can switch on a short spoken introduction, off by default, which both the caller and the advisor hear, so keep it to details both may hear. To move a call to another Dograh agent instead, the Transfer To Agent tool hands it over with the conversation so far.

Check: On a real phone call, "I want to speak to someone about my bill" writes a note to your system, then rings the advisor.

Join the Dograh Community

Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.

Step 8: Rebuild post-call analysis

Retell's post-call analysis gives a summary, sentiment, whether the call succeeded and whether it reached voicemail, plus custom fields typed Boolean, Text, Number or Selector. In Dograh, each comes from a setting on the agent.

Custom fields come from variable extraction. In an Agent node, switch on Enable Variable Extraction, write an Extraction Prompt and list the Variables to Extract, each a string, number or boolean with a hint, as the Agent node page shows. A Selector becomes a string whose hint lists the allowed values. Extraction is an AI step, so it records the answer as the caller gave it, and the transcript and recording stay the exact record.

A caller on the phone with an AI agent gives a car registration and asks for a service slot. An AI extraction step writes the registration, whether service was booked and the call outcome onto a record card, which goes after the call to the job board in a car service workshop, while the call transcript and recording are filed in a folder as the exact record.
The fields your job system receives hold whatever the caller said, in the caller's own form. When a value is in doubt, the transcript and the recording settle it.

The outcome comes from "Extract call disposition at the end of the call" in Settings, which sorts each call into an outcome from your list, as our post on call disposition codes explains. A QA node scores each node with tags, a 1 to 10 score, sentiment and a summary, on a random share of calls set by its Sample Rate.

A Webhook node sends the results on. The Payload Template below sends the run ID and two extracted fields, using {{gathered_context.x}} for each one.

{
  "run_id": "{{workflow_run_id}}",
  "registration": "{{gathered_context.registration}}",
  "service_booked": "{{gathered_context.service_booked}}"
}

What this does: After each call, your job system gets one record with the car and whether a slot was booked. Dograh also adds a call_disposition key with the outcome when the template does not set one.

The Webhook node retries temporary failures, up to five attempts in all, and also fires on every try that goes unanswered. Voicemail handling sits in Settings under "Enable voicemail and screening handling".

Check: A finished test call creates one record at your endpoint, with the extracted fields and an outcome.

Step 9: Test it, then connect a number

Put sample values in the Variables tab, select Test Agent, then talk to it in Test Audio or type in Test Chat. Try each job several ways. Transfers only run on a phone call, and most phone calls still reach the agent as 8 kHz audio, while a browser test runs at 16 kHz, so a word heard clearly in the browser can come through wrong on a call. Connect your carrier under Telephony and set the number's Inbound workflow to this agent.

For outbound lists, Retell marks batch calls deprecated and offers the Dialer, which adds retries and per-contact tracking. Dograh runs the same job through Campaigns, 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, and set Max Retries, Retry Delay and Retry On yourself.

Check: A real call books a test slot, and one transfer connects while another rings out.

Before you ship it

Start with one line or with after-hours calls, and keep a person on the main number for the first weeks. In our work with teams, QA on a random 5 to 10% of live calls catches most problems without burying anyone in reviews.

When callers ask something nobody planned for, add a file or a node, test it, then publish. To put the same agent on your website, Add to Website in Settings gives it a Voice or Chat widget.

Glossary

Pathway
A link between two nodes in a Dograh workflow. The AI follows it when its plain-language condition matches the conversation.
Global node
Dograh's shared prompt for persona and house rules, added to every Agent node that has Add Global Prompt switched on.
Variable extraction
A node setting where an AI step writes named values, such as a registration, from the conversation into the call's record after the node ends.
Call disposition
The outcome label for a finished call, chosen from a list you set, such as booked, not_ready or transferred.

Frequently Asked Questions

Get started with Dograh

Build, deploy, and scale AI agents with Dograh. Join the community of developers building the future.