To build an AI customer support agent for phone calls, scope the calls it takes, load policies into a knowledge base, add a verified order lookup and handoff rules, then test on a real line. To keep support calls on your own servers, self-host Dograh, the open-source AI voice agent platform, or run it on Dograh Cloud.
Key Takeaways
- Sort every call reason into a document answer, a lookup or a person.
- Verify the caller before the agent reads out any order details.
- Dograh calls the destination first and connects the caller only when someone answers.
On most support lines, a handful of questions come up again and again, and the rest need a person. This guide builds an AI customer support agent for phone calls in Dograh, our open-source AI voice agent platform, one step at a time, then covers testing and a first rollout.
What you need before you start
These steps follow the published Dograh docs. Run them on a trial server before production, with a test number and a copy of your order system, so the first real customer never meets a half-built agent.
You need a place to run Dograh, either your own server or Dograh Cloud, and a phone number on a carrier where it can hand calls to a person, which means Twilio, Telnyx, Plivo, Cloudonix or Asterisk ARI. You also need an API your agent can ask about orders or accounts, your policy documents as files, and a phone number or SIP address for the team that takes escalated calls.
The build here is generic on purpose, so it fits a software company, a utility or a retailer with one order API. If you sell on Shopify, our post on building a voice agent for e-commerce support walks through that version, with returns and the store's own data.
Step 1: List the calls the agent should take
Scope comes before the build. Pull your last month of call logs or tickets, list the top reasons people call, and mark each reason with where its answer lives. Some answers are in a document, such as the returns window. Some need a lookup, such as where an order is. Some need a person, such as a complaint or a billing dispute.
A scope worksheet like the one below, an example we wrote, keeps the build honest.
| Call reason | Answer comes from | What the agent does |
|---|---|---|
| Where is my order? | Order API | Verifies the caller, then reads the status |
| What is your return window? | Returns policy file | Answers from the Knowledge Base |
| Change my delivery address | Order API | Verifies, then updates it through a tool |
| I was charged twice | A person | Writes the details, then transfers |
| I want to cancel my account | A person | Writes the details, then transfers |
Each row becomes part of the build. Document rows go into the Knowledge Base, lookup rows become HTTP API tools, and person rows become handoff rules.

People still want the person rows handled well. In Verint's State of Customer Experience 2026 survey of 5,000 US consumers, 61% said they prefer a human agent, and 69% of those said they would use automated self-service if it could fully resolve their issue. So the agent's job is to resolve the rows it can, completely, and hand over the rest quickly. Our post on which support calls to automate argues that split in more depth.
Check: Every common call reason has one row, and each row names a document, a lookup or a person.
Step 2: 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, and the Docker Compose setup starts it on one machine with at least 8 GB of RAM and 4 vCPUs. Enterprise plans also cover on-prem deployment. Dograh Cloud is the same product with nothing to install.
Dograh runs the call itself, meaning the flow, the tools and the phone connection, while the speech and language models sit in a separate layer that you pick. Self-hosting Dograh with your own provider keys keeps the platform in-house, while the audio still reaches those providers. For full control of the data, run open-weight models on your own servers too.
Here is what each choice costs. When you self-host Dograh, there is 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 you for a 1¢-a-minute platform fee. Either way, 10 calls can run at once to begin with, and a self-hosted install can raise that with the DEFAULT_ORG_CONCURRENCY_LIMIT setting.
Check: You can sign in to the Dograh dashboard, and Telephony in the sidebar shows your carrier's number.
Step 3: Create the agent in the builder or the canvas
The agent starts from a description of the job. On Dograh Cloud, and on a self-hosted install connected to a free Dograh account, new agents start in the Agent Builder. You can also start from a blank canvas.
The Agent Builder runs on Dograh's hosted models, so on a server with no internet access you build on the canvas. In the builder, describe the support line in plain words, for example "Build me an agent that answers support calls for Acme, checks order status after verifying the caller, answers policy questions and transfers billing disputes to our team". It may ask a few questions, then shows Your agent requirements with the information to collect, the business rules and the outcome. Read it closely, then select Approve & build.
Whichever way you start, split behavior from knowledge. Rules about how the agent acts go in the Global Node, whose prompt is added to every step that has Add Global Prompt switched on. That is where the persona, the tone and the handoff rules from Step 6 live. Facts such as the returns window go into files instead, which keeps the prompt short and the facts easy to update.
Check: The editor shows Builder, Canvas, Model, Variables and Settings tabs, and the canvas has a Start Call node and a Global Node.
Open Source Alternative to Vapi / Retell
Self-hosted voice agent platform — no per-minute fees
dograh-hq/dograh
Star on GitHub
Step 4: Load your policies into the Knowledge Base
Policy answers come from documents, not from the prompt. Open Files in the sidebar, the page headed Knowledge Base Files, and upload your returns policy, shipping rules and FAQ. Dograh takes PDF, DOCX, DOC, TXT, JSON and Markdown files up to 5 MB each.
Each file gets a mode. Full Document gives the agent the whole file, which suits short policies. Chunked Search splits a long file into pieces and fetches only the matching ones, and it needs an embedding key. Then open the node that answers policy questions and pick the files under Knowledge Base Documents, as the Knowledge Base page describes. The agent searches only the files attached to the node it is on, so attach each file where its questions come up.
Files written for the eye often read badly aloud. Short sentences and one fact per line work better, which our post on knowledge bases for voice agents covers in detail.
Check: In a browser test, "How long do I have to return something?" gets the window from your file.
Step 5: Look up orders after verifying the caller
Order details are personal data, so the agent finds the record first and proves the person second. Pre-Call Data Fetch, at the bottom of the Start Call node, can ask your API for the account that matches the caller's number before the greeting. Set it to Inbound calls only, add your Endpoint URL and an Authentication credential. The request carries the caller and called numbers, the caller hears ringing while it runs, and if your API fails the call goes on without the data.
A phone number finds a record, but it does not prove who is calling. So the call runs greet, verify, disclose. The agent asks for a check you approve, such as the last digits of the account number or the email on file, and an HTTP API tool named verify_customer sends that answer to your API, which replies with a yes or no. Your system does the comparing, not the model.
Only then does a second tool, get_order_status, fetch the order. Create both under Tools in the sidebar and attach them to the node under Tools. Write each Description as a rule, such as "Use only after verify_customer returned verified true." The default timeout is 5 seconds, and the tool does not retry, so an error goes back to the agent, which apologizes and offers a callback. For a slow API, the tool's Messages play a short line as it starts, and an update if it runs long.
Check: In a browser test, asking "Where is my order?" leads to the verification question first, and the status is read out only after a correct answer.
Step 6: Write the handoff rules and add Transfer Call
A good handoff is part of the service. 87% of customers in a Gartner survey said it is essential for companies using GenAI in customer service to offer a way to reach a human agent. So write the rules in the Global Node prompt, where every step sees them. Transfer when the caller asks for a person, when the reason is on your person list, when verification fails twice, or when the caller is upset and the agent cannot fix it.
Then add the Transfer Call tool, set the destination to your team's number or SIP address, and attach it where the rules apply. 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 in the tool, and if no one picks up the result is "transfer_failed" and the call goes on with the agent, which takes a callback request through an HTTP API tool.
The person answering hears nothing about the call by default. Before the transfer, have an HTTP API tool write the caller's reason and verified details to your helpdesk, so the ticket is open when they pick up. On Twilio you can also switch on a short spoken introduction, off by default, which both the caller and the person answering hear, so keep it to details both may hear. If calls need different specialist agents rather than a person, see our guide to multi-agent voice AI.
Check: On a real phone call, saying "I was charged twice" opens a ticket in your helpdesk, then rings the team's line.
Join the Dograh Community
Dograh is an OSS alternative to Vapi. Join our Slack community for queries, releases, best practices & community interactions.
Step 7: Send each call's outcome to your helpdesk
Every call should leave a record, including the ones the agent solved alone. Add a Webhook node on the canvas, point its Endpoint URL at your helpdesk or your own service, and write a Payload Template with the run ID, the outcome and the values the agent recorded. It runs after each call ends and retries a failed delivery, up to 5 attempts in total.
Add a QA node too. It scores each step of a call separately, with tags, a 1 to 10 score, sentiment and a summary, and its Sample Rate setting picks a random share of calls, which keeps the review load small once volume grows.
Check: A finished test call creates one record at your endpoint, with the outcome and the run ID.
Step 8: Test in the browser, then on a real phone line
Browser tests are fast, and phone tests are honest. Put sample values on the Variables tab, then use Test Agent in the editor to try 15 to 20 ways of asking each question on your worksheet, including rambling and half-finished ones. Fix the prompt or the tool descriptions after each failure, not after the whole batch.
Then call the agent with Phone Call. Transfers do not run on browser test calls, so the handoff rules can only be checked on a real line. Phone audio also changes things. Most phone calls reach the agent at 8 kHz, against 16 kHz in a browser test, so a word the agent heard clearly in the browser may come through wrong on a call.
Open View Trace on a run to see the speech-to-text, AI and voice time for each turn. A slow turn usually points to the order API or a long prompt, and the trace shows which.
Check: Every worksheet row passes on a real phone call, including one transfer that someone answers and one that nobody does.
Before you ship it
Start small. Put the agent on one support line, or on after-hours calls only, for the first weeks, and keep a person on the main line. Read a sample of transcripts every week. In our own work with teams, QA on a random 5 to 10% of live calls catches most problems without drowning anyone in reviews.
Track how many calls the agent closes without a person, using the definition in our post on call containment rate, and how many transfers fail for lack of an answer. A falling containment rate after a policy change usually means a file in the Knowledge Base is out of date.
Then widen the rollout one line at a time. New call reasons will appear that nobody wrote down in Step 1, so add them to the worksheet first, then to the build.
Glossary
- Scope worksheet
- A list of the calls a support line gets, each marked as a document answer, a lookup or a person, so the build follows real demand.
- Global Node
- Dograh's shared prompt, added to every step that has Add Global Prompt on. It holds the persona and the handoff rules.
- Pre-Call Data Fetch
- A Start Call setting that asks your API for data about the caller's number before the greeting, so the agent starts with the right record.
- Chunked Search
- A Knowledge Base mode that splits a long file into pieces and fetches only the ones that match the question. It needs an embedding key.

