In this exercise, I will build an AI voice agent for a fictitious dental clinic who is capable of booking dental appointments for call-in customers using Retell AI.
Go to Retell AI and create an account. At the dashboard, click on create agent and select voice agent.
For agent type, select Single Prompt Agent which is capable of holding free-form conversations.
Next, select start from blank.
At the canvas, paste in the system prompt. The system prompt will give the AI agent a personality, its tone, some guardrails, the tools available at its disposal, and most importantly the goals it has to serve. Since it is an agent handling inbound calls, select AI speaks first at the left bottom dropdown menu.
Next, add knowledge base for the AI agent to use for answering users’ queries. PDFs or text files can be uploaded into knowledge base.
There are various preset functions we can add for the agent. The end-call function is added by default.
For this exercise, we will need a check calendar avaliability and book on calendar function.
First, let’s add the check calendar availability function. In this function, we need to input the Name, API Key and Event Type ID.
The name given for this function must match the tool name stated in the system prompt.
Go to cal.com and create an account, follow the prompt until your Google calendar got connected.
Then go to add new event type to set up a new event. Next, go to Advanced settings and change the user to event type.
The event type ID can be seen from the url bar. Insert this ID into the field of the check calendar availbility function.
Still at cal.com, navigate to API Key and set up a new API key. Copy/paste this key into the field of the check calendar availbility function.
Next, we add the book on the calendar function. The API key and the event type ID is the same as the previous function.
The three essential functions for this AI voice agent are completed. Click here to see the AI voice agent in action.
In the video demo, I have placed the Google calendar beside the AI voice agent test page to demo its ability to check and book an appointment on the calendar.