AI-powered inbound/outbound agent for US real estate. Handles buyer and seller inquiries, qualifies leads, schedules calls, sends confirmation emails, and processes cancellation replies automatically.
Live demo: Conversation chatbot · CRM dashboard
npm install
cp .env.example .env # Create .env from template
# Edit .env and set your variables (see Environment Variables below)
npm run devOpen http://localhost:3000 for the voice chat.
Copy .env.example to create your .env file. The example file lists all required and optional variables with placeholder values. Replace them with your actual credentials:
cp .env.example .envThen edit .env and set your values (API keys, database URL, email credentials, etc.). Never commit .env to version control—it is gitignored.
The system sends meeting confirmation emails and automatically handles cancellation replies.
Users qualify through the AI voice chat, provide contact details, and confirm a time slot. The AI collects name, phone, and email (required) before scheduling.
The AI proposes available slots and confirms the booking. Once the user confirms, the system creates the schedule and sends a confirmation email.
A styled HTML email is sent to the customer with the meeting details. The email includes threading headers so replies stay in the same thread.
Example confirmation email:
| Field | Content |
|---|---|
| Subject | Your call is scheduled – [date] at [time] |
| Body | Lead name, date, time, purpose. "If you need to reschedule, reply to this email or give us a call." |
If the customer replies with cancellation intent (e.g. "I wanted to cancel this call, I will reach you later"), the system:
- Detects intent – AI classifies the reply as
cancel,reschedule, orother - Cancels the schedule – Updates status in the database
- Updates the CRM – Removes the appointment, sets next action, adds a note
- Sends a threaded reply – Confirms the cancellation and offers to reschedule
Example cancellation reply:
| Field | Content |
|---|---|
| Subject | Re: Your call is scheduled – [date] at [time] |
| Body | "We've received your request and cancelled your call scheduled for [date] at [time]. If you'd like to reschedule at a different time, simply reply to this email or give us a call." |
The email observer runs periodically (every 10 minutes on Vercel, or via npm run email-observer) to:
- Connect to IMAP inbox
- Fetch unseen emails that reply to our meeting confirmations
- Classify intent with AI
- Execute the cancel flow when appropriate
View leads, meetings, and next actions. Expand rows for full qualification details and suggested properties.
Grid layout with hover actions: view details, mark as Sold, Archive, or Mark active.
Add new listings with address, city, state, price, beds, baths, and images.
Image carousel, price and status badges, and full listing details.
Sold, Archive, and Mark active actions for status updates.
Set variables in .env. Use .env.example as a template: copy it to .env and replace the placeholder values with your own.
| Variable | Required | Description |
|---|---|---|
GOOGLE_GENERATIVE_AI_API_KEY |
Yes | Google Gemini API key |
DATABASE_URL or DB_* |
Yes | MongoDB connection |
SMTP_MAIL |
For emails | Sender email (Gmail: use App Password) |
SMTP_MAIL_PASSWORD |
For emails | SMTP password |
IMAP_MAIL / IMAP_MAIL_PASSWORD |
For cancel flow | Same as SMTP for Gmail |
CRON_SECRET |
Optional | Protects /api/cron/email-observer |
See .env.example for the full list.
| Command | Description |
|---|---|
npm run dev |
Start dev server |
npm run build |
Production build |
npm run start |
Start production server |
npm run email-observer |
Run IMAP observer (standalone) |
| Route | Purpose |
|---|---|
/ |
Voice Chat |
/crm |
CRM Dashboard |
/properties |
Properties grid |
/properties/[id] |
Property details |
/contacts |
Contacts list |
Additional features we may add—useful to mention in demos:
| Feature | Description |
|---|---|
| Reschedule via email | When a customer replies "can we move it to next week?", auto-propose new slots and confirm via email thread |
| SMS channel | Send meeting reminders and handle replies via Twilio; qualify leads who text instead of chat |
| Twilio voice | Real phone calls—inbound/outbound with speech-to-text; no browser required |
| Agent handoff | When lead is hot or requests human, flag in CRM and notify agent; warm transfer option |
| Compliance scripts | Auto-check disclosures, fair housing language, and required scripts before closing |
| Personalization memory | Remember preferences across sessions (e.g. "no HOA", "must have backyard") for repeat visitors |
| Nurture sequences | Automated outbound follow-ups for cold leads—objection handling, re-engagement emails |
| Calendar sync | Google Calendar / Outlook integration for real availability and automatic booking |
| Lead scoring | Score leads by intent, budget, timeline; surface hottest leads first in CRM |
| Technology | Version | Purpose |
|---|---|---|
| Next.js | 16 | React framework with App Router, API routes, server components, and Vercel deployment |
| React | 19 | UI components, hooks, and client-side interactivity |
| TypeScript | 5 | Type safety and better developer experience |
| Technology | Purpose |
|---|---|
| Google Gemini | Large language model for conversation, lead qualification, property suggestions, and email intent classification |
| Vercel AI SDK | Streaming chat, tool calling, and structured outputs for the voice assistant |
| Zod | Schema validation for AI tool inputs and structured responses |
| Technology | Purpose |
|---|---|
| MongoDB | NoSQL database for leads, contacts, schedules, and properties |
| Mongoose | ODM for schemas, models, queries, and relationships |
| Technology | Purpose |
|---|---|
| Nodemailer | SMTP transport for sending meeting confirmation and cancellation reply emails |
| ImapFlow | IMAP client for fetching inbox and detecting replies to meeting confirmations |
| mailparser | Parsing email bodies and headers (In-Reply-To, References) for threading |
| Technology | Purpose |
|---|---|
| Web Speech API | Browser-based speech recognition (voice input) and synthesis (text-to-speech) |
| Lottie | Animated illustrations (e.g. email confirmation animation) |
| Embla Carousel | Image carousel on property details page |
| Technology | Purpose |
|---|---|
| Tailwind CSS | Utility-first styling and responsive design |
| Radix UI | Accessible primitives (dialogs, dropdowns, tabs) |
| Lucide React | Icon set |
| Motion | Animations and transitions |
| Recharts | CRM dashboard charts (leads, meetings over time) |
| Technology | Purpose |
|---|---|
| node-cron | Scheduled tasks for the standalone email observer script |
| dotenv | Loading environment variables in scripts |
| tsx | Running TypeScript scripts (email observer) |
| nanoid | Unique ID generation |








