The problem
Healthcare support questions are both “how do I…” and “what’s happening with mine?”. A plain FAQ bot can’t answer the second kind, and an AI in healthcare must never diagnose, prescribe or leak personal data.
AI case study · RAG + tool-calling agent · Healthcare
Pamsy Assist answers questions for a healthcare platform’s patients, providers, clinic admins and pharmacy merchants. It knows the help docs, and it can look things up in the live system instead of just pointing people to a page.
One agent, two kinds of answer
Healthcare support questions are both “how do I…” and “what’s happening with mine?”. A plain FAQ bot can’t answer the second kind, and an AI in healthcare must never diagnose, prescribe or leak personal data.
Guardrails
Medical disclaimer with no diagnosis or dosages, privacy rules aligned with NDPR, GDPR and HIPAA, and hand-off to a human for disputed transactions. Answers adapt to each of the four roles.
Fits a small server
The vector store loads only on the first knowledge question, so the API starts fast on a small host.
Tested without the API
RAG tests run against a fake embeddings class, so retrieval is verified without paying for model calls. Every request is validated with Pydantic.
Problem
Turning the help docs into embeddings costs an API call for every chunk, every time the server starts.
Solution
The knowledge base is embedded once and saved to a local vector store. Restarts reuse it, so documents are only embedded again when they change.
Problem
A public chat endpoint can be spammed, and every request costs model tokens.
Solution
Chat is limited to 10 requests a minute per visitor. Messages are capped at 4,000 characters and history at 50 turns, so no single request can blow up the cost.
Problem
Hitting the platform’s backend for every message would be slow and wasteful.
Solution
The agent answers “how do I…” questions from the docs, and calls one of its six live tools only for “what’s happening with mine?” questions, like an appointment or a wallet balance.
FastAPI · LangChain agent (LangGraph under the hood) · Gemini chat and embeddings · Chroma · typed tools calling the Laravel backend over httpx · slowapi rate limiting.