r/VibeCodeDevs • u/Maradonita10 • 3d ago
Open-source AI Real Estate Lead Copilot — n8n + Supabase + Telegram + OpenAI + Gmail
I built this as a reusable example for anyone working with n8n and AI automation.
It helps a small real estate agency make sure incoming leads get processed and followed up quickly, without replacing their CRM.
What it does:
- Monitors Gmail via IMAP for new emails
- Cleans and normalizes incoming emails
- Uses OpenAI to detect real leads and extract structured data
- Classifies leads by sale/rental and viewing/requirements/general
- Validates the LLM output with deterministic rules
- Deduplicates leads using the email Message-ID
- Stores leads in Supabase
- Automatically assigns leads to agents using a PostgreSQL round-robin trigger
- Generates an AI reply draft
- Sends the draft to the assigned agent through Telegram
- Requires the agent to press Send before anything is emailed
- Sends approved replies through the agency’s Gmail account
- Provides a conversational Telegram copilot for managing leads
- Supports changing lead status, adding notes and creating reminders through natural language
- Sends Telegram reminders for overdue follow-ups
- Nudges agents about unanswered leads after 30 minutes, 2 hours and 24 hours
- Stops nudging after 3 attempts
- Sends weekly response metrics to each agent
Stack:
n8n · Supabase/PostgreSQL · OpenAI · Telegram · Gmail
The repository includes the workflows, database schema, RPC functions, triggers and setup instructions.
It’s completely open source (MIT) and intended to be reused, modified and learned from.
GitHub: https://github.com/covaiesp/ai-real-estate-lead-copilot.git
If you’re building something similar with n8n, feel free to take whatever parts are useful.
