Inspiration I was spending time learning about LLM capabilities, especially function calling and tool usage. The more I explored, the more I realized how powerful these features could be in solving real-world problems. That's when it hit me — why not apply this to something that frustrates everyone: booking doctor appointments? We've all been there. Calling hospitals, waiting on hold, explaining symptoms to someone who then transfers you around, filling out the same forms again and again. And for elderly people or those not comfortable with typing, it's even worse. I thought, what if we could just talk to an AI like we'd talk to a helpful receptionist? That's how this project started. What it does We built a system with two AI agents that can work separately or together: The first one is a chat agent. You describe your symptoms in plain language, and it figures out which department you need, recommends a doctor, checks their schedule in real-time, and books your appointment. All in under 2 minutes. The second is a voice agent using Gemini Live. It's completely hands-free — you just talk to it like you're on a phone call. Perfect for people who don't want to type or can't easily use apps. Both agents pull from the same database of doctors, schedules, and patient records. They use Redis for quick context switching so conversations feel natural, not robotic. How we built it We went with FastAPI for the backend because it's fast and easy to work with. The AI layer runs on Google Gemini models — one handles the text-based chat, and another powers the real-time voice interaction through WebSocket streaming. For storage, we used MySQL to manage all the doctor profiles, patient data, and appointment records. Redis sits in between to cache frequently accessed info and keep conversations flowing smoothly. The trickiest part technically was getting the voice agent working with low latency. Nobody wants to wait 5 seconds after every sentence. We spent a lot of time optimizing the WebSocket connection and tuning how context gets passed between turns. Challenges we ran into Function calling was new territory for me, so there was definitely a learning curve. Getting the AI to reliably call the right functions with the correct parameters took iteration. Sometimes it would hallucinate data or skip steps. Real-time voice was another beast. Latency issues, handling interruptions mid-sentence, making sure the audio quality stayed good — all of that required experimentation. And then there's the healthcare domain itself. Medical terminology, department mapping, symptom analysis — we had to be really careful about how the AI interprets things. We're not diagnosing anyone, just routing them to the right specialist, but that responsibility still weighs on you. Accomplishments that we're proud of Honestly, just seeing it work end-to-end felt amazing. When you can describe a headache and blurry vision in casual language, and the system correctly routes you to ophthalmology or neurology based on context, books a slot, and confirms everything — that's pretty cool. The voice agent is something I'm particularly proud of. It actually feels like talking to a person, not a machine. My parents tested it, and they found it easier than any app or website they've used before. Also proud that we built this as a modular system. Hospitals can use just the chat agent, just the voice agent, or both. It's flexible. What we learned Function calling and tool usage aren't just buzzwords — they unlock genuinely useful applications when done right. I learned a ton about prompt engineering, context management, and how to design conversations that feel natural. On the technical side, working with WebSockets for real-time communication was new for me. So was thinking about caching strategies with Redis in a healthcare context where data freshness really matters. But the biggest lesson? Build for real users, not just to showcase tech. Every decision — the voice option, the 2-minute booking target, the symptom-to-department mapping — came from thinking about actual pain points people face. What's next for appointment-booking There's a lot we want to add. Multi-language support is high on the list, especially for regions where English isn't the first language. We're also looking at integrating with existing hospital management systems and insurance databases. One exciting possibility is turning this into a phone-based system. Imagine calling your hospital's number and an AI picks up, books your appointment, sends you a confirmation SMS — all without any human intervention needed. That could help hospitals save significant time and resources. We'd also like to add prescription reminders, follow-up scheduling, and maybe even basic triage capabilities. Nothing that replaces doctors, but small features that make healthcare access smoother for everyone.

Built With

Share this project:

Updates