Skip to content

Shreyaav18/sdr-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SDR Agent

Autonomous outreach pipeline that researches leads, writes personalized emails, sends them, and follows up — without human input after the initial lead is added.

Built on top of Naïve's unified API primitives for search and email, with Gemini for email generation and a FastAPI + Next.js stack underneath.

Why This Exists

Sales outreach is repetitive and time-sensitive. SDR Agent replaces the manual loop of researching a prospect, writing a contextual email, sending it, and remembering to follow up. Every action is traceable — research results, email content, send timestamps, and reply status are all stored and visible. The human stays in control of who gets added to the pipeline; everything after that runs autonomously.

Pipeline

Lead Input (Name, Company, Email)
          │
          ▼
┌─────────────────────┐
│  Stage 1            │
│  Lead Research      │  ← Naïve Search API (web search + URL extraction)
│                     │    builds company context per lead
└─────────┬───────────┘
          │ Research stored to DB
          ▼
┌─────────────────────┐
│  Stage 2            │
│  Email Generation   │  ← Gemini 1.5 Flash
│                     │    personalized email from research context
└─────────┬───────────┘    returns subject + body as structured JSON
          │
          ▼
┌─────────────────────┐
│  Stage 3            │
│  Email Dispatch     │  ← Naïve Email API
│                     │    provisions inbox, sends outreach
└─────────┬───────────┘    stores message ID + follow-up schedule
          │
          ▼
┌─────────────────────┐
│  Stage 4            │
│  Reply Tracking     │  ← APScheduler (runs hourly)
│  + Follow-up Loop   │    polls inbox for replies
│                     │    auto-sends follow-up if no reply in N days
└─────────────────────┘    updates lead status throughout

Tech Stack

Layer Choice Why
Backend FastAPI + Python async, typed, production-standard
Database PostgreSQL relational schema, UUID primary keys
ORM SQLAlchemy typed models, clean session management
Scheduling APScheduler lightweight follow-up loop, no Redis overhead
Search + Email Naïve API unified primitives for web search and email dispatch
Email Generation Gemini 1.5 Flash free tier, structured JSON output, fast
Frontend Next.js + TypeScript table + kanban pipeline view, real-time status

Design Principles

One API key, one credit balance. All search and email operations go through Naïve's unified API. No stitching together separate services for web search, email provisioning, and inbox management.

Stateful by default. Every lead moves through a defined status lifecycle: pending → researching → researched → emailed → followed_up → replied. No action can be taken out of order — the API enforces state transitions.

Research before email. The send endpoint rejects requests unless research has been completed. This ensures every email is grounded in actual context, not a generic template.

Human controls the list, the agent controls the rest. Once a lead is added, research, email generation, dispatch, and follow-up all run without further input. The dashboard exists to observe and inspect, not to manually drive each step.

About

Autonomous outreach pipeline that researches leads, writes personalized emails, sends them, and follows up — without human input after the initial lead is added. Built on top of Naïve's unified API primitives for search and email, with Gemini for email generation and a FastAPI + Next.js stack underneath.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors