CoolFace
Apppublic

Mervecaliskan/ai-lead-scoring-agent

sourceHugging Faceupdated 8mo agoView on Hugging Face
0likes
App README

🏒 Enterprise AI Lead Scoring Agent

Python OpenAI Gradio Status

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, and storage modules.
  • β€”πŸ“Š Automatic Scoring: Classifies leads as Hot πŸ”₯, Warm 🟑, or Cold ❄️ based on budget, urgency, and tone.
  • β€”πŸ’Ύ Feedback Loop: Persistently logs every interaction to feedback_log.json for 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.

text
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:

[image]

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