Post-Discharge Follow-Up
Check on patients 24–48 hours after discharge to confirm medication adherence, flag warning symptoms, and reduce costly readmissions.
Why this matters
HIPAA-compliant voice automation for patient engagement, scheduling, and clinical workflows. This example shows you how to automate post-discharge follow-up calls end-to-end with Guava's SDK — no telephony plumbing, no prompt engineering, just Python.
Installation
Install from Guava's private PyPI index. A public package is coming soon — the install command will simplify to pip install guava.
# Step 1: Install Guava
pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
# Public PyPI package coming soon — the install command will simplify to:
# pip install guava
# Step 2: Set your credentials
export GUAVA_API_KEY="..."
export GUAVA_AGENT_NUMBER="..."How it's built
Every Guava agent is a Python class. Walk through the key sections below, then grab the complete file at the end.
Imports
Import the Guava SDK and any helpers you need. guava.CallController is the base class for every voice agent.
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os
READMISSION_SYMPTOMS = ["chest pain", "severe shortness of breath", "high fever", "uncontrolled bleeding"]Agent setup
set_persona() defines how the agent presents itself. set_task() gives it its mission in plain English. The checklist drives the conversation — Guava works through it top-to-bottom, collecting Field values and speaking Say items as it goes.
class DischargeFollowUpBot(guava.CallController):
def __init__(self, patient_name: str, discharge_date: str, condition: str):
super().__init__()
self.patient_name = patient_name
self.set_persona(
organization_name="City General Hospital",
agent_name="Jordan",
)
self.set_task(
objective=f"Follow up with {patient_name} after discharge on {discharge_date} for {condition}",
checklist=[
f"Greet {patient_name} and introduce yourself as calling from City General Hospital.",
guava.Field(
key="feeling_better",
field_type="bool",
description="Is the patient feeling better since discharge?",
),
guava.Field(
key="taking_medications",
field_type="bool",
description="Is the patient taking all prescribed medications as directed?",
),
guava.Field(
key="symptoms_of_concern",
field_type="text",
description=f"Any concerning symptoms such as: {', '.join(READMISSION_SYMPTOMS)}?",
required=False,
),
guava.Field(
key="has_followup_appointment",
field_type="bool",
description="Does the patient have a follow-up appointment scheduled?",
),
"Thank the patient and remind them to call 911 for emergencies.",
],
on_complete=self.triage_result,
)
def triage_result(self, fields):
if fields.get("symptoms_of_concern"):
print(f"ALERT: {self.patient_name} reporting symptoms — escalate to care team")
if not fields.get("has_followup_appointment"):
print(f"ACTION: Schedule follow-up for {self.patient_name}")
guava.dial(
controller=DischargeFollowUpBot,
controller_args={"patient_name": "Robert Kim", "discharge_date": "yesterday",
"condition": "hip replacement surgery"},
to=os.environ["PATIENT_PHONE"],
agent_number=os.environ["GUAVA_AGENT_NUMBER"],
api_key=os.environ["GUAVA_API_KEY"],
)Platform performance
<1s
Response time
99.99%
Uptime SLA
13+
Industries served
Full example
The complete file — copy it, save it as example.py, and run it.
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os
READMISSION_SYMPTOMS = ["chest pain", "severe shortness of breath", "high fever", "uncontrolled bleeding"]
class DischargeFollowUpBot(guava.CallController):
def __init__(self, patient_name: str, discharge_date: str, condition: str):
super().__init__()
self.patient_name = patient_name
self.set_persona(
organization_name="City General Hospital",
agent_name="Jordan",
)
self.set_task(
objective=f"Follow up with {patient_name} after discharge on {discharge_date} for {condition}",
checklist=[
f"Greet {patient_name} and introduce yourself as calling from City General Hospital.",
guava.Field(
key="feeling_better",
field_type="bool",
description="Is the patient feeling better since discharge?",
),
guava.Field(
key="taking_medications",
field_type="bool",
description="Is the patient taking all prescribed medications as directed?",
),
guava.Field(
key="symptoms_of_concern",
field_type="text",
description=f"Any concerning symptoms such as: {', '.join(READMISSION_SYMPTOMS)}?",
required=False,
),
guava.Field(
key="has_followup_appointment",
field_type="bool",
description="Does the patient have a follow-up appointment scheduled?",
),
"Thank the patient and remind them to call 911 for emergencies.",
],
on_complete=self.triage_result,
)
def triage_result(self, fields):
if fields.get("symptoms_of_concern"):
print(f"ALERT: {self.patient_name} reporting symptoms — escalate to care team")
if not fields.get("has_followup_appointment"):
print(f"ACTION: Schedule follow-up for {self.patient_name}")
guava.dial(
controller=DischargeFollowUpBot,
controller_args={"patient_name": "Robert Kim", "discharge_date": "yesterday",
"condition": "hip replacement surgery"},
to=os.environ["PATIENT_PHONE"],
agent_number=os.environ["GUAVA_AGENT_NUMBER"],
api_key=os.environ["GUAVA_API_KEY"],
)Run it
Start the agent. It will connect to Guava's infrastructure and begin accepting calls on your assigned number.
python example.py