AI-Powered Hospital Operations SaaS
AIOpsCare
A multi-tenant, voice-first SaaS platform for hospital operations and compliance — assets, maintenance, tickets, contracts, housekeeping, laundry, utilities and workflows — with a multilingual AI voice assistant and LLM-powered dashboard chat and reports.
Built with Angular 18, PrimeNG, TypeScript, Python, FastAPI, PostgreSQL, SQLAlchemy, OpenAI, Groq, Llama 3.3, Speech-to-Text, Text-to-Speech, JWT, Render, Neon, Netlify.
The problem
Hospital facility operations span many departments, assets, maintenance teams, compliance requirements and recurring workflows — usually tracked across spreadsheets, paper checklists and disconnected tools.
Why I built it
Hospital facility operations involve multiple departments, assets, maintenance teams, compliance requirements, and recurring workflows. Many frontline staff are more comfortable speaking their own language than filling in English forms. AIOpsCare brings these processes into one platform that staff can simply talk to.
What I built
A single multi-tenant platform where each hospital gets an isolated data space, and every operational module — maintenance, assets, utilities, contracts, compliance, housekeeping, laundry — shares one consistent workflow, permission and analytics model. An AI layer on top lets staff report issues by voice in their own language and lets managers query operations in plain language.
What the AI does
- Multilingual voice assistant
- Hospital staff can speak to the system in English, Hindi, Telugu and Tamil. The assistant understands the request, holds a short conversation and replies with speech in the same language.
- Voice-to-ticket creation
- Staff record a WhatsApp-style voice note to report a problem. The audio is transcribed and an LLM turns it into a structured maintenance ticket, including the likely asset issue.
- AI dashboard chat
- Supervisors and admins ask questions about operations in plain language. Answers are grounded in tenant-scoped query APIs, so the AI only sees that hospital's data.
- AI narrative reports
- The LLM turns operational data into readable summaries, so managers get a written explanation instead of only charts and tables.
- Provider-agnostic LLM layer with fallback
- One LLM client supports OpenAI (GPT-4o / GPT-4o-mini) and Groq (Llama 3.3 70B) through a shared chat-completions interface, with automatic fallback between providers and a deterministic fallback when no model is available.
- Indian-language text-to-speech
- Spoken replies use a primary and fallback TTS engine. A transliteration step rewrites common English terms (ticket, AC, ICU) into native script for correct Telugu, Hindi and Tamil pronunciation, and an LRU cache serves repeated phrases instantly.
How it's put together
AI voice pipeline
Decisions I made
- Schema-per-tenant in PostgreSQL
- Each hospital's data lives in its own PostgreSQL schema. This gives stronger isolation than a shared table with a tenant_id column, while still running a single database that is simple to operate and back up.
- Tenant context resolved from the JWT
- The tenant is identified from the authenticated token on every request and used to route the database session to the right schema, so business logic never has to pass tenant identifiers around manually.
- Layered backend
- API routes stay thin; business rules live in a service layer and data access in a repository layer. This keeps a large number of modules consistent and testable.
- Role-based access control
- Permissions are enforced at the API layer by role, so maintenance staff, supervisors and administrators see and act on only what they should.
- LLMs return structured JSON
- Voice and chat requests ask the model for structured JSON rather than free text, so the backend can validate the output and turn it into real actions such as creating a ticket.
- Never depend on one AI provider
- The LLM client falls back from one provider to another, and to a deterministic path, so a provider outage or rate limit doesn't stop hospital staff from working.
What was hard
- Keeping every query tenant-scoped
- In a multi-tenant system, one unscoped query is a data leak. Centralising tenant routing in the request context — rather than in individual queries — was key.
- Many modules, one model
- Maintenance, compliance, housekeeping and utilities each have their own workflows. Designing shared patterns for status, assignment and recurrence kept the platform coherent as modules grew.
- Voice on real phones
- Android allows only one microphone consumer at a time, which blocked speech recognition when the audio meter was also listening. The mic stream was made session-scoped, the meter replaced with a synthetic animation on Android, and recognition given auto-retry and timeouts.
- Correct Indian-language pronunciation
- English words inside Telugu, Hindi or Tamil sentences were pronounced badly by TTS. A transliteration table converts them into native script before synthesis.
- Silent audio on mobile
- Mobile browsers block audio that isn't started by a tap. Audio playback is unlocked during the user's tap, and a size guard stops error responses from being played as audio.
What's in it
- Multilingual AI voice assistant
- Voice-note → structured ticket with LLMs
- AI dashboard chat & narrative reports
- OpenAI + Groq LLM layer with fallback
- Multi-tenant SaaS architecture
- PostgreSQL schema-per-tenant isolation
- Tenant-aware database routing
- JWT authentication
- Role-based access control
- Maintenance & ticket management
- Preventive maintenance workflows
- Asset management
- Meter & utility management
- Contract management
- Compliance & checklist workflows
- Housekeeping & laundry management
- Incident & CAPA tracking
- Workflow & approval engine
- Automatic worker assignment
- Operational analytics
What I learned
- How tenant isolation, authorization and database design depend on each other
- Building production voice AI: speech-to-text, LLMs and text-to-speech working together
- Designing LLM features that are reliable: structured outputs, provider fallback, caching
- Structuring a large FastAPI codebase into clear service and repository boundaries
- Modelling real operational workflows rather than CRUD screens
The project gave me hands-on experience designing a real multi-tenant SaaS architecture where tenant isolation, authorization, database design, operational workflows and production AI features all have to work together.
Next project
SwarmAI
Distributed Local LLM Inference