✦ AI-Native Lead Intelligence & Routing System
A single-application CRM that unifies lead ingestion across web forms, Telegram, and Google Sheets, using background scrapers and local LLMs to compile instant intelligence briefs.
🏗️ Ingestion & Enrichment Pipeline
The system is architected with a decoupled processing model. FastAPI ingests the incoming contact records instantly, then dispatches non-blocking async tasks to run the enrichment pipeline:
graph TD
A[Web Inbound Channels] -->|Webhook| F[FastAPI Backend]
F -->|Store Record| DB[(PostgreSQL JSONB)]
F -->|Spawn Asynchronous Process| EP[Enrichment Pipeline]
EP -->|1. Web Search| T[Tavily Search API]
EP -->|2. Deep Scraper| FC[Firecrawl Scraper]
EP -->|3. Local LLM Urgency Rating| O[(Local Ollama Server)]
EP -->|Update Intelligence Profile| DB
EP -->|Route Critical Alert| TG[Telegram Alerts]
🔄 Closed-Loop Communication Tracking
The system connects directly to the Gmail API via OAuth, mapping incoming user messages to specific lead profiles based on internal mail thread headers.
- Auto-Drafting Assistant: Every time a new response is received from a lead, a background worker requests local model suggestions to draft replies, saved under
ai_drafts. - Single-Click Approval: Operators can review, modify, and dispatch drafts directly from the timeline view.
Performance & Ingestion Metrics
- 40% Lead Response Reduction: The automated Gmail copilot reduced median lead response times by 40% through contextual auto-drafting.
- 95% Classification Accuracy: Local Ollama models achieved 95% classification accuracy in parsing unstructured lead briefs and scoring urgencies.
- Sub-1.2s Sync Latency: Inbound webhook integrations process lead data and sync communications in < 1.2s.
⚡ Technical Implementation Specifications
- State Storage: Handled in PostgreSQL using native
JSONBfields for unstructured crawler data. - Inbound Channels: Custom Telegram bot handlers using state-verification decorators to capture email and project details step-by-step.
- Notification System: Dispatches real-time webhooks to Telegram channels and Slack.
Source Code: github.com/VarunDronamraju/mockai-crm