Lead Generation Agent (Inbound)
Reads new enquiries, scores them and drafts a reply that a person approves before anything is sent.
OpenAI Agents SDK · scoring and guardrails in code · 216 tests · demo dashboard on GitHub Pages

Enquiries from web forms and messages arrive incomplete and vary in quality, and they need a quick, careful reply. An AI that replies on its own can promise prices, savings or dates the business cannot honour.
The agent chooses its own tools and steps, but the hard rules are enforced in code: the score comes from the rule book, routing to nurture is decided from the facts, complaints always go to a person, and every draft is checked before it is saved. There is no tool that sends anything; drafts wait for human approval.
Key features
- 01
Extracts intent, property type, monthly bill, location, timeline and product interest, then works out in code what is still missing.
- 02
Scores leads from 1 to 10 using five signals in a YAML rule book. The score always comes from the rubric, never from the model.
- 03
Routes each lead to a draft reply, human handover, nurture or spam. Complaints, anger and legal threats are detected in code and always handed to a person.
- 04
Checks every draft: no prices, savings or dates, the customer's language (English, Roman Urdu or Urdu), at most three questions, and never asking for details already on file.
- 05
Duplicate check, prompt-injection screening and hard limits on leads, tool calls and tokens per run.
- 06
Local FastAPI server and a React and TypeScript dashboard whose approve, reject and hand over buttons only record a decision, plus an optional Google Sheets mirror.
Architecture
- 1Enquiry (web form, webhook, CSV or Google Sheet)
- 2Runner with limits and duplicate check
- 3Agent (OpenAI Agents SDK)
- 4Tools and guardrails in code (scoring rubric, routing, draft checks)
- 5Local storage
- 6FastAPI server
- 7React dashboard where a person approves
Results
Ships with 28 evaluation cases that run on a mock model in CI or on a real model on demand, 216 tests, and a demo dashboard on GitHub Pages using fictional data. Other model providers can be selected by configuration; only OpenAI has been run with a real key.