A complete end-to-end voice agent system for real estate companies to make outbound calls to potential customers about property listings in India.
- Automated Outbound Calls: Make calls to potential customers using Twilio
- Natural Conversations: Engage in natural conversations using OpenAI's speech-to-text and text-to-speech capabilities
- Property Information: Extract and present property details from PDF documents
- Appointment Booking: Schedule site visits, meetings, or callbacks with customers
- Call Tracking: Record and analyze call data for follow-up
The system consists of the following components:
- MongoDB Database: Stores customer data, property details, call logs, and appointments
- PDF Parser: Extracts property information from PDF documents
- Twilio Integration: Handles outbound calls and call events
- OpenAI Integration: Provides speech-to-text, text-to-text, and text-to-speech capabilities
- Conversation Flow: Manages the conversation state and appointment booking logic
- Main Server Application: Integrates all components and provides API endpoints
real_estate_voice_agent/
├── app.py # Main Flask application
├── run.sh # Deployment script
├── run_tests.sh # Test runner script
├── requirements.txt # Python dependencies
├── USER_GUIDE.md # User guide documentation
├── README.md # Project overview (this file)
├── todo.md # Project task list
├── data/ # Data storage directory
│ ├── pdfs/ # Property PDF documents
│ └── recordings/ # Call recordings
├── src/ # Source code
│ ├── config.py # Configuration module
│ ├── database/ # Database components
│ │ ├── __init__.py
│ │ ├── db.py # Database connection and operations
│ │ ├── init_db.py # Database initialization
│ │ └── schema.py # MongoDB schema definitions
│ ├── pdf_parser/ # PDF parsing components
│ │ ├── __init__.py
│ │ ├── parser.py # PDF parser implementation
│ │ └── utils.py # PDF utility functions
│ ├── twilio_integration/ # Twilio integration components
│ │ ├── __init__.py
│ │ ├── twilio_service.py # Twilio service implementation
│ │ └── call_handlers.py # Call event handlers
│ ├── openai_integration/ # OpenAI integration components
│ │ ├── __init__.py
│ │ ├── conversation.py # Conversation management
│ │ └── audio.py # Audio processing utilities
│ └── conversation_flow/ # Conversation flow components
│ ├── __init__.py
│ └── flow_manager.py # Conversation state management
└── tests/ # Test cases
└── test_voice_agent.py # Unit tests
See the User Guide for detailed setup and installation instructions.
POST /api/call/initiate
: Initiate an outbound call to a customerGET /api/call/list
: List call logs
POST /api/property/import
: Import property details from a PDF fileGET /api/property/list
: List properties
GET /api/customer/list
: List customers
GET /api/appointment/list
: List appointments
POST /webhook/call/initiated
: Webhook for when a call is initiated and answeredPOST /webhook/call/status
: Webhook for call status updatesPOST /call/user_response
: Handle user response during a call
- Python: Primary programming language
- Flask: Web framework for the server application
- MongoDB: Database for storing customer and property data
- Twilio: Service for making outbound calls
- OpenAI: API for speech-to-text, text-to-text, and text-to-speech capabilities
- PyPDF2/pdfminer.six: Libraries for PDF parsing
- Gunicorn: WSGI HTTP server for deployment
This project is licensed under the MIT License - see the LICENSE file for details.
- Twilio for their communication APIs
- OpenAI for their language processing capabilities
- MongoDB for their database solution