AI Agent for Public Health: Vaccination Information, Clinic Finder, and Outbreak Alerts
Build an AI agent for public health departments that provides vaccination eligibility information, finds nearby clinics with appointment availability, and distributes outbreak alerts with actionable guidance.
Public Health Information at Scale
Public health departments serve as the front line of community health infrastructure. They manage vaccination programs, track disease outbreaks, operate clinics, and communicate health advisories. During routine operations, residents call with questions about vaccine eligibility, clinic hours, and immunization records. During outbreaks, call volumes spike by 10x or more, overwhelming staff and leaving residents without timely information.
An AI agent can handle the information layer: determining vaccine eligibility based on age and health conditions, finding nearby clinics with availability, checking immunization records, and distributing outbreak alerts with specific guidance. The agent does not replace clinical judgment — it replaces the phone tree and the hold queue.
Vaccine Eligibility Engine
Vaccine eligibility rules are set by the CDC and state health departments. They follow structured criteria based on age, health conditions, and prior vaccination history. This is deterministic logic that must be precise.
from dataclasses import dataclass, field
from datetime import date
from enum import Enum
class VaccineType(Enum):
FLU = "influenza"
COVID = "covid_19"
TDAP = "tdap"
MMR = "mmr"
SHINGLES = "shingles"
PNEUMOCOCCAL = "pneumococcal"
HPV = "hpv"
HEPATITIS_B = "hepatitis_b"
@dataclass
class VaccineRule:
vaccine: VaccineType
min_age: int | None = None
max_age: int | None = None
recommended_for: list[str] = field(default_factory=list)
contraindications: list[str] = field(default_factory=list)
dose_schedule: str = ""
requires_prior_dose: bool = False
seasonal: bool = False
VACCINE_SCHEDULE: dict[VaccineType, VaccineRule] = {
VaccineType.FLU: VaccineRule(
vaccine=VaccineType.FLU,
min_age=6, # months, but we simplify to years here
recommended_for=["everyone 6 months and older"],
contraindications=["severe egg allergy (egg-free options available)"],
dose_schedule="Annually, typically September through March",
seasonal=True,
),
VaccineType.SHINGLES: VaccineRule(
vaccine=VaccineType.SHINGLES,
min_age=50,
recommended_for=[
"adults 50 and older",
"adults 19+ with weakened immune systems",
],
dose_schedule="Two doses, 2-6 months apart (Shingrix)",
),
VaccineType.HPV: VaccineRule(
vaccine=VaccineType.HPV,
min_age=9,
max_age=45,
recommended_for=[
"routine: ages 11-12 (can start at 9)",
"catch-up: through age 26",
"shared decision: ages 27-45",
],
dose_schedule="2 doses if started before 15; 3 doses if started at 15+",
),
VaccineType.PNEUMOCOCCAL: VaccineRule(
vaccine=VaccineType.PNEUMOCOCCAL,
min_age=65,
recommended_for=[
"adults 65 and older",
"adults 19-64 with certain medical conditions",
"adults 19-64 who smoke",
],
dose_schedule="PCV20 single dose, or PCV15 followed by PPSV23",
),
}
@dataclass
class PersonProfile:
age: int
conditions: list[str] = field(default_factory=list)
prior_vaccines: dict[str, date] = field(default_factory=dict)
pregnant: bool = False
immunocompromised: bool = False
def check_vaccine_eligibility(
person: PersonProfile,
) -> list[dict]:
"""Check which vaccines a person is eligible for."""
results = []
for vtype, rule in VACCINE_SCHEDULE.items():
eligible = True
reasons = []
# Age check
if rule.min_age and person.age < rule.min_age:
eligible = False
reasons.append(f"Minimum age is {rule.min_age}")
if rule.max_age and person.age > rule.max_age:
eligible = False
reasons.append(f"Maximum age is {rule.max_age}")
# Contraindication check
for contra in rule.contraindications:
if any(c.lower() in contra.lower() for c in person.conditions):
reasons.append(f"Contraindication: {contra}")
# Check if already vaccinated recently
last_dose = person.prior_vaccines.get(vtype.value)
if last_dose and not rule.seasonal:
reasons.append(f"Last dose: {last_dose.isoformat()}")
results.append({
"vaccine": vtype.value,
"eligible": eligible,
"recommended_for": rule.recommended_for,
"reasons": reasons,
"dose_schedule": rule.dose_schedule,
})
return results
Clinic Finder with Availability
Finding the right clinic involves geographic proximity, vaccine availability, appointment slots, and sometimes insurance acceptance. The agent queries a clinic database and returns actionable options.
from dataclasses import dataclass, field
from math import radians, sin, cos, sqrt, atan2
@dataclass
class Clinic:
clinic_id: str
name: str
address: str
latitude: float
longitude: float
phone: str
hours: dict[str, str] # day -> "9:00 AM - 5:00 PM"
vaccines_available: list[VaccineType] = field(default_factory=list)
accepts_walkins: bool = False
accepts_insurance: list[str] = field(default_factory=list)
next_available_slot: str | None = None
def haversine_distance(lat1: float, lon1: float, lat2: float, lon2: float) -> float:
"""Calculate distance between two points in miles."""
R = 3959 # Earth radius in miles
dlat = radians(lat2 - lat1)
dlon = radians(lon2 - lon1)
a = sin(dlat / 2) ** 2 + cos(radians(lat1)) * cos(radians(lat2)) * sin(dlon / 2) ** 2
return R * 2 * atan2(sqrt(a), sqrt(1 - a))
def find_nearby_clinics(
user_lat: float,
user_lon: float,
vaccine_needed: VaccineType | None = None,
max_distance_miles: float = 10.0,
clinics: list[Clinic] = None,
) -> list[dict]:
"""Find clinics near the user, optionally filtered by vaccine availability."""
results = []
for clinic in clinics or []:
distance = haversine_distance(user_lat, user_lon, clinic.latitude, clinic.longitude)
if distance > max_distance_miles:
continue
if vaccine_needed and vaccine_needed not in clinic.vaccines_available:
continue
results.append({
"name": clinic.name,
"address": clinic.address,
"phone": clinic.phone,
"distance_miles": round(distance, 1),
"walk_ins": clinic.accepts_walkins,
"next_appointment": clinic.next_available_slot,
"vaccines": [v.value for v in clinic.vaccines_available],
})
results.sort(key=lambda x: x["distance_miles"])
return results[:10]
Outbreak Alert Distribution
During disease outbreaks, the agent becomes a critical communication channel. It must distribute accurate, actionable information without causing panic.
See AI Voice Agents Handle Real Calls
Book a free demo or calculate how much you can save with AI voice automation.
from datetime import datetime
@dataclass
class OutbreakAlert:
alert_id: str
disease: str
severity: str # low, moderate, high, critical
affected_areas: list[str]
case_count: int
date_issued: datetime
summary: str
prevention_steps: list[str]
symptoms_to_watch: list[str]
when_to_seek_care: str
exposure_locations: list[dict] | None = None
ACTIVE_ALERTS: list[OutbreakAlert] = []
def get_relevant_alerts(user_zipcode: str) -> list[dict]:
"""Get outbreak alerts relevant to the user's location."""
relevant = []
for alert in ACTIVE_ALERTS:
if user_zipcode in alert.affected_areas or "all" in alert.affected_areas:
relevant.append({
"disease": alert.disease,
"severity": alert.severity,
"case_count": alert.case_count,
"summary": alert.summary,
"prevention": alert.prevention_steps,
"symptoms": alert.symptoms_to_watch,
"seek_care_when": alert.when_to_seek_care,
"date_issued": alert.date_issued.isoformat(),
})
# Sort critical alerts first
severity_order = {"critical": 0, "high": 1, "moderate": 2, "low": 3}
relevant.sort(key=lambda x: severity_order.get(x["severity"], 4))
return relevant
Agent Prompt Design for Public Health
The public health agent prompt must balance helpfulness with medical accuracy. It provides information from authoritative sources (CDC, state health department) and always directs clinical questions to healthcare providers.
HEALTH_AGENT_PROMPT = """You are a public health information assistant for
the county health department.
You help residents with:
- Vaccine eligibility and scheduling
- Finding nearby clinics
- Understanding outbreak alerts
- Immunization record questions
RULES:
1. Base all vaccine information on CDC recommendations.
2. Never diagnose conditions or recommend treatments.
3. For symptoms: provide general guidance and direct to a healthcare provider.
4. For outbreak alerts: share facts, prevention steps, and when to seek care.
5. Always mention that individual medical decisions should involve a doctor.
6. If someone describes an emergency, direct them to call 911 immediately.
"""
FAQ
How does the agent handle misinformation about vaccines?
The agent responds to misinformation with factual, evidence-based information from the CDC and peer-reviewed sources. It does not argue or become confrontational. For example, if a user says "vaccines cause autism," the agent responds: "Extensive research involving millions of children has found no link between vaccines and autism. The original study claiming this link was retracted due to serious methodological flaws. I can share links to the CDC's vaccine safety research if you would like to review the evidence." The agent acknowledges the person's concern, provides facts, and offers resources.
How does the agent maintain accuracy as vaccine recommendations change?
Vaccine recommendations are stored in a versioned configuration that is updated whenever the CDC issues new guidance. The agent's eligibility engine reads from this configuration at runtime, so updates take effect immediately. A public health administrator reviews and approves all changes before they go live. The agent includes a "last updated" timestamp in eligibility responses so users know how current the information is.
Can the agent help parents track their children's immunization schedules?
Yes. The agent can look up a child's immunization record (with parental consent and identity verification), compare it against the CDC recommended schedule for the child's age, and identify which vaccines are due or overdue. It generates a personalized schedule showing what vaccines are needed at upcoming well-child visits. The agent can also send reminders when the next dose is due, reducing missed vaccinations.
#GovernmentAI #PublicHealth #Vaccination #HealthAlerts #ClinicFinder #AgenticAI #LearnAI #AIEngineering
CallSphere Team
Expert insights on AI voice agents and customer communication automation.
Try CallSphere AI Voice Agents
See how AI voice agents work for your industry. Live demo available -- no signup required.