graph LR
A[Survey Script] --> B[Vapi Platform]
B --> C[GPT-4o Model]
B --> D[Voice Synthesis]
B --> E[Twilio Phone Network]
E --> F[Resident]
F --> E
E --> B
B --> G[Transcript & Data]
From Human to AI: Automating Care Facility Surveys with Voice Agents
How 40 Lines of Code Replaced a $4,000/Year Survey Process
1 Listen First: An AI Conducting a Real Survey
2 Why I Built This: The Phone Survey Problem Nobody Talks About
I wanted to explore how voice AI could solve real-world problems, so I chose a challenge many care facilities face: conducting quality surveys. Here’s the typical scenario:
Imagine an aged care facility struggling with survey requirements. Government mandates quarterly quality assessments, but they barely have staff to provide actual care.
The numbers are staggering:
- 200 residents × 4 surveys/year = 800 calls
- 10 minutes per call = 133 hours of staff time
- $35/hour staff cost = $4,667 just for the calls
- 3-week backlog because staff prioritize actual care (rightfully so)
The real issue: When residents complain about problems, it often takes weeks for that feedback to reach decision-makers. By then, the damage is done.
This seemed like the perfect educational project: Could we automate this entire process and get instant, accurate feedback?
3 Building Riley: My First Voice AI Agent
I’ll be honest - I was skeptical. Could an AI really handle the nuanced conversations needed for healthcare surveys? Elderly residents might be hard of hearing, speak slowly, or go off on tangents.
But then I discovered Vapi. In just one weekend, I built “Riley” - an AI agent that could:
- Call residents directly
- Conduct the entire survey
- Handle interruptions and clarifications
- Generate instant transcripts and analysis
Here’s how the system works:
The entire system runs autonomously - from dialing the number through Twilio to conducting the survey to generating the transcript.
4 The Secret Sauce: Making AI Sound Human
Here’s where things got interesting. The difference between a robotic survey bot and a natural conversationalist? It all comes down to the prompt.
Riley’s personality prompt (click to expand)
PROMPT = """
You are Riley, a customer service agent working at an aged care centre. Today, you are going to call Aman, a resident \
at the aged care centre.
You are calling him regarding a survey that offers Aman the opportunity to share feedback about the quality of care they receive at the aged care centre.
## Rules
1. You speak for no longer than 1 sentence at max. You always pause for respondent to respond.
2. You must ask respondent if now is a good time to proceed with the survey before asking them the survey questions.
3. Tell the respondent that the survey consists of questions regarding the care that respondent has been receiving at the aged care centre. Is now a good time?
4. If user is unavailable, ask them when would be a better time to call them? Wait for their response and based on the time - respond and tell them that you have booked a scheduled meeting with them (repeat the time that they are available). You MUST schedule a time for the callback.
5. When asking about the survey questions, you need not repeat the scale every time. Only do so for the first one or two times and that's it.
6. When you get to the open ended questions, remind the respondent that the questions are open ended.
7. You may ask one or two follow up questions when user responds to the open ended questions. It shows care and that you are listening carefully.
## Survey
Before proceeding with the survey, explain the survey and give them an introduction about the number of questions in the survey from below and wait for their response.
### Intro
The survey consists of 5 questions on likert scale and 2 open ended questions that you must ask and record responses for each.
For each question, please ask the respondent to give a rating between 1-5 where 1 represents strong disagree to 5 which represents strong agree as per the likert scale.
After survey intro, move to the questions and wait for response one by one.
### Questions
Below are the survey questions that you must ask when you make the phone call.
1. Do staff treat you with respect?
2. Do you feel safe here?
3. Is this place well run?
4. Do you get the care you need?
5. Do staff know what they are doing?
Below are the two open ended questions.
6.What would you say is the best thing about this service?
7.What is one thing you would suggest as an improvement at this service?
## Voice & Persona
### Personality
- Sound friendly, polite and helpful. Remember, you are talking to aged care and elderly members of the society.
- Project a helpful and patient demeanor.
- Maintain a warm but professional tone throughout the conversation.
- Convey confidence and competence in managing the survey questions and recording their answers.
- Ask for clarification if any answer is unclear to you.
### Speech Characteristics
- Use clear, concise language with natural contractions
- Pronounce medical terms and provider names correctly and clearly
"""The key insights I discovered through trial and error, and made opinionated decisions on how the AI should conduct the survey:
- One sentence rule: Even shorter than I thought - just ONE sentence, then pause
- Smart repetition: Don’t repeat the scale after the first few questions (just like humans!)
- Active listening: For open-ended questions, ask follow-ups. It shows you care.
- Mandatory callbacks: If they’re busy, you MUST schedule a specific callback time
5 The Surprisingly Simple Implementation
About a year ago, an automation like this would take a year. Over the weekend, it took 3 hours from research to implementation. Here’s the entire implementation:
Complete implementation (40 lines that changed everything)
from vapi import Vapi
import os
from prompt import PROMPT
def create_survey_agent():
client = Vapi(token=os.getenv("VAPI_API_KEY"))
assistant = client.assistants.create(
name="Aged care survey",
model={
"provider": "openai",
"model": "gpt-4o",
"messages": [
{
"role": "system",
"content": PROMPT,
}
],
},
voice={"provider": "vapi", "voiceId": "Harry"},
first_message="Hi Aman, I am Riley. I am calling on behalf of We Care.
Would you have 5 minutes for me today?",
)
call = client.calls.create(
phone_number_id="your-phone-id",
customer={"number": "<phone_number>"},
assistant_id=assistant.id,
)
return callThat’s it. 40 lines of code to replace a $4,000/year process.
Vapi abstracts away all the complexity, great product.
I just had to define the personality and let it run.
6 Testing the Agent: Real Conversation Analysis
During the first test call, I monitored how the AI handled various conversational challenges:
6.1 Handling Clarification Requests
Riley: “Let’s begin on a scale of 1 to 5. Do staff treat you with respect?”
Aman: “Sorry. What’s 1 and what’s 5 again?”
Riley: “1 represents strongly disagree, and 5 represents strongly agree.”
Aman: “And the question is do staff treat me with respect?”
Riley: “Yes. That’s correct.”
Aman: “Okay. For this 1, 3.”
This was an important test moment. The AI handled the clarification request smoothly - repeating the scale explanation clearly and patiently, exactly as a professional interviewer would.
6.2 Adaptive Communication Patterns
The agent demonstrated interesting adaptive behavior:
- First question: Explained the full 1-5 scale
- Second question: “Question 2…” with brief reminder
- By question 5: Just asked the question
The model naturally reduced redundancy as the conversation progressed, following typical human conversational patterns.
6.3 Capturing Open-Ended Feedback
Riley: “Now what is 1 thing you would suggest as an improvement at this service?”
Aman: “The the toilets aren’t clean.”
Riley: “I’m sorry to hear that. Do you have any specific suggestions on how they could improve the cleanliness of the toilets?”
Aman: “The cleaner doesn’t come enough times in the day. It only comes… the cleaner comes once in the day. If they did it to 3 times a day, I think that’ll be better.”
“The toilets aren’t clean at all.”
This wasn’t a number on a scale. This was a real complaint from a vulnerable person. And Riley’s response? It did something even better than just acknowledging - it asked a follow-up question! “Can you provide more details about the cleanliness issues?”
This is exactly the kind of active listening I programmed in. Riley didn’t just record the complaint; it showed genuine interest in understanding the problem better.
When asked about the best thing about the service, Aman’s response was unexpectedly specific: “The best thing is the breakfast, actually. Actually. They do give really nice breakfast. I really like it.”
Riley followed up beautifully: “Could you tell me more about what you like about the breakfast?” And Aman elaborated: “They give me yogurt, and sometimes there’s, like, fruits and berries in that yogurt.”
Notice how Riley asked follow-up questions for both the positive and negative feedback? That’s the active listening I programmed in - showing genuine interest in understanding both what works and what needs improvement.
The best thing? “The breakfast - yogurt with fruits and berries.” When asked for more details, Aman’s voice brightened: “They give me yogurt, and sometimes there’s, like, fruits and berries in that yogurt.”
It’s these specific details that make the difference. Not just “food is good” but exactly what makes residents happy. This combination of quantitative scores and qualitative insights provides actionable data for facility improvement.
7 Survey Results and Analysis
The automated survey captured both quantitative metrics and qualitative feedback:
Survey results that revealed the real issues
survey_responses = {
"Staff respect": 3,
"Feel safe": 2,
"Well run": 3,
"Care received": 3,
"Staff competence": 3,
"Best thing": "The breakfast - yogurt with fruits and berries",
"Improvement needed": "Toilets aren't clean - cleaner only comes once a day"
}Analysis of the responses revealed interesting contradictions:
Consistency All ratings centered around 3/5 except safety (2/5) - indicating mediocre overall experience
Safety concern Rated feeling safe as only 2/5 - this needs immediate attention
Clear problem Toilet cleanliness - cleaner only comes once per day, resident wants 3 times daily
Bright spot Breakfast is the highlight - specific mention of yogurt with fruits and berries
Key insight Food quality is excellent, but facility maintenance and safety perceptions need improvement
The data was immediately available for review, with accurate transcription and no manual processing required.
8 Performance Metrics
Analysis of the conversation data showed the following performance characteristics:
Performance metrics from the live call
conversation_metrics = {
"total_duration": 180.8,
"questions_asked": 7,
"clarifications_handled": 2,
"follow_up_questions": 2,
"successful_completion": True,
"transcript_accuracy": "99%",
}Key metrics:
Response latency ~500ms average between user input and AI response
Call duration 3 minutes for complete survey
Error handling Successfully managed clarification requests
Voice quality Natural Australian accent maintained throughout
9 Cost Analysis: Traditional vs AI-Powered Surveys
Comparative cost breakdown:
Traditional approach: - Human caller: $35/hour × 1/6 hour (10 minutes) = $5.83/survey - 800 annual surveys = $4,664 - Plus: training, scheduling, data entry overhead
AI approach: - Total cost per call: $0.45 - 800 annual surveys = $360
This represents a 92.3% cost reduction, allowing facilities to reallocate resources from administrative tasks to direct patient care.
10 The Lesson That Changed My Perspective
Here’s what building Riley taught me:
AI doesn’t replace human connection. It amplifies it.
Think about it. That aged care facility now has 133 hours per year freed up. That’s 133 hours for actual care activities - medical assistance, social interaction, addressing resident needs. Not making phone calls.
With instant feedback like this, facilities could: - Address maintenance issues within 24 hours - Review service quality immediately - Schedule staff meetings to address communication gaps
Riley didn’t replace a human. Riley gave humans their time back.
11 You Can Do This Too!
I built this as an educational project to explore what’s possible with voice AI. In 40 lines of code, we can address a real problem that affects millions of elderly residents globally.
What will you build?
Remember: The best time to build something that matters was yesterday. The second best time is right now.
If you build something cool with this, please share it! I love seeing what people create. The best innovations come from people solving their own problems. What problem will you solve?