Real Estate Voice Agent
Build an intelligent voice agent that handles property inquiries, schedules viewings, and manages customer interactions with natural conversation flow.

1. Get your API key
To get started, you'll need an API key. You can get one from the OmniDimension dashboard, API Section

2. Create the Real Estate Assistant
We'll start by creating our voice agent with real estate-specific configuration:
Code
from omnidimension import Client
client = Client("your_api_key_here")
real_estate_agent = client.agent.create(
name="Sarah - Premier Properties Assistant",
welcome_message="Hello! This is Sarah from Premier Properties. I'm here to help you find your dream home or assist with any property inquiries. How can I help you today?",
context_breakdown=[
{
"title": "Available Properties",
"body": """RESIDENTIAL PROPERTIES:
- 3BR Luxury Condo: $450,000 | 2,200 sq ft | Downtown
- 4BR Family Home: $650,000 | 3,500 sq ft | Suburbs
- 2BR Starter Home: $325,000 | 1,800 sq ft | City Center
RENTAL PROPERTIES:
- 2BR Apartment: $2,200/month | 1,200 sq ft | Downtown
- 3BR Townhouse: $3,500/month | 2,000 sq ft | Suburbs
- 1BR Studio: $1,500/month | 800 sq ft | City Center
COMMERCIAL PROPERTIES:
- Office Space: $25/sq ft | 5,000 sq ft | Business District
- Retail Space: $30/sq ft | 3,000 sq ft | Shopping Center
- Warehouse: $15/sq ft | 10,000 sq ft | Industrial Zone"""
},
{
"title": "Inquiry Process",
"body": "1. Greet client professionally 2. Understand property requirements 3. Match with available listings 4. Schedule viewings if interested 5. Collect contact information 6. Provide market information"
},
{
"title": "Service Areas",
"body": "We serve the entire metropolitan area including Downtown, Suburbs, and surrounding neighborhoods. Our agents specialize in residential, commercial, and rental properties."
}
],
call_type="Incoming",
voice={
"provider": "eleven_labs",
"voice_id": "EXAVITQu4vr4xnSDxMaL"
},
model={
"provider": "anthropic",
"model": "gpt-4o-mini",
"temperature": 0.6
}
)
agent_id = real_estate_agent["json"]["id"]
print(f"Real estate agent created with ID: {agent_id}")
Key Components
3. Upload Property Documentation
Enhance your agent's knowledge by uploading property brochures:
Code
import base64
def upload_property_documentation(agent_id, brochure_path):
"""Upload property brochure to knowledge base and attach to agent"""
# Read and encode the PDF file
with open(brochure_path, "rb") as file:
file_data = base64.b64encode(file.read()).decode('utf-8')
# Upload to knowledge base
kb_response = client.knowledge_base.create(file_data, "Property_Brochure.pdf")
file_id = kb_response["json"]["file"]["id"]
# Attach to agent
attach_response = client.knowledge_base.attach([file_id], agent_id)
print(f"Property documentation uploaded successfully. File ID: {file_id}")
return file_id
# Upload your property brochure
brochure_file_id = upload_property_documentation(agent_id, "property_brochure.pdf")
4. Handle Incoming Client Calls
Your agent is now ready to handle incoming calls. When clients call your office number, the agent will:
5. Monitor Performance & Analytics
Track your real estate agent's performance:
Code
def get_real_estate_analytics(agent_id, days=7):
"""Get comprehensive analytics for real estate agent"""
# Get recent call logs
call_logs = client.call.get_call_logs(agent_id=agent_id, page_size=100)
calls_data = call_logs.get('data', [])
# Calculate metrics
total_calls = len(calls_data)
successful_calls = sum(1 for call in calls_data if call.get('status') == 'completed')
average_duration = sum(call.get('duration', 0) for call in calls_data) / total_calls if total_calls > 0 else 0
# Generate report
analytics_report = {
"period_days": days,
"total_calls": total_calls,
"successful_calls": successful_calls,
"completion_rate": f"{(successful_calls/total_calls*100):.1f}%" if total_calls > 0 else "0%",
"average_call_duration": f"{average_duration:.1f} seconds",
"recent_calls": calls_data[:5] # Last 5 calls
}
return analytics_report
# Get weekly performance report
weekly_report = get_real_estate_analytics(agent_id, days=7)
print("Real Estate Agent Performance Report")
print(f"Total Calls: {weekly_report['total_calls']}")
print(f"Successful Calls: {weekly_report['successful_calls']}")
print(f"Completion Rate: {weekly_report['completion_rate']}")
print(f"Average Call Duration: {weekly_report['average_call_duration']}")
6. Update Agent Configuration
Modify your agent settings as needed:
Code
def update_agent_details(agent_id, **kwargs):
"""Update agent configuration"""
response = client.agent.update(agent_id, **kwargs)
print(f"Agent updated successfully")
return response
# Update welcome message for weekend hours
update_agent_details(
agent_id,
welcome_message="Good morning! Welcome to Premier Properties. Our weekend open houses are ready! How can I help you find your dream home?"
)
# Switch back to incoming calls
update_agent_details(
agent_id,
call_type="Incoming"
)
7. Complete Real Estate Setup
Here's the complete setup for a production-ready real estate agent:
Code
from omnidimension import Client
import base64
class RealEstateVoiceAgent:
def __init__(self, api_key):
self.client = Client(api_key)
self.agent_id = None
def setup_complete_real_estate_agent(self):
"""Set up a complete real estate voice agent with all features"""
# Create the main agent
agent = self.client.agent.create(
name="Premier Properties - Voice Assistant",
welcome_message="Hello! This is Sarah from Premier Properties. I'm here to help you find your dream home or assist with any property inquiries. How can I help you today?",
context_breakdown=[
{
"title": "Complete Property Listings",
"body": """
RESIDENTIAL PROPERTIES:
- 3BR Luxury Condo: $450,000 | 2,200 sq ft | Downtown | Amenities: Pool, Gym, Doorman
- 4BR Family Home: $650,000 | 3,500 sq ft | Suburbs | Features: Large Yard, 2-Car Garage
- 2BR Starter Home: $325,000 | 1,800 sq ft | City Center | Features: Renovated Kitchen, Hardwood Floors
- 5BR Executive Home: $850,000 | 4,200 sq ft | Gated Community | Features: Home Office, Pool
RENTAL PROPERTIES:
- 2BR Apartment: $2,200/month | 1,200 sq ft | Downtown | Utilities Included
- 3BR Townhouse: $3,500/month | 2,000 sq ft | Suburbs | Pet-Friendly
- 1BR Studio: $1,500/month | 800 sq ft | City Center | Furnished Option Available
- 4BR House: $4,000/month | 2,800 sq ft | Suburbs | 12-month Lease
COMMERCIAL PROPERTIES:
- Office Space: $25/sq ft | 5,000 sq ft | Business District | Class A Building
- Retail Space: $30/sq ft | 3,000 sq ft | Shopping Center | High Foot Traffic
- Warehouse: $15/sq ft | 10,000 sq ft | Industrial Zone | Loading Docks
- Restaurant Space: $35/sq ft | 2,500 sq ft | Downtown | Former Restaurant
"""
},
{
"title": "Client Service Guidelines",
"body": "Always be professional and helpful. Listen carefully to client requirements. Suggest properties that match their needs. Offer virtual tours when possible. Follow up within 24 hours of initial inquiry."
},
{
"title": "Operational Details",
"body": "Office hours: 9 AM - 7 PM weekdays, 10 AM - 5 PM weekends. Service areas: Downtown, Suburbs, and surrounding neighborhoods. Specialties: Residential, Commercial, and Rental properties. Viewing appointments: 1-hour slots."
}
],
call_type="Incoming",
voice={
"provider": "eleven_labs",
"voice_id": "EXAVITQu4vr4xnSDxMaL"
},
model={
"provider": "anthropic",
"model": "gpt-4o-mini",
"temperature": 0.6
}
)
self.agent_id = agent["json"]["id"]
print(f"Real estate agent created: {self.agent_id}")
return self.agent_id
def get_performance_summary(self):
"""Get a quick performance summary"""
if not self.agent_id:
return "No agent configured"
calls = self.client.call.get_call_logs(agent_id=self.agent_id, page_size=50)
total_calls = len(calls.get('data', []))
return {
"agent_id": self.agent_id,
"total_calls_handled": total_calls,
"status": "Active and ready for inquiries!"
}
def upload_property_brochure(self, brochure_path):
"""Upload property brochure to knowledge base"""
if not self.agent_id:
print("Please create agent first")
return None
with open(brochure_path, "rb") as file:
file_data = base64.b64encode(file.read()).decode('utf-8')
kb_response = self.client.knowledge_base.create(file_data, "Property_Brochure.pdf")
file_id = kb_response["json"]["file"]["id"]
self.client.knowledge_base.attach([file_id], self.agent_id)
print(f"Property brochure uploaded: {file_id}")
return file_id
# Initialize and deploy real estate agent
real_estate = RealEstateVoiceAgent("your_api_key_here")
agent_id = real_estate.setup_complete_real_estate_agent()
# Upload brochure if you have a PDF
# real_estate.upload_property_brochure("property_brochure.pdf")
print("
Your real estate voice agent is now live!")
print(f"Agent ID: {agent_id}")
print("Features enabled:")
print("Property inquiry handling")
print("Viewing scheduling")
print("Call analytics and monitoring")
print("Property matching")
print("Agent configuration updates")
# Check status
summary = real_estate.get_performance_summary()
print(f"
Current Status: {summary['status']}")
8. Key Features Available
Your real estate voice agent comes with these powerful capabilities: