Avneesh.
04AI Automation← All projects
LiveAI Automation

Cold E-Mailer

AI-powered B2B cold outreach engine that researches prospects in real-time and generates personalized emails, LinkedIn messages, and WhatsApp messages via a production FastAPI backend.

Role
Backend Engineer
Type
AI SaaS API
Year
2025
Timeline
6 months
Cold E-Mailer
4
Outreach Channels (Email, LinkedIn, WhatsApp, Follow-up)
12
Tavily API Keys in Rotation
3
LLM Providers Supported (Gemini, GPT, Bedrock)
5
Async Research Steps per Request

Overview

Orbit Cold Mailer is a production FastAPI backend that orchestrates multi-channel B2B cold outreach. It ingests buyer profiles and seller context, runs AI research using Tavily web search and LinkedIn post analysis, and generates hyper-personalized cold emails, LinkedIn messages, WhatsApp messages, and follow-up emails — each on its own dedicated route. The system supports multiple LLM backends (Gemini Flash, OpenAI GPT, AWS Bedrock) behind a unified router and streams real-time research progress via WebSocket.

Key features

Cold Email Generation

Generates personalized B2B cold emails via /cold-email with AI-researched buyer context, banned-word enforcement, and a strict no-hallucination guarantee.

LinkedIn Message Generation

Produces concise sub-500-character messages via /cold-message, tailored to the buyer's profile and recent company activity.

WhatsApp Message Generation

Creates WhatsApp-ready outreach via /cold-whatsapp using the same research-first pipeline as cold email.

Follow-up Email Engine

Generates contextual follow-ups via /followup that reference the original subject and body for thread continuity.

Real-time WebSocket Streaming

Pushes each research step as a live chunk to the client over WebSocket so the UI updates while the pipeline is still running.

Multi-LLM Router

Unified abstraction routing to Gemini Flash, OpenAI GPT, or AWS Bedrock with automatic failover between providers.

Tavily Web Research with Key Pooling

Runs date-scoped advanced web searches using a 12-key Tavily pool — failed keys are skipped automatically so research never stalls.

LinkedIn Insight Extraction

Parses buyer and company LinkedIn activity to extract buying intent, opportunities, sentiment, writing style, and mentioned technologies.

Built with

PythonFastAPIPydanticGoogle Gemini 2.5 FlashOpenAI GPTAWS BedrockLangChainTavilyPostgreSQLasyncpgWebSocketuvicorn
Problem

Sales teams spend hours researching a prospect only to send a cold email that still ends up generic. There is no scalable way to produce outreach that references a prospect's real recent activity, business pain points, and company-specific context while staying concise, natural, and conversion-focused across email, LinkedIn, and WhatsApp.

Approach

Eliminates manual prospect research by autonomously generating hyper-personalized cold emails, LinkedIn messages, and WhatsApp messages using real-time data — covering all outreach channels from a single API call.

Engineering challenges

01

Orchestrating multi-step AI research (LinkedIn analysis, company insights) inside a single API request without hitting timeout limits.

02

Supporting Gemini, GPT, and AWS Bedrock with transparent failover so prompts never need to change across providers.

03

Managing 12 Tavily API keys with automatic rotation to prevent rate-limit failures during high traffic.

04

Streaming incremental research progress in real-time via WebSocket while async pipeline tasks run concurrently.

05

Mapping heterogeneous buyer/seller input into a strict Pydantic model before passing to the LLM pipeline.

06

Preventing hallucinations in generation — only facts explicitly present in the prompt may appear in the output.

Key decisions

FastAPI over Flask — native async/await support enables concurrent research tasks without thread-pool overhead.

Pydantic models at every layer — input validation, LLM structured output, and company insights — for end-to-end type safety.

LLM router abstraction built so Gemini, GPT, and Bedrock are interchangeable without touching any prompt or business logic.

Tavily multi-key pool implemented as an ordered failover list so one exhausted key never blocks a live request.

WebSocket route added alongside REST endpoints to push each research step to the client without polling.

Email prompt engineered with an explicit no-hallucination rule so the model can only use data provided in the context.

Cold E-MailerView live