Satisfaction & NPS Surveys
Conduct periodic customer satisfaction surveys to benchmark NPS, identify service pain points, and drive continuous improvement.
Why this matters
Keep customers informed and engaged with automated outage updates, smart meter enrollment, conservation alerts, and satisfaction surveys. This example shows you how to automate satisfaction & nps surveys 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 osAgent 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 UtilityNPSSurveyBot(guava.CallController):
def __init__(self, account_name: str, utility_name: str, recent_interaction: str):
super().__init__()
self.set_persona(
organization_name=f"{utility_name} Customer Experience",
agent_name="Avery",
)
self.set_task(
objective=f"Conduct satisfaction survey with {account_name} following {recent_interaction}",
checklist=[
f"Thank {account_name} for being a {utility_name} customer and ask for 60 seconds.",
guava.Field(
key="nps_score",
field_type="rating",
description=f"Likelihood to recommend {utility_name} (0-10)",
),
guava.Field(
key="recent_interaction_rating",
field_type="rating",
description=f"Satisfaction with recent {recent_interaction} (1-5)",
),
guava.Field(
key="billing_clarity",
field_type="rating",
description="Clarity and accuracy of billing (1-5)",
),
guava.Field(
key="biggest_improvement",
field_type="choice",
description="The one thing that would most improve their experience",
choices=["lower rates", "better outage communication", "easier billing",
"faster service restoration", "better app/online tools"],
),
guava.Field(
key="ok_to_follow_up",
field_type="bool",
description="May a customer experience team member follow up on this feedback?",
),
"Thank the customer and provide customer care number for any immediate needs.",
],
on_complete=lambda fields: print(f"NPS survey: {account_name} score={fields.get('nps_score')}"),
)
guava.dial(
controller=UtilityNPSSurveyBot,
controller_args={"account_name": "Wilson Household", "utility_name": "Metro Power & Light",
"recent_interaction": "outage restoration last week"},
to=os.environ["ACCOUNT_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
class UtilityNPSSurveyBot(guava.CallController):
def __init__(self, account_name: str, utility_name: str, recent_interaction: str):
super().__init__()
self.set_persona(
organization_name=f"{utility_name} Customer Experience",
agent_name="Avery",
)
self.set_task(
objective=f"Conduct satisfaction survey with {account_name} following {recent_interaction}",
checklist=[
f"Thank {account_name} for being a {utility_name} customer and ask for 60 seconds.",
guava.Field(
key="nps_score",
field_type="rating",
description=f"Likelihood to recommend {utility_name} (0-10)",
),
guava.Field(
key="recent_interaction_rating",
field_type="rating",
description=f"Satisfaction with recent {recent_interaction} (1-5)",
),
guava.Field(
key="billing_clarity",
field_type="rating",
description="Clarity and accuracy of billing (1-5)",
),
guava.Field(
key="biggest_improvement",
field_type="choice",
description="The one thing that would most improve their experience",
choices=["lower rates", "better outage communication", "easier billing",
"faster service restoration", "better app/online tools"],
),
guava.Field(
key="ok_to_follow_up",
field_type="bool",
description="May a customer experience team member follow up on this feedback?",
),
"Thank the customer and provide customer care number for any immediate needs.",
],
on_complete=lambda fields: print(f"NPS survey: {account_name} score={fields.get('nps_score')}"),
)
guava.dial(
controller=UtilityNPSSurveyBot,
controller_args={"account_name": "Wilson Household", "utility_name": "Metro Power & Light",
"recent_interaction": "outage restoration last week"},
to=os.environ["ACCOUNT_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