Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฅ ASHA - Voice Based Appointment System

๐Ÿ“Œ Problem Statement

Traditional hospital appointment booking systems are often inefficient, time-consuming, and inaccessible for many patients. Patients frequently encounter long waiting times, busy phone lines, manual booking errors, and limited access to appointment information. Hospital staff spend significant time managing appointment requests, leading to increased operational workload and reduced efficiency.

Live Demo

Backend API: https://asha-voice-based-appointment-system.onrender.com

Swagger Docs: https://asha-voice-based-appointment-system.onrender.com/docs

Challenges in Traditional Systems

  • Long waiting times on calls and at reception desks
  • Manual appointment booking prone to human errors
  • Limited appointment availability information
  • High dependency on hospital staff
  • Lack of 24/7 support for patients
  • Increased operational workload and cost
  • Poor patient experience and satisfaction

๐ŸŽฏ Objective

The objective of ASHA is to build an AI-powered voice assistant that enables patients to:

  • Book appointments through natural voice conversations
  • Retrieve appointment information instantly
  • Cancel appointments easily
  • Check doctor availability in real-time

The system aims to reduce manual effort, improve accessibility, and provide a faster and more efficient appointment management experience.


System Architecture


๐Ÿ—๏ธ System Overview

ASHA is an AI-powered voice-based hospital appointment assistant built using Vapi, FastAPI, SQLAlchemy, and SQLite. The system allows patients to interact using voice commands while the backend handles appointment scheduling and database operations.


๐Ÿ›๏ธ Traditional System Architecture

                    PATIENT
                       โ”‚
                       โ–ผ
                Phone Call / Visit
                       โ”‚
                       โ–ผ
                Reception Desk
                       โ”‚
                       โ–ผ
             Manual Availability Check
                       โ”‚
                       โ–ผ
              Manual Appointment Entry
                       โ”‚
                       โ–ผ
              Hospital Database
                       โ”‚
                       โ–ผ
               Appointment Confirmation

Problems

โŒ Long waiting times

โŒ Busy phone lines

โŒ Human errors

โŒ Limited working hours

โŒ High staff workload

โŒ Poor scalability


Diagram


๐Ÿš€ Proposed System Architecture (ASHA)

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚   Patient    โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                           โ”‚
                    Voice Conversation
                           โ”‚
                           โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚      ASHA (VAPI)        โ”‚
              โ”‚   Voice AI Assistant    โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
                   API Request
                         โ”‚
                         โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚      FastAPI Backend    โ”‚
              โ”‚ Business Logic & APIs   โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                         โ”‚
                  SQLAlchemy ORM
                         โ”‚
                         โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚     SQLite Database     โ”‚
              โ”‚     Appointment Data    โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”„ Data Flow Diagram

1. Patient Speaks
          โ”‚
          โ–ผ
2. ASHA (Voice Assistant)
          โ”‚
          โ–ผ
3. Understand User Intent
          โ”‚
          โ–ผ
4. Call FastAPI Endpoint
          โ”‚
          โ–ผ
5. Backend Processes Request
          โ”‚
          โ–ผ
6. SQLite Database Operation
          โ”‚
          โ–ผ
7. JSON Response Generated
          โ”‚
          โ–ผ
8. ASHA Converts Response to Voice
          โ”‚
          โ–ผ
9. Patient Receives Response

โœจ Features

  • ๐ŸŽ™๏ธ Voice-Based Appointment Booking
  • ๐Ÿ“… Appointment Retrieval
  • โŒ Appointment Cancellation
  • ๐Ÿ” Availability Checking
  • ๐Ÿค– Conversational AI Experience
  • โšก Real-Time API Integration
  • ๐Ÿ—„๏ธ Persistent Appointment Storage
  • ๐ŸŒ Public API Access using ngrok
  • ๐Ÿ”„ Automated Appointment Management

๐Ÿ“ก Available APIs

Method Endpoint Description
POST /book Book Appointment
GET /list_appointments Retrieve Appointments
GET /availability Check Availability
POST /cancel Cancel Appointment

๐Ÿ—„๏ธ Database Schema

Appointment Table

Field Type
id Integer
patient_name String
reason String
start_time DateTime
canceled Boolean
created_at DateTime

โš™๏ธ Tech Stack

Backend

  • FastAPI
  • SQLAlchemy
  • Pydantic
  • Uvicorn

Database

  • SQLite

Voice AI

  • Vapi

Development Tools

  • Python
  • ngrok
  • Git
  • GitHub

๐Ÿ“‚ Project Structure

ASHA-Voice-Based-Appointment-System/

โ”œโ”€โ”€ backend.py
โ”œโ”€โ”€ database.py
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ schemas.py
โ”œโ”€โ”€ appointment_db.db
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

๐Ÿš€ Installation

Clone Repository

git clone https://github.com/ananyag309/ASHA-Voice-Based-Appointment-System.git

cd ASHA-Voice-Based-Appointment-System

Install Dependencies

pip install -r requirements.txt

Run FastAPI

uvicorn main:app --reload

Open Swagger Documentation

http://localhost:8000/docs

๐Ÿ“‹ Example Conversation

Booking Appointment

Patient: I want to book an appointment tomorrow.

ASHA: Sure. May I know your name?

Patient: Ananya Gupta.

ASHA: What is the reason for your visit?

Patient: General Checkup.

ASHA: Your appointment has been successfully booked.


Screenshots


๐Ÿ“ˆ Benefits

For Patients

  • Faster appointment booking
  • No waiting on calls
  • 24/7 assistance
  • Better user experience

For Hospitals

  • Reduced staff workload
  • Fewer manual errors
  • Improved operational efficiency
  • Scalable appointment management

๐Ÿ”ฎ Future Enhancements

  • SMS Notifications
  • WhatsApp Reminders
  • Email Confirmations
  • PostgreSQL Integration
  • Streamlit Admin Dashboard
  • Doctor-wise Scheduling
  • Multi-language Support
  • Symptom Collection Agent
  • Cloud Deployment on Render

๐Ÿ‘ฉโ€๐Ÿ’ป Author

Ananya Gupta

B.Tech Computer Science Engineering
Bennett University

GitHub: https://github.com/ananyag309


โญ If you found this project useful, consider starring the repository.

About

Asha is an AI-powered voice assistant for hospital appointment management built using FastAPI, SQLite, Vapi, and conversational AI. It enables patients to book, view, and cancel appointments through natural voice interactions.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages