Real Estate

Lead Qualification

Instantly respond to new buyer or renter inquiries, qualify them on budget, timeline, and needs, and route hot leads directly to an agent.

Why this matters

Qualify leads, schedule showings, handle tenant requests, and manage the full lifecycle of residential and commercial real estate transactions. This example shows you how to automate lead qualification calls end-to-end with Guava's SDK — no telephony plumbing, no prompt engineering, just Python.

How to set persona & task
Working with Fields and Say items
Handling callbacks
Running the agent
Step 01

Installation

Install from Guava's private PyPI index. A public package is coming soon — the install command will simplify to pip install guava.

terminal
# 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="..."
Step 02

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.

01

Imports

Import the Guava SDK and any helpers you need. guava.CallController is the base class for every voice agent.

example.py
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os
02

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.

example.py
class LeadQualificationBot(guava.CallController):
    def __init__(self, lead_name: str, property_address: str, source: str):
        super().__init__()
        self.set_persona(
            organization_name="Summit Realty Group",
            agent_name="Casey",
        )
        self.set_task(
            objective=f"Qualify {lead_name} who inquired about {property_address} via {source}",
            checklist=[
                f"Thank {lead_name} for their interest in {property_address}.",
                guava.Field(
                    key="buying_or_renting",
                    field_type="choice",
                    description="Are they looking to buy or rent?",
                    choices=["buy", "rent"],
                ),
                guava.Field(
                    key="budget",
                    field_type="currency",
                    description="What is their budget or price range?",
                ),
                guava.Field(
                    key="timeline",
                    field_type="choice",
                    description="What is their desired move-in timeline?",
                    choices=["ASAP", "1-3 months", "3-6 months", "6+ months", "just browsing"],
                ),
                guava.Field(
                    key="pre_approved",
                    field_type="bool",
                    description="Are they pre-approved for financing?",
                ),
                guava.Field(
                    key="working_with_agent",
                    field_type="bool",
                    description="Are they currently working with another agent?",
                ),
                guava.Field(
                    key="wants_showing",
                    field_type="bool",
                    description="Would they like to schedule a showing?",
                ),
                "Transfer hot leads to available agent or schedule callback.",
            ],
            on_complete=self.route_lead,
        )

    def route_lead(self, fields):
        score = sum([
            fields.get("pre_approved", False),
            fields.get("timeline") in ["ASAP", "1-3 months"],
            fields.get("wants_showing", False),
        ])
        print(f"Lead score: {score}/3 for {fields}")

guava.dial(
    controller=LeadQualificationBot,
    controller_args={"lead_name": "Nina Russo", "property_address": "14 Maple Lane, Austin TX",
                     "source": "Zillow"},
    to=os.environ["LEAD_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

Step 03

Full example

The complete file — copy it, save it as example.py, and run it.

example.py
# Install: pip install gridspace-guava --extra-index-url https://guava-pypi.gridspace.com
import guava
import os

class LeadQualificationBot(guava.CallController):
    def __init__(self, lead_name: str, property_address: str, source: str):
        super().__init__()
        self.set_persona(
            organization_name="Summit Realty Group",
            agent_name="Casey",
        )
        self.set_task(
            objective=f"Qualify {lead_name} who inquired about {property_address} via {source}",
            checklist=[
                f"Thank {lead_name} for their interest in {property_address}.",
                guava.Field(
                    key="buying_or_renting",
                    field_type="choice",
                    description="Are they looking to buy or rent?",
                    choices=["buy", "rent"],
                ),
                guava.Field(
                    key="budget",
                    field_type="currency",
                    description="What is their budget or price range?",
                ),
                guava.Field(
                    key="timeline",
                    field_type="choice",
                    description="What is their desired move-in timeline?",
                    choices=["ASAP", "1-3 months", "3-6 months", "6+ months", "just browsing"],
                ),
                guava.Field(
                    key="pre_approved",
                    field_type="bool",
                    description="Are they pre-approved for financing?",
                ),
                guava.Field(
                    key="working_with_agent",
                    field_type="bool",
                    description="Are they currently working with another agent?",
                ),
                guava.Field(
                    key="wants_showing",
                    field_type="bool",
                    description="Would they like to schedule a showing?",
                ),
                "Transfer hot leads to available agent or schedule callback.",
            ],
            on_complete=self.route_lead,
        )

    def route_lead(self, fields):
        score = sum([
            fields.get("pre_approved", False),
            fields.get("timeline") in ["ASAP", "1-3 months"],
            fields.get("wants_showing", False),
        ])
        print(f"Lead score: {score}/3 for {fields}")

guava.dial(
    controller=LeadQualificationBot,
    controller_args={"lead_name": "Nina Russo", "property_address": "14 Maple Lane, Austin TX",
                     "source": "Zillow"},
    to=os.environ["LEAD_PHONE"],
    agent_number=os.environ["GUAVA_AGENT_NUMBER"],
    api_key=os.environ["GUAVA_API_KEY"],
)
Step 04

Run it

Start the agent. It will connect to Guava's infrastructure and begin accepting calls on your assigned number.

terminal
python example.py
Get Started