Architect & lead developer
Agente Clínicas
AI-powered WhatsApp service for medical clinics

A production-grade monolith that automates patient communication for clinics over WhatsApp: scheduling, triage, emergency detection and clinic management, with full LGPD (Brazilian GDPR) compliance.
Agente Clínicas is a production WhatsApp automation platform for medical clinics, built as a TypeScript monolith on Fastify and Prisma. It coordinates several specialized AI agents — an assistant, a triage agent, a scheduler and an emergency detector — so clinics can manage patient scheduling, triage and urgent cases directly inside the conversations patients already use. The system integrates with WhatsApp Business across multiple instances, isolates each clinic's data, and is built for Brazilian healthcare reality with full LGPD compliance, audit logging and PII redaction. Reliability is engineered in: retries with backoff, circuit breakers, and a rate-limit bypass path so emergency messages always get through. A role-based React dashboard gives staff control over clinics, patients, doctors and appointments, while a Prometheus, Grafana and Sentry stack keeps the service observable in production.
Problem
Clinics run patient contact over WhatsApp but handle scheduling, triage and emergencies manually — slow, error-prone, and hard to keep LGPD-compliant at scale.
Approach
A Fastify/Prisma monolith orchestrating specialized Mastra AI agents over the WhatsApp Business API, with per-clinic data isolation, audit logging, PII redaction, and resilience patterns (backoff, circuit breakers, emergency rate-limit bypass).
Outcome
A deployed, production-grade system that handles patient communication end to end, backed by a role-based React admin dashboard and full observability via Prometheus, Grafana and Sentry.
Highlights
- Multiple specialized AI agents (assistant, triage, scheduler, emergency)
- Full WhatsApp Business integration with multi-instance support
- LGPD compliance with audit logging and PII redaction
- Resilience: retry with backoff, circuit breakers, rate-limit bypass for emergencies
- Full observability stack and multi-clinic data isolation
- Role-based React admin dashboard (clinics, patients, doctors, appointments)
Stack
- TypeScript
- Fastify
- Prisma
- Mastra AI agents
- Baileys / WhatsApp
- React (SPA)
- Redis
- Prometheus
- Grafana
- Sentry