An intelligent voice-based AI assistant that automates lead qualification in real estate
- Problem Statement
- Solution Overview
- Features
- Tech Stack
- Architecture
- Installation
- Usage
- API Documentation
- Project Structure
- Environment Variables
- Contributing
- License
- Contact
Real estate agents today face several critical challenges:
Wasted Time: Up to 60-70% of their time is spent engaging with leads who are not ready or qualified to buy.
Repetitive Tasks: Agents must repeatedly ask the same basic qualifying questions, which drains productivity.
Missed Opportunities: Without 24/7 availability, many potential leads slip away when no one is available to respond.
Manual Data Handling: Agents manually convert conversations into structured data, increasing the chance of errors and delays.
Limited Scalability: Human availability restricts how many leads can be handled simultaneously, capping growth.
Additionally, many customers visiting real estate websites find no live person available to chat, which leads to frustration and lost business.
Our AI-powered voice agent transforms the lead qualification process by:
Engaging Customers Naturally: The AI holds real-time, natural phone conversations with potential buyers, just like a human agent.
Asking Smart Questions: It intelligently gathers all necessary qualification details without boring the lead with repetitive or irrelevant queries.
Automating Data Capture: Spoken answers are converted instantly into structured data, eliminating manual entry and mistakes.
Instant Qualification: Leads are automatically scored and tagged as qualified or unqualified based on preset criteria.
24/7 Availability: The AI works around the clock, never missing a lead regardless of time or volume.
Seamless Admin Integration: Qualified leads are sent directly to the admin dashboard, exported to Excel, and notifications are emailed to administrators in real time.
- Natural Conversations: AI-powered voice calls using Vapi
- Real-time Processing: Instant speech-to-text and text-to-speech
- Dynamic Responses: Context-aware conversation flow
- Smart Questions: AI asks relevant follow-up questions
- Budget Analysis: Automatic budget parsing and validation
- Location Matching: Property location preference detection
- Timeline Assessment: Purchase timeline evaluation
- Structured Storage: Automatic lead data organization
- MongoDB Integration: Scalable database storage
- Real-time Updates: Live lead status tracking
- Export Options: CSV, JSON data export capabilities
- n8n Integration: Visual workflow automation
- CRM Sync: Automatic lead forwarding to CRM systems
- Notification System: Real-time alerts for qualified leads
- Analytics Dashboard: Lead conversion tracking
- React 18 - Modern UI framework
- Tailwind CSS - Utility-first styling
- Vite - Fast build tool
- Vapi Web SDK - Voice interaction
- Node.js - JavaScript runtime
- Express.js - Web framework
- MongoDB - NoSQL database
- Mongoose - ODM for MongoDB
- OpenAI GPT-4 - Natural language processing
- Vapi - Voice AI platform
- n8n - Workflow automation
- Webhook Integration - Real-time data flow
- ESLint - Code linting
- Prettier - Code formatting
- ngrok - Local tunnel for webhooks
- Git - Version control
graph TD
A[Customer Call] --> B[Vapi Voice AI]
B --> C[OpenAI GPT-4]
C --> D[Natural Language Processing]
D --> E[n8n Workflow]
E --> F[Data Processing]
F --> G[MongoDB Database]
G --> H[Lead Dashboard]
I[Real Estate Agent] --> H
H --> J[Qualified Leads]
H --> K[Analytics & Reports]
E --> L[CRM Integration]
E --> M[Email Notifications]
E --> N[SMS Alerts]
Before you begin, ensure you have the following installed:
- Node.js (v18 or higher)
- npm or yarn
- MongoDB (local or cloud)
- Git
-
Clone the Repository
git clone https://github.com/JaYRaNa213/Real-Estate-AI-Sales-Qualification-Bot cd real-estate-ai-bot -
Install Dependencies
# Install frontend dependencies npm install # Install backend dependencies (if separate) cd real-estate-backend npm install cd ..
-
Environment Setup
# Copy environment template cp .env.example .env -
Start Development Servers
npm run css:watch # Start frontend (port 5173) npm run dev # Start backend (port 5000) - in separate terminal npm run server # Start n8n workflow (port 5678) - in separate terminal n8n
-
Expose Webhooks (Development)
# Install ngrok globally npm install -g ngrok # Expose n8n webhook npx ngrok http 5678
- Fork this Repl
- Set Environment Variables
- Configure MongoDB connection string
- Deploy
-
Navigate to the Demo Page
http://localhost:5173/demo -
Click "Talk to Agent"
- The AI will answer and start the qualification process
- Speak naturally about your property requirements
-
Answer Questions
- Budget range
- Preferred location
- Property type (apartment, house, commercial)
- Timeline for purchase
-
View Results
- Check the dashboard for qualified leads
- Export data or integrate with your CRM
- Lead Overview: Total, qualified, and unqualified leads
- Real-time Status: Active calls and processing
- Search & Filter: Find specific leads quickly
- Export Options: Download lead data
- Analytics: Conversion rates and trends
GET /api/leadsGet all leads with optional filtering
Query Parameters:
status- Filter by qualification statusList- Search by name, phone, or email
Response:
{
"success": true,
"data": [
{
"_id": "64a7b8c9d12e3f4g5h6i7j8k",
"name": "John Doe",
"phone": "+1234567890",
"email": "john@example.com",
"budget": "500000-800000",
"location": "Mumbai",
"propertyType": "apartment",
"qualified": true,
"createdAt": "2024-01-15T10:30:00Z"
}
],
}POST /api/leadsRequest Body:
{
"name": "Jane Smith",
"phone": "+1987654321",
"email": "jane@example.com",
"budget": "300000-500000",
"location": "Bangalore",
}POST /webhook/qualifiedReceives data from Vapi calls and processes lead qualification.
real-estate-ai-bot/
├── 📁 public/ # Static assets
├── 📁 src/
│ ├── 📁 components/ # React components
│ │ ├── AssistantCallButton.jsx
│ │ ├── LeadCard.jsx
│ │ ├── PropertyCard.jsx
│ │ └── Navbar.jsx
│ ├── 📁 pages/ # Page components
│ │ ├── Home.jsx
│ │ ├── PropertyDemo.jsx
│ │ └── DemoSplitView.jsx
│ ├── 📁 api/ # API utilities
│ │ └── api.js
│ ├── 📁 utils/ # Helper functions
│ ├── App.jsx # Main app component
│ ├── index.jsx # Entry point
│ └── vapiClient.js # Vapi configuration
├── 📁 backend/ # Backend server (if separate)
│ ├── 📁 controllers/
│ ├── 📁 models/
│ ├── 📁 routes/
│ └── server.js
├── 📁 n8n-workflows/ # Automation workflows
├── 📄 .env.example # Environment template
├── 📄 package.json # Dependencies
├── 📄 tailwind.config.js # Tailwind configuration
├── 📄 vite.config.js # Vite configuration
└── 📄 README.md # This file
Create a .env file in the root directory:
# Vapi Configuration
VAPI_PUBLIC_KEY=your_vapi_public_key_here
VAPI_PRIVATE_KEY=your_vapi_private_key_here
VAPI_ASSISTANT_ID=your_assistant_id_here
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
# Database
MONGODB_URI=mongodb://localhost:27017/real-estate-ai
# Or for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/dbname
# n8n Configuration
N8N_WEBHOOK_URL=https://your-ngrok-url.ngrok.io/webhook
N8N_RUNNERS_ENABLED=true
# Server Configuration
PORT=5000
NODE_ENV=development
# Frontend URL (for CORS)
FRONTEND_URL=http://localhost:5173| Variable | Description | Required |
|---|---|---|
VAPI_PUBLIC_KEY |
Vapi public API key for frontend | ✅ |
VAPI_PRIVATE_KEY |
Vapi private API key for backend | ✅ |
VAPI_ASSISTANT_ID |
Your configured Vapi assistant ID | ✅ |
OPENAI_API_KEY |
OpenAI API key for GPT integration | ✅ |
MONGODB_URI |
MongoDB connection string | ✅ |
N8N_WEBHOOK_URL |
n8n webhook endpoint URL | ✅ |
PORT |
Server port (default: 5000) | ❌ |
NODE_ENV |
Environment (development/production) | ❌ |
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode
npm run test:watch-
Voice Call Testing
- Test different budget ranges
- Try various property types
- Test edge cases (unclear responses)
-
API Testing
- Use Postman or curl to test endpoints
- Verify webhook functionality
- Test database operations
-
Integration Testing
- End-to-end call flow
- Data persistence verification
- n8n workflow testing
- Response Time: < 2 seconds for voice responses
- Accuracy: 95%+ intent recognition accuracy
- Uptime: 99.9% availability target
- Conversion: Track qualified lead percentage
# Check system status
npm run health-check
# View performance logs
npm run logs
# Monitor database performance
npm run db:status# Check Vapi configuration
console.log('Vapi Key:', process.env.VAPI_PUBLIC_KEY)
# Verify assistant ID
console.log('Assistant ID:', process.env.VAPI_ASSISTANT_ID)# Test MongoDB connection
npm run db:test
# Check connection string
echo $MONGODB_URI# Check ngrok status
ngrok status
# Verify webhook URL in Vapi dashboard
curl -X POST your-webhook-url/test# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install
# Check for version conflicts
npm auditEnable debug logging:
DEBUG=true
LOG_LEVEL=debug-
Prepare for Deployment
# Build the project npm run build # Test production build npm run preview
-
Configure Replit Secrets
- Add all environment variables to Replit Secrets
- Ensure database URLs are accessible from Replit
-
Deploy
- Use Replit's built-in deployment feature
- Configure custom domain if needed
# Build and deploy
npm run build
npm run deploy
# Or deploy to specific environment
npm run deploy:production- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Use ESLint and Prettier for code formatting
- Write unit tests for new features
- Follow conventional commits for commit messages
- Update documentation for API changes
This project is licensed under the MIT License - see the LICENSE file for details.
Jay Prakash Rana
- 📧 Email: jayrana0909@gmail.com
- 🐙 GitHub: @your-github-handle
- 💼 LinkedIn: Your LinkedIn Profile
- 📖 Documentation: Wiki
Live Demo: https://realestateaiagentjayprakash.vercel.app/
| Detail | Information |
|---|---|
| Hackathon | Swafinix AI Hackathon 2025 |
| Category | Real Estate – AI Sales Qualification Bot |
| Participant | Jay Prakash Rana |
| Status | ✅ Working Prototype Complete |
| Event | Date & Time (IST) |
|---|---|
| Registration Deadline | 01 Aug 2025, 12:00 AM IST |
| Hackathon Start | 01 Aug 2025 |
| Submission Deadline | 10 Aug 2025, 01:21 AM IST |
| Winners Announcement | 15 Aug 2025 |
💼 PPO Opportunity: 12 LPA with Swafinix Technologies
- Vapi for providing excellent voice AI platform
- OpenAI for powerful GPT models
- n8n for flexible workflow automation
- MongoDB for reliable database services
- Replit for seamless development and deployment
- ✅ Voice call qualification
- ✅ Basic lead management
- ✅ MongoDB integration
- ✅ n8n workflows
⭐ Star this repo if you find it helpful!
Made with ❤️ by Jay Prakash Rana


