Mervecaliskan/ai-lead-scoring-agent
0
π’ Enterprise AI Lead Scoring Agent
A modular, production-ready AI agent that automates lead qualification using a hybrid architecture (LLM + Rule-Based Logic).
π Overview
This project demonstrates a software engineering approach to Data Science. Instead of a single monolithic script, it utilizes a micro-service inspired architecture to separate concerns between the AI Agent, Decision Logic, and Data Persistence.
π Key Features
- π§ Hybrid Intelligence: Uses GPT-4o-mini for semantic understanding of customer messages and strict Python Logic for business rules.
- ποΈ Modular Design: Clean separation of
agent,decision, andstoragemodules. - π Automatic Scoring: Classifies leads as Hot π₯, Warm π‘, or Cold βοΈ based on budget, urgency, and tone.
- πΎ Feedback Loop: Persistently logs every interaction to
feedback_log.jsonfor future model fine-tuning. - π‘οΈ Robust Error Handling: Validates inputs using Pydantic models.
π οΈ System Architecture
The system is designed with a Micro-Service inspired architecture. The main application controller (app.py) orchestrates the data flow between the AI, Logic, and Storage layers.
ai-lead-agent/
βββ π app.py # Main Entry Point & Orchestrator (Gradio UI)
βββ π§ agent.py # AI Logic Layer (OpenAI Integration)
βββ βοΈ decision.py # Business Rules Engine (Deterministic Logic)
βββ π models.py # Pydantic Schemas (Data Validation)
βββ π¬ prompts.py # Centralized Prompt Management
βββ πΎ feedback.py # JSON Logging & Persistence System
βββ βοΈ requirements.txt # Project Dependencies
βββ π README.md # Documentationπ― Live System Demo
Here is the AI Agent in action, analyzing a high-priority lead:
Scenario: A user named "John Dae" from a Tech Corp needs an urgent AI solution with a high budget. Result: The system correctly identifies this as a "Hot Lead" π₯ and triggers the sales team notification.
π¨βπ» Author
Merve CALISKAN MSc Data Science Student @ Dokuz EylΓΌl University
Focus: Machine Learning, AI Agents, AI Engineering
Goal: Building scalable and explainable AI systems.
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
