A revolutionary AI-infused automation system for real estate professionals. Built with Node.js, featuring magical AI automation, comprehensive MCP servers, advanced orchestration, domain expertise, and production-ready deployment capabilities.
- Magical Automation Engine: AI-infused system with 89.5% magic score
- 5 Operational AI Agents: Specialized real estate expertise (91.2% avg intelligence)
- 4 Automated Workflows: Complete real estate domain automation
- Enhanced VertexAI MCP Server v2.0: Skills, rules, and cohesive integration
- Production-Ready Orchestration: Master orchestrator with fallback and guardrails
- Google Vertex AI: Gemini models with 8 MCP tools for advanced AI capabilities
- Local LLAMA Integration: 25+ optimized models with intelligent orchestration
- Dual AI Strategy: Local processing (free) + Cloud backup (paid)
- Real Estate Specialized: Document analysis, lead scoring, property matching
- 11 LLAMA Tools: Text generation, code creation, image analysis, embeddings
- Semantic Search: Advanced property and lead matching capabilities
- 100% Whapi.Cloud API Coverage: 35+ MCP tools for complete automation
- Advanced Features: Stories, newsletters, business profiles, groups, labels
- Real-time Communication: Two-way messaging with media support
- Contact Management: Advanced contact database and segmentation
- Multi-factor Lead Scoring: AI-powered qualification with reasoning models
- A-F Grading System: Comprehensive lead quality assessment
- Automated Workflows: Scheduled campaigns and intelligent response routing
- Document Processing: OCR for contracts and property documents
- Property Analysis: AI-powered image analysis and feature extraction
- WhatsApp: Primary channel with advanced features
- Telegram: Bot integration with rich media support
- Email: SMTP/IMAP integration with SpaceEmail
- LinkedIn: Professional networking automation
- Facebook: Social media outreach capabilities
- Human Oversight: All outbound messages require explicit approval
- Real-time Dashboard: Web interface for approvals and monitoring
- Audit Trail: Complete message history and approval records
- Safety Controls: Rate limiting and content filtering
- Unified Database Manager: Combines Neon PostgreSQL and Supabase for optimal performance
- Real-time Subscriptions: Live updates for approvals, leads, and events
- Advanced Schema: Leads, approvals, events, agents with full relationships
- Migration Tools: CSV to PostgreSQL migration with data integrity
- Connection Pooling: High-performance database connections with failover
- Analytics Engine: Built-in metrics, trends, and reporting
Key Components:
NeonIntegrationService: Primary PostgreSQL storage and analyticsSupabaseIntegrationService: Real-time updates, auth, and storageUnifiedDatabaseManager: Unified interface combining both systems
- Complete REST API: Full mobile application support
- Offline Sync: Data synchronization for mobile devices
- Push Notifications: Real-time alerts for approvals and updates
- Agent Profiles: Mobile-optimized agent management
- Lead Management: On-the-go lead access and updates
- Approval System: Mobile approvals with one-click actions
Key Endpoints:
/api/mobile/leads/*: Lead CRUD operations and search/api/mobile/approvals/*: Approval management and history/api/mobile/dashboard/*: Real-time metrics and analytics/api/mobile/sync/*: Offline data synchronization
- Real-time Dashboards: Live metrics and KPI tracking
- VRCL Integration: Market data, trends, and predictive analytics
- Lead Analytics: Conversion funnels, response times, source tracking
- Agent Performance: Top performers, activity metrics, leaderboards
- System Health: Database, API, and MCP server monitoring
- Custom Reports: Flexible reporting with multiple export formats
Analytics Features:
- Market trend analysis with VRCL data
- Lead conversion funnel optimization
- Agent performance benchmarking
- System performance monitoring
- Predictive analytics and forecasting
- Zillow Integration: Property listings, market data, and agent matching
- Realtor.com Integration: Comprehensive property database and analytics
- MLS Integration: Multiple MLS providers (Rapido, Trestle, Spark)
- Automated Sync: Real-time property data synchronization
- Property Matching: AI-powered property recommendations
- Market Intelligence: Competitive analysis and market insights
Integration Features:
- Real-time property data sync
- Automated lead-to-property matching
- Market trend analysis
- Competitive intelligence
- Webhook handlers for live updates
- Multi-modal Communication: Voice messages and video calls
- AI Transcription: Automatic transcription with sentiment analysis
- Video Conferencing: Integrated video calling with recording
- Voice Analytics: Sentiment analysis and conversation insights
- Storage Management: Cloud storage for media files
- Cost Tracking: Per-minute cost analysis and optimization
Communication Features:
- Voice message recording and transcription
- Scheduled and instant video calls
- Multi-participant video conferences
- Screen sharing and collaboration
- Call recording and playback
- Advanced Scoring Algorithm: Multi-factor property matching
- Machine Learning: Feedback-driven recommendation improvement
- Preference Learning: Adapts to user behavior over time
- Market Insights: AI-generated property analysis and advice
- Alternative Suggestions: Similar property recommendations
- Investment Analysis: ROI and appreciation potential
Matching Features:
- Location, price, and property type scoring
- Feature and amenity matching
- School and transportation analysis
- Lifestyle compatibility assessment
- Market trend integration
Neon PostgreSQL (Primary Storage)
βββ Leads (customer data, preferences, status)
βββ Approvals (message approval workflow)
βββ Events (communication history)
βββ Agents (agent profiles and performance)
βββ Analytics (metrics and reporting)
Supabase (Real-time & Auth)
βββ Real-time Subscriptions
βββ Authentication & Authorization
βββ File Storage (media, documents)
βββ Row Level Security
Mobile API Service
βββ Lead Management (CRUD, search, analytics)
βββ Approval System (pending, history, actions)
βββ Agent Profiles (performance, metrics)
βββ Dashboard (real-time data, KPIs)
βββ Sync Services (offline support)
βββ Notifications (push alerts, webhooks)
CRM Integration Service
βββ Zillow API (listings, market data)
βββ Realtor.com API (property database)
βββ MLS Providers (Rapido, Trestle, Spark)
βββ Property Matching (AI recommendations)
βββ Market Analytics (VRCL integration)
Voice & Video Service
βββ Voice Messaging (Twilio/Vonage)
βββ Video Calling (Twilio/Agora)
βββ Transcription (OpenAI/Google)
βββ Storage (S3/GCS/Azure)
βββ Analytics (usage, costs, sentiment)
Property Matching Engine
βββ Scoring Algorithm (multi-factor)
βββ Machine Learning (feedback adaptation)
βββ AI Insights (OpenAI/Claude/Vertex)
βββ Market Analysis (predictive analytics)
βββ Recommendation Engine (personalized)
interface LeadData {
id: string;
first_name: string;
last_name: string;
email?: string;
phone?: string;
property_address?: string;
city?: string;
province?: string;
postal_code?: string;
property_type?: string;
price_range?: string;
timeline?: string;
source?: string;
status?: 'new' | 'contacted' | 'qualified' | 'converted' | 'closed';
assigned_agent?: string;
metadata?: Record<string, any>;
created_at?: Date;
updated_at?: Date;
}interface ApprovalData {
id: string;
lead_id: string;
type: 'message' | 'email' | 'call' | 'meeting';
content: string;
channel: 'whatsapp' | 'email' | 'sms' | 'phone';
status: 'pending' | 'approved' | 'rejected' | 'sent';
ai_score?: number;
reviewed_by?: string;
reviewed_at?: Date;
metadata?: Record<string, any>;
created_at?: Date;
}interface PropertyFeatures {
basic: {
id: string;
address: string;
city: string;
neighborhood: string;
price: number;
beds: number;
baths: number;
sqft: number;
lotSize: number;
yearBuilt: number;
propertyType: string;
listingStatus: string;
daysOnMarket: number;
};
location: {
coordinates: { lat: number; lng: number };
walkScore: number;
transitScore: number;
schoolRating: number;
nearbyAmenities: string[];
commuteTimes: Record<string, number>;
};
features: {
interior: string[];
exterior: string[];
appliances: string[];
amenities: {
pool: boolean;
gym: boolean;
office: boolean;
smartHome: boolean;
};
};
market: {
priceHistory: Array<{ date: string; price: number }>;
comparableSales: Array<{ address: string; price: number }>;
marketTrend: 'rising' | 'stable' | 'declining';
};
}interface LeadAnalytics {
totalLeads: number;
newLeads: number;
conversionRate: number;
averageResponseTime: number;
leadsByStatus: Record<string, number>;
leadsBySource: Record<string, number>;
conversionFunnel: {
new: number;
contacted: number;
qualified: number;
converted: number;
closed: number;
};
trends: {
daily: Array<{ date: string; leads: number; conversions: number }>;
weekly: Array<{ week: string; leads: number; conversions: number }>;
monthly: Array<{ month: string; leads: number; conversions: number }>;
};
}- Local-First Storage: CSV-based with upgrade path to PostgreSQL
- Flexible Architecture: Support for multiple database backends
- Browser Automation: Playwright-powered human-in-the-loop automation
- MCP Integration: 5 extensible tool servers for enhanced capabilities
RE-Engine/
βββ engine/ # Core Node.js engine (TypeScript)
βββ playwright/ # Browser automation harness
βββ mcp/ # MCP servers for tool integration
β βββ reengine-outreach/ # WhatsApp integration (35+ tools)
β βββ reengine-vertexai/ # Google Vertex AI integration (8 tools)
β βββ reengine-llama/ # Local LLAMA integration (11 tools)
β βββ reengine-tinyfish/ # Web scraping server
β βββ whapi-mcp-optimal/ # Official Whapi.Cloud server
βββ docs/ # Documentation and specs
βββ tests/ # Unit and integration tests
βββ scripts/ # Deployment and utility scripts
- Node.js v22+
- macOS (current MVP target)
- 8GB+ RAM (for local AI models)
- 50GB+ storage (for AI models)
- Ollama (for local LLAMA models)
- Google Cloud Project (for Vertex AI)
- API Keys: Vertex AI, Whapi.Cloud, SpaceEmail
- Whapi.Cloud (WhatsApp Business API)
- SpaceEmail (SMTP/IMAP email service)
- Social Media (Telegram, LinkedIn, Facebook bots)
git clone https://github.com/stackconsult/RE-Engine.git
cd RE-Enginenpm installnpm install -g openclaw@latest
openclaw onboard --install-daemon# Download and install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull recommended models for real estate
ollama pull llama3.1:8b
ollama pull mistral-small3.2
ollama pull qwen3-coder:30b
ollama pull llama4:16x17b
ollama pull deepseek-r1:32b
ollama pull firefunction-v2:70b
ollama pull qwen3-embedding:8b
ollama pull granite3.2-vision:2b
ollama pull glm-ocr
# Start Ollama server
ollama serve &# Build WhatsApp integration
cd mcp/reengine-outreach
npm install
npm run build
cd ../..
# Build Vertex AI integration
cd mcp/reengine-vertexai
npm install
npm run build
cd ../..
# Build LLAMA integration
cd mcp/reengine-llama
npm install
npm run build
cd ../..
# Build TinyFish scraper
cd mcp/reengine-tinyfish
npm install
npm run build
cd ../..cp .env.example .env
# Edit .env with your credentials# Sign up at https://whapi.cloud/
WHATSAPP_API_KEY="your_whapi_cloud_api_key"
WHATSAPP_API_URL="https://gate.whapi.cloud"
WHATSAPP_WEBHOOK_URL="https://your-domain.cloud/webhook-path"
WHATSAPP_CHANNEL_ID="your_channel_id"
WHATSAPP_PHONE_NUMBER="+1234567890"
WHATSAPP_START_CHAT_LINK="https://wa.me/1234567890?text=Start"# Create Google Cloud Project: creditx-478204
# Enable Vertex AI API
# Create service account and get API key
VERTEX_AI_API_KEY="your_vertex_ai_api_key"
VERTEX_AI_PROJECT_ID="creditx-478204"
VERTEX_AI_REGION="us-central1"
VERTEX_AI_MODEL="gemini-2.5-flash-lite"# Already configured with installation
OLLAMA_API_KEY="25a220dae3084bc597e45ce45a1b4acf.lnm3LOMMFyh-uPM9KZ2urOvX"
OLLAMA_BASE_URL="http://127.0.0.1:11434/v1"
OLLAMA_MODEL="llama3.1:8b"# Sign up at https://space.email/
SPACE_EMAIL_API_KEY="your_space_email_api_key"
SPACE_EMAIL_IMAP_HOST="imap.space.email"
SPACE_EMAIL_SMTP_HOST="smtp.space.email"# Sign up at https://mino.ai/
TINYFISH_API_KEY="your_tinyfish_api_key"
TINYFISH_API_URL="https://mino.ai/v1/automation/run-sse"# Create bot with @BotFather on Telegram
TELEGRAM_BOT_TOKEN="your_telegram_bot_token"
TELEGRAM_WEBHOOK_URL="https://your-domain.cloud/telegram-webhook"# LinkedIn automation service (if applicable)
LINKEDIN_API_KEY="your_linkedin_api_key"
LINKEDIN_WEBHOOK_URL="https://your-domain.cloud/linkedin-webhook"# Facebook Page access token
FACEBOOK_PAGE_ACCESS_TOKEN="your_facebook_page_token"
FACEBOOK_WEBHOOK_URL="https://your-domain.cloud/facebook-webhook"SPACEMAIL_USER="your-email@domain.com" SPACEMAIL_PASS="your-password" SPACEMAIL_IMAP_HOST="mail.spacemail.com" SPACEMAIL_IMAP_PORT="993" SPACEMAIL_SMTP_HOST="mail.spacemail.com" SPACEMAIL_SMTP_PORT="465"
RE_TELEGRAM_ALERT_TARGET="your-chat-id" RE_CONTACT_CAPTURE_ALERTS="telegram"
OLLAMA_API_KEY="your-ollama-api-key"
### MCP Integration (Windsurf Cascade)
The system includes 3 MCP servers automatically configured:
1. **reengine-outreach** - Complete WhatsApp automation with 35+ tools
2. **reengine-tinyfish** - Web scraping and data extraction
3. **whapi-mcp-optimal** - Official Whapi.Cloud API server
Configuration is in `.windsurf/mcp-config.json` and automatically loaded by Windsurf Cascade.
### OpenClaw + Ollama Configuration
Add to `~/.openclaw/openclaw.json`:
```json
{
"agents": {
"defaults": {
"model": {
"primary": "ollama/qwen:7b"
}
}
},
"models": {
"providers": {
"ollama": {
"apiKey": "${OLLAMA_API_KEY}",
"baseUrl": "http://127.0.0.1:11434/v1",
"api": "openai-responses",
"models": [
{
"id": "qwen:7b",
"name": "Qwen 7B",
"reasoning": false,
"input": ["text"],
"cost": {"input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0},
"contextWindow": 32768,
"maxTokens": 32768
}
]
}
}
},
"channels": {
"whatsapp": {
"dmPolicy": "pairing",
"allowFrom": ["+1YOUR_OWNER_PHONE"],
"ackReaction": {
"emoji": "π",
"direct": true,
"group": "mentions"
}
},
"telegram": {
"enabled": true,
"botToken": "YOUR_BOT_TOKEN",
"dmPolicy": "pairing"
}
},
"browser": {
"enabled": true,
"defaultProfile": "openclaw"
}
}
git clone https://github.com/stackconsult/RE-Engine.git
cd RE-Engine
npm installCopy the example env file and fill in your keys:
cp .env.example .env
# Edit .env:
# - WHATSAPP_API_KEY (from Whapi.Cloud)
# - OLLAMA_API_KEY (optional, for local AI)This starts the engine, all MCP servers, and the orchestration layer:
npm run devCheck system health and connected components:
# In a separate terminal
npm run smokeThe system provides comprehensive WhatsApp capabilities:
- Create Leads:
create_lead- Add new leads with scoring - Score Updates:
update_lead_score- Multi-factor lead scoring - Lead Analytics:
get_lead_analytics- Comprehensive reporting
- Text/Media Messages:
send_whatsapp_message- All message types - Interactive Messages: Buttons, lists, and interactive elements
- Carousel Messages: Multi-card interactive presentations
- Poll Messages: Interactive polls for engagement
- Location Messages: Share property locations
- Contact Messages: Share contact information
- Business Profile:
get_business_profile- Manage WhatsApp Business - Product Catalogs:
create_product,send_catalog- Property listings - Newsletter Management:
create_newsletter,subscribe_to_newsletter
- Text Stories:
create_text_story- Status updates - Media Stories:
create_media_story- Photo/video status - Story Management:
get_stories- View published stories
- Create Workflows:
create_workflow_rule- Custom automation rules - Execute Workflows:
execute_workflow- Run automation sequences - Analytics:
get_workflow_analytics- Performance metrics
Access the approval dashboard at http://localhost:3000 to:
- Review pending message approvals
- Approve/reject outbound messages
- Monitor campaign performance
- View lead status and activity
- Track WhatsApp automation metrics
# Show pending approvals
npm run approvals:show
# Approve a message
npm run approvals:approve <approval_id>
# Reject a message
npm run approvals:reject <approval_id>
# Generate daily reports
npm run report:daily
# Test WhatsApp integration
npm run whatsapp:test
# View lead analytics
npm run leads:analyticsThe system uses CSV files for local-first data storage:
leads.csv- Lead information and statusapprovals.csv- Message approval queueevents.csv- Activity log and audit trailcontacts.csv- Channel contact mappingsidentities.csv- Social media identity tracking
Migration path to PostgreSQL (Neon/Supabase):
npm run migrate:postgres# Build the core engine
cd engine
npm run build
# Build Playwright harness
cd ../playwright
npm run build
# Build MCP servers
cd ../mcp
npm run build:all
# Build WhatsApp outreach server
cd reengine-outreach
npm run build
# Build web dashboard
cd ../../web-dashboard
npm run buildβ
Current Status: All TypeScript compilation issues resolved
π¦ Build Target: Node.js v22+ with TypeScript 5.7+
π§ Quality Gates: Linting, type-checking, and smoke tests passing
π WhatsApp Integration: 100% Whapi.Cloud API coverage with 35+ tools
npm test
npm run test:integration
npm run test:smoke
npm run test:whatsappnpm run lint
npm run format
npm run type-check# Start MCP servers
npm run mcp:start
# Test WhatsApp MCP server
npm run mcp:test:whatsapp
# Test TinyFish MCP server
npm run mcp:test:tinyfish- Production Spec - System architecture and requirements
- Agent Instructions - Development guidelines and policies
- WhatsApp Integration Guide - Complete WhatsApp setup
- Enhancement Summary - Feature overview
- Deployment Guide - Production deployment instructions
- Approval-first sending: No outbound messages without explicit approval
- No secrets in repo: All credentials stored in environment variables
- Audit logging: All actions recorded in events.csv
- Pairing-based access: Unknown contacts require manual approval
- WhatsApp Security: API tokens and webhook secrets properly secured
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new functionality
- Submit a pull request
This project is licensed under the MIT License.
- Documentation: docs/
- Issues: GitHub Issues
- Community: Discussions
- Build Issues Resolution: All TypeScript compilation errors fixed
- Production Environment Setup: Docker, deployment scripts, configuration
- Production Testing Infrastructure: Comprehensive testing framework
- Magical Automation Engine: 89.5% magic score achieved
- 5 Operational AI Agents: 91.2% average intelligence
- 4 Automated Real Estate Workflows: Complete domain automation
- Enhanced VertexAI MCP Server v2.0: Skills, rules, cohesive integration
- Complete WhatsApp Integration: 100% Whapi.Cloud API coverage (35+ tools)
- Advanced Lead Management: Multi-factor scoring with A-F grading
- Workflow Automation Engine: Scheduled campaigns and intelligent routing
- MCP Integration: 5 extensible tool servers with Windsurf Cascade
- PostgreSQL/Neon Integration: Primary storage with connection pooling
- Supabase Integration: Real-time subscriptions and authentication
- Unified Database Manager: Abstraction layer combining both systems
- CSV to PostgreSQL Migration: Data migration tools and scripts
- Advanced Schema Design: Leads, approvals, events, agents with relationships
- Mobile API Service: Complete REST API for mobile applications
- Advanced Analytics Service: Real-time dashboards and KPI tracking
- VRCL Integration: Market data and predictive analytics
- Agent Performance Tracking: Metrics, leaderboards, and benchmarking
- System Health Monitoring: Database, API, and MCP server monitoring
- Production Configuration: Environment validation with Zod
- Observability Integration: Sentry error tracking and Pino logging
- Health Check Endpoints: System status and monitoring
- CI/CD Pipeline: GitHub Actions with Docker deployment
- Nginx Configuration: Production-grade reverse proxy and load balancing
- Database Schema Updates: Added
tenant_idto all tables (Neon & Supabase) - Multi-Tenancy Middleware: Request-level tenant context extraction
- Type Augmentation: Extended Express Request with
tenantIdfield - Database Manager Refactoring: All CRUD operations tenant-scoped
- Service Layer Updates: 5 services updated for tenant-aware operations
- Comprehensive Documentation: Workflow, skill, and rules created
- Test Suite: 7 tenant isolation tests for data verification
- Zero TypeScript Errors: All compilation issues resolved
Multi-Tenancy Features:
- Strict data isolation between enterprise tenants
- Middleware-based tenant context propagation
- Consistent parameter patterns across all database operations
- Background service placeholders (CRM sync, migrations)
- Comprehensive test coverage for isolation verification
Documentation Created:
.agent/workflows/multi-tenancy-implementation.md- 6-phase implementation guide.agent/skills/multi-tenancy-refactor/SKILL.md- Patterns and best practices.agent/rules/multi-tenancy-rules.md- 7 mandatory rules and checklistengine/src/scripts/test-tenant-isolation.ts- Comprehensive test suite
- Zillow Integration (property listings, market data)
- Realtor.com Integration (comprehensive property database)
- MLS Integration (Rapido, Trestle, Spark providers)
- Automated Property Sync (real-time data synchronization)
- Property Matching Engine (AI-powered recommendations)
- Voice Messaging (Twilio/Vonage integration)
- Video Calling (Twilio/Agora integration)
- AI Transcription (OpenAI/Google Speech-to-Text)
- Sentiment Analysis (conversation insights)
- Media Storage (S3/GCS/Azure integration)
- Advanced Scoring Algorithm (multi-factor matching)
- Machine Learning Integration (feedback-driven improvement)
- Preference Learning (user behavior adaptation)
- Market Insights (AI-generated analysis)
- Investment Analysis (ROI and appreciation potential)
- Database Schema: Monetization migration (balances, transactions)
- Balance Service: Credit management, deductions, transaction logging
- Stripe Integration: Payment intents, webhooks, top-ups
- Usage Tracking Middleware: Per-operation credit deduction
- Billing API Routes: Balance, transactions, top-up endpoints
- Voice/Video Billing: Credit checks for communications (2-5 credits)
- Multi-Tenant Stripe: Per-tenant API key configuration
Billing Features:
- Credit-based monetization (10 cents per credit)
- Per-tenant Stripe keys (SaaS multi-tenancy)
- Usage tracking for AI matching, voice, video
- Transaction history and balance queries
- Secure webhook handling
- Multi-language Support (i18n): Translation service with en/es locales
- Advanced Reporting & BI: Lead funnel, agent performance, revenue reports
- Third-party Integrations: Webhook service for Zapier/Make
- White-label Capabilities: Tenant branding, custom domains
- Enterprise SSO: SAML 2.0 and OpenID Connect support
Latest Release: Phase 7 - Monetization & Multi-Tenant Billing β
Build Status: β
All TypeScript compilation passing (58 tests)
Test Coverage: 58 tests passing including billing service tests
Documentation: Complete (workflow, skills, rules)
Next Milestone: Phase 8 - Advanced Features
Recent Achievements:
- β Complete monetization system with credit-based billing
- β Multi-tenant Stripe support (each client uses own keys)
- β Voice/Video services integrated with billing (2-5 credits/op)
- β Build-test-commit workflow for safe deployments
- Sign up for required services (Whapi.Cloud, Google Cloud)
- Install the system following the installation guide
- Configure your API keys and credentials
- Import your existing leads via CSV
- Start automating your outreach campaigns
- Clone the repository
- Install dependencies and build MCP servers
- Configure environment variables
- Run development mode with
npm run dev - Contribute following our development guidelines
- GitHub: stackconsult/RE-Engine
- Issues: Report bugs or request features
- Discussions: Community forum
- Documentation: Complete guides
Built with β€οΈ for real estate professionals who want to scale their outreach with AI-powered automation.