speed-to-lead-agent

speed-to-lead-agent

MCP server for qualifying and responding to inbound leads in seconds using a multi-agent AI pipeline.

Category
访问服务器

README

<div align="center">

⚡ speed-to-lead-agent

Qualify and respond to every inbound lead in seconds — with an AI agent you self-host.

A multi-agent pipeline (LangGraph) that takes a raw inbound lead, scores its fit, drafts a personalized reply, and routes it to your CRM/Slack. Bring your own keys; runs locally with none.

CI Python 3.12 License: MIT Ruff Typed: mypy strict

</div>


Why this exists

Speed is the highest-leverage variable in inbound sales. In the canonical study ("The Short Life of Online Sales Leads," Harvard Business Review, 2011 — Oldroyd, McElheran & Elkington), firms that attempted to contact a lead within an hour were ~7× more likely to have a meaningful conversation with a decision-maker than those who waited just an hour longer — and ~60× more than those who waited 24+ hours. Yet most teams reply in hours or days because a human has to read, qualify, and write every first response.

This agent collapses that delay to seconds: it qualifies the lead, drafts a tailored reply, and hands your team a ready-to-send message (or auto-sends the high-confidence ones) — so no good lead goes cold while someone is in a meeting.

Self-hosted and open-source. A free, ownable alternative to per-seat "instant lead response" SaaS — your lead data never leaves your infrastructure.

What it does

flowchart LR
    W([Webhook<br/>form · Cal · Typeform]) -->|202, instant| Q[[Redis queue]]
    Q --> R(research<br/>enrich company)
    R --> QL(qualify<br/>fine-tuned classifier)
    QL -->|spam/non-buyer| D[discard + log]
    QL -->|real lead| DR(draft<br/>personalized reply)
    DR --> RT(route<br/>CRM · Slack · send)
    RT --> M[(funnel metrics<br/>attribution · latency)]
  • Instant intake — the webhook returns 202 immediately and a worker runs the slow part, so capture never blocks on an LLM call.
  • Explainable qualification — every lead gets a tier (hot/warm/cold/spam), an ICP-fit score, a buyer-intent label, and human-readable reasons. A confidence gate decides auto-send vs. human review.
  • Personalized drafts — intent-aware first-touch replies, provider-agnostic (Gemini/Groq/OpenAI/… via litellm) with a keyless template fallback.
  • Real GTM integrations — Twenty / HubSpot CRM, Slack alerts, email — behind your own keys.
  • Funnel analytics — source attribution, qualification rate, and speed-to-lead p50/p95, exposed as JSON and Prometheus.
  • MCP server — the same capabilities exposed to Claude/Cursor as tools.

Quickstart (zero keys, 2 minutes)

git clone https://github.com/OmateLabs/speed-to-lead-agent
cd speed-to-lead-agent
make install      # uv sync
make demo         # runs sample leads through the full pipeline — no signups

You'll see each sample lead qualified, scored, and routed, plus a funnel summary. Then run the API:

make serve        # http://127.0.0.1:8000  (docs at /docs)

curl -s localhost:8000/leads/sync -H 'content-type: application/json' -d '{
  "email": "maria@northwind-logistics.com",
  "name": "Maria Chen",
  "message": "Need pricing for a 40-person team — can we book a demo?",
  "source": "google_ads"
}' | python -m json.tool

Configuration (bring your own keys)

Copy .env.example to .env. Every key is optional — a missing one disables that feature, it never breaks the app. With none set, you're in DEMO_MODE (local stub model + console adapters).

Variable Enables Required? Get it
LLM_API_KEY + LLM_MODEL LLM-written replies (else templated) optional Gemini / Groq (free)
TWENTY_API_URL + TWENTY_API_KEY Push leads to Twenty CRM optional Twenty → Settings → API
HUBSPOT_API_KEY Push leads to HubSpot optional HubSpot private app
SLACK_WEBHOOK_URL New-lead Slack alerts optional Slack webhooks
WEBHOOK_SIGNING_SECRET Verify inbound webhook signatures recommended self-generated
GREENHOUSE_API_KEY ATS / recruiting-pipeline mode optional Greenhouse Harvest

The classifier

Qualification runs behind a single Qualifier interface with two implementations:

  1. RuleQualifier — a transparent, deterministic baseline (the keyless default). Strong, auditable, zero dependencies.
  2. LoRA-fine-tuned intent classifier — DistilBERT fine-tuned with PEFT/LoRA (PyTorch), 744K trainable params (1.1% of the model), served as its own inference path. make train produces the adapter (~30s on a laptop); when present it loads automatically, otherwise the rule baseline is used.

Result — on a hand-written, held-out realistic set (messages unseen in training):

Strategy Accuracy Macro-F1 $/1k leads
Rule baseline (keyword) 0.500 0.500 $0
LoRA classifier 0.938 0.933 ~$0 (local)

Nearly 2× the intent accuracy of keyword rules on phrasing it never saw — for ~$0, locally, in milliseconds. That's the case for fine-tuning over a per-lead LLM call. Full methodology in docs/benchmarks.md and MODEL_CARD.md.

Tech

Python 3.12 · FastAPI · LangGraph multi-agent · pydantic · litellm · Hugging Face + PEFT/LoRA · FAISS · Redis · MCP · Docker / Helm · GitHub Actions · Langfuse + Prometheus/Grafana.

Project layout

src/speed_to_lead/
├── api/           FastAPI app, webhook security
├── agents/        LangGraph pipeline (research → qualify → draft → route)
├── services/      qualify · enrich · draft  (swappable behind protocols)
├── integrations/  CRM (Twenty/HubSpot) · Slack · email
├── analytics/     attribution + speed-to-lead funnel metrics
├── ml/            LoRA fine-tune + eval (the classifier)
├── worker/        async queue (in-memory → Redis)
└── mcp_server/    Model Context Protocol server

Deploy

  • Single host: docker compose up — api + worker + Redis + Postgres.
  • Kubernetes: helm install stl infra/helm/ (or kubectl apply -f infra/k8s/) — liveness/readiness probes, resource limits, non-root, optional HPA, and bring-your-own-key via a referenced Secret.
  • Serverless: it's a standard ASGI app — deploys to Hugging Face Spaces / Cloud Run / Render unchanged.

Roadmap

  • [x] Multi-agent pipeline + keyless demo + funnel analytics
  • [x] LoRA-fine-tuned classifier + eval scorecard
  • [x] MCP server · FAISS ICP similarity · ATS (Greenhouse) connector
  • [x] Langfuse tracing + Prometheus/Grafana dashboards (config-as-code)
  • [ ] Deploy (HF Spaces / Cloud Run) + demo GIF

License

MIT © 2026 Omate Labs

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选