Demos
See Guava in action.
Working code examples across real industry scenarios. Every demo starts from a fresh install — copy, customize, and run.
[ Video: Outbound Appointment Scheduling — coming soon ]
Outbound Appointment Scheduling
An agent calls a patient, confirms identity using reach_person, then negotiates a reschedule date using a calendar_slot Field. SMS confirmation sent after the call.
import guava
import os
from guava.helpers.openai import DatetimeFilter
from guava.examples.mock_appointments import MOCK_APPOINTMENTS
class SchedulingController(guava.CallController):
def __init__(self, patient_name):
super().__init__()
self.datetime_filter = DatetimeFilter(source_list=MOCK_APPOINTMENTS)
self.set_persona(
organization_name="Bright Smile Dental",
agent_name="Grace",
agent_purpose=f"Calling {patient_name} to schedule a dental appointment",
)
self.reach_person(
contact_full_name=patient_name,
on_success=self.schedule_recipient,
on_failure=self.recipient_unavailable,
)
def schedule_recipient(self):
self.set_task(
checklist=[
guava.Say("Let me check what times we have available."),
guava.Field(
key="appointment_time",
field_type="calendar_slot",
description="Find a time that works for the patient",
choice_generator=lambda q: self.datetime_filter.filter(q, max_results=3),
),
"Confirm the appointment and say goodbye.",
],
on_complete=self.end_call,
)
def end_call(self):
self.hangup(final_instructions="Thank them and hang up.")
def recipient_unavailable(self):
self.hangup(final_instructions="Apologize and hang up.")
if __name__ == "__main__":
guava.Client().create_outbound(
from_number=os.environ["GUAVA_AGENT_NUMBER"],
to_number="+1...",
call_controller=SchedulingController("Jane Smith"),
)[ Video: Customer Onboarding — coming soon ]
Customer Onboarding
An outbound-calling agent for a bank walks a new customer through important account setup details. The agent makes regulatory disclosures, collects preferences for paperless statements and overdraft protection, confirms debit card delivery address, and wraps up with a summary of the customer's choices.
import guava
import os
class CustomerOnboardingController(guava.CallController):
def __init__(self, contact_name: str, account_type: str):
super().__init__()
self.contact_name = contact_name
self.account_type = account_type
self.set_persona(
organization_name="First National Bank",
agent_name="Jamie",
agent_purpose=(
f"to walk a new customer through the setup of their {self.account_type}, "
f"deliver required disclosures, and configure initial account preferences"
),
)
self.reach_person(
contact_full_name=self.contact_name,
on_success=self.begin_onboarding,
on_failure=self.recipient_unavailable,
)
def begin_onboarding(self):
self.set_task(
objective=f"Onboard {self.contact_name} for their new {self.account_type}.",
checklist=[
guava.Say(
f"Hello {self.contact_name}, congratulations on opening your new "
f"{self.account_type} with First National Bank! My name is Jamie and "
f"I am here to help you get everything set up today."
),
guava.Say(
"I am required to share a few important disclosures. Your deposits "
"are insured by the FDIC up to $250,000. Standard account terms apply "
"as outlined in your account agreement."
),
guava.Field(key="disclosures_acknowledged", field_type="text",
description="Confirm customer acknowledged the disclosures"),
guava.Field(key="paperless_statements", field_type="text",
description="Enroll in paperless statements? yes/no"),
guava.Field(key="overdraft_protection", field_type="text",
description="Add overdraft protection? yes/no"),
guava.Field(key="debit_card_address_confirmed", field_type="text",
description="Confirm debit card delivery address is correct"),
],
on_complete=self.end_call,
)
def end_call(self):
self.hangup(final_instructions="Summarize their selections and welcome them to the bank.")
def recipient_unavailable(self):
self.hangup(final_instructions="Leave a voicemail welcoming them to First National Bank.")
if __name__ == "__main__":
guava.Client().create_outbound(
from_number=os.environ["GUAVA_AGENT_NUMBER"],
to_number="+1...",
call_controller=CustomerOnboardingController("Sophia Nguyen", "checking account"),
)[ Video: Insurance Q&A with RAG — coming soon ]
Insurance Q&A with RAG
Outbound agent answers policy questions from a document using DocumentQA. The agent stays engaged during your on_question callback — no latency constraint on your RAG system.
import guava
import os
from typing_extensions import override
from guava.helpers.openai import DocumentQA
from guava.examples.example_data import PROPERTY_INSURANCE_POLICY
class InsuranceController(guava.CallController):
def __init__(self):
super().__init__()
self.document_qa = DocumentQA(
"harper-valley-property-insurance",
PROPERTY_INSURANCE_POLICY,
)
self.set_persona(organization_name="Harper Valley Property Insurance")
self.set_task(
"Answer questions about our property insurance policy "
"until the caller has no more questions."
)
@override
def on_question(self, question: str) -> str:
return self.document_qa.ask(question)
if __name__ == "__main__":
guava.Client().create_outbound(
from_number=os.environ["GUAVA_AGENT_NUMBER"],
to_number="+1...",
call_controller=InsuranceController(),
)Ready to run your first call?
Install the SDK and have a voice agent running in under 10 minutes.
