Skip to content

JaYRaNa213/Real-Estate-AI-Sales-Qualification-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏡 Real Estate AI Qualification Bot

Real Estate AI Bot Voice Assistant Real Estate

An intelligent voice-based AI assistant that automates lead qualification in real estate

Live Demo : https://realestateaiagentjayprakash.vercel.app/


User and Admin


n8n Workflow


📋 Table of Contents


🚨 Problem Statement

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 Solution

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.


🎯 Features

🎙️ Voice Interaction

  • 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

🧠 Intelligent Qualification

  • 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

📊 Data Management

  • 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

🔄 Workflow Automation

  • 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

🛠️ Tech Stack

Frontend

  • React 18 - Modern UI framework
  • Tailwind CSS - Utility-first styling
  • Vite - Fast build tool
  • Vapi Web SDK - Voice interaction

Backend

  • Node.js - JavaScript runtime
  • Express.js - Web framework
  • MongoDB - NoSQL database
  • Mongoose - ODM for MongoDB

AI & Automation

  • OpenAI GPT-4 - Natural language processing
  • Vapi - Voice AI platform
  • n8n - Workflow automation
  • Webhook Integration - Real-time data flow

Development Tools

  • ESLint - Code linting
  • Prettier - Code formatting
  • ngrok - Local tunnel for webhooks
  • Git - Version control

🏗️ Architecture

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]
Loading

🚀 Installation

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v18 or higher)
  • npm or yarn
  • MongoDB (local or cloud)
  • Git

Quick Start

  1. Clone the Repository

    git clone https://github.com/JaYRaNa213/Real-Estate-AI-Sales-Qualification-Bot
    cd real-estate-ai-bot
  2. Install Dependencies

    # Install frontend dependencies
    npm install
    
    # Install backend dependencies (if separate)
    cd real-estate-backend
    npm install
    cd ..
  3. Environment Setup

    # Copy environment template
    cp .env.example .env
  4. 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
  5. Expose Webhooks (Development)

    # Install ngrok globally
    npm install -g ngrok
    
    # Expose n8n webhook
    npx ngrok http 5678

Production Deployment on Replit

  1. Fork this Repl
  2. Set Environment Variables
  3. Configure MongoDB connection string
  4. Deploy

💻 Usage

Starting a Voice Call

  1. Navigate to the Demo Page

    http://localhost:5173/demo
    
  2. Click "Talk to Agent"

    • The AI will answer and start the qualification process
    • Speak naturally about your property requirements
  3. Answer Questions

    • Budget range
    • Preferred location
    • Property type (apartment, house, commercial)
    • Timeline for purchase
  4. View Results

    • Check the dashboard for qualified leads
    • Export data or integrate with your CRM

Dashboard Features

  • 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

📡 API Documentation

Endpoints

Leads Management

GET /api/leads

Get all leads with optional filtering

Query Parameters:

  • status - Filter by qualification status
  • List - 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"
    }
  ],
}

Create New Lead

POST /api/leads

Request Body:

{
  "name": "Jane Smith",
  "phone": "+1987654321",
  "email": "jane@example.com",
  "budget": "300000-500000",
  "location": "Bangalore",
}

Webhook Endpoint (n8n)

POST /webhook/qualified

Receives data from Vapi calls and processes lead qualification.


📁 Project Structure

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

🔐 Environment Variables

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

Environment Variables Description

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)

🧪 Testing

Run Tests

# Run all tests
npm test

# Run tests with coverage
npm run test:coverage

# Run tests in watch mode
npm run test:watch

Manual Testing

  1. Voice Call Testing

    • Test different budget ranges
    • Try various property types
    • Test edge cases (unclear responses)
  2. API Testing

    • Use Postman or curl to test endpoints
    • Verify webhook functionality
    • Test database operations
  3. Integration Testing

    • End-to-end call flow
    • Data persistence verification
    • n8n workflow testing

📊 Performance Metrics

Key Performance Indicators

  • Response Time: < 2 seconds for voice responses
  • Accuracy: 95%+ intent recognition accuracy
  • Uptime: 99.9% availability target
  • Conversion: Track qualified lead percentage

Monitoring

# Check system status
npm run health-check

# View performance logs
npm run logs

# Monitor database performance
npm run db:status

🔧 Troubleshooting

Common Issues

1. Voice Call Not Starting

# Check Vapi configuration
console.log('Vapi Key:', process.env.VAPI_PUBLIC_KEY)

# Verify assistant ID
console.log('Assistant ID:', process.env.VAPI_ASSISTANT_ID)

2. Database Connection Issues

# Test MongoDB connection
npm run db:test

# Check connection string
echo $MONGODB_URI

3. Webhook Not Receiving Data

# Check ngrok status
ngrok status

# Verify webhook URL in Vapi dashboard
curl -X POST your-webhook-url/test

4. Frontend Build Issues

# Clear cache and reinstall
rm -rf node_modules package-lock.json
npm install

# Check for version conflicts
npm audit

Debug Mode

Enable debug logging:

DEBUG=true
LOG_LEVEL=debug

🚀 Deployment

Replit Deployment (Recommended)

  1. Prepare for Deployment

    # Build the project
    npm run build
    
    # Test production build
    npm run preview
  2. Configure Replit Secrets

    • Add all environment variables to Replit Secrets
    • Ensure database URLs are accessible from Replit
  3. Deploy

    • Use Replit's built-in deployment feature
    • Configure custom domain if needed

Manual Deployment

# Build and deploy
npm run build
npm run deploy

# Or deploy to specific environment
npm run deploy:production

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Code Standards

  • Use ESLint and Prettier for code formatting
  • Write unit tests for new features
  • Follow conventional commits for commit messages
  • Update documentation for API changes

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


📞 Contact & Support

Developer

Jay Prakash Rana

Support

  • 📖 Documentation: Wiki

🎥 Demo Video

Real Estate AI Bot Demo

Live Demo: https://realestateaiagentjayprakash.vercel.app/


🏆 Hackathon Information

Event Details

Detail Information
Hackathon Swafinix AI Hackathon 2025
Category Real Estate – AI Sales Qualification Bot
Participant Jay Prakash Rana
Status ✅ Working Prototype Complete

Important Dates

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

Prizes

💼 PPO Opportunity: 12 LPA with Swafinix Technologies


🌟 Acknowledgments

  • 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

📈 Roadmap

Phase (Current)

  • ✅ Voice call qualification
  • ✅ Basic lead management
  • ✅ MongoDB integration
  • ✅ n8n workflows

⭐ Star this repo if you find it helpful!

Made with ❤️ by Jay Prakash Rana

Releases

No releases published

Packages

No packages published