Skip to main content
Prerequisites: Completed the Deploy Your First Agent tutorial

What You’ll Build

In this tutorial, you’ll create a lead scoring agent that:
  • Scores candidates based on job descriptions using AI
  • Ranks leads automatically with intelligent analysis
  • Generates personalized emails for top candidates
  • Provides a complete SaaS solution with frontend and backend
  • Uses CrewAI flows for multi-agent orchestration

The Lead Scoring Challenge

Recruiting and lead qualification is time-consuming:
  • Manual screening: Reviewing hundreds of resumes manually
  • Inconsistent scoring: Different recruiters score differently
  • Email personalization: Writing personalized emails takes hours
  • Scalability: Hard to scale manual processes
RunAgent solves this by automating the entire lead scoring workflow with AI agents that can analyze, score, and communicate with candidates.

Architecture Overview

The lead scoring agent uses a multi-layered architecture:

Step 1: Understanding the Agent Structure

The lead scoring agent uses CrewAI flows to orchestrate multiple AI agents: Key Components:
  • LeadDataCollectionCrew: Collects and validates lead data
  • LeadAnalysisCrew: Analyzes candidate profiles
  • LeadScoringCrew: Scores candidates based on job requirements
  • EmailGenerationCrew: Creates personalized emails
Entrypoints:
  • lead_score_flow: Main flow that orchestrates the entire process
  • score_candidate: Score a single candidate

Step 2: Agent Configuration

The agent is configured using runagent.config.json:

Step 3: Core Agent Logic (Gist)

The agent processes candidates through multiple stages:

Step 4: Backend Integration

The Flask backend provides REST API endpoints:

Step 5: Frontend Integration

The React frontend provides a user-friendly interface: Key Features:
  • CSV upload for candidate data
  • Job description input
  • Real-time scoring results
  • Email preview and download
  • Top candidates visualization

Step 6: Deployment

Local Deployment

Production Deployment

The agent can be deployed to RunAgent Cloud:

What You’ve Accomplished

You’ve built a complete lead scoring SaaS solution:

🤖 AI-Powered Scoring

Automated candidate scoring using multi-agent AI workflows

📊 Intelligent Ranking

Automatic ranking of candidates based on job fit

✉️ Email Generation

Personalized email generation for top candidates

🌐 Full-Stack Solution

Complete SaaS application with frontend and backend

Key Features

Multi-Agent Orchestration

  • Uses CrewAI flows to coordinate multiple specialized agents
  • Each agent handles a specific aspect of the scoring process
  • Parallel processing for efficient candidate evaluation

Intelligent Scoring

  • Analyzes candidate profiles against job requirements
  • Considers skills, experience, and cultural fit
  • Provides detailed scoring breakdowns

Email Personalization

  • Generates context-aware emails for each candidate
  • Incorporates specific candidate details
  • Maintains professional tone and structure

Example Usage

Next Steps

Customize Scoring

Customize scoring criteria and weights

Add Features

Add features like candidate tracking and analytics

Production Deployment

Deploy to production with proper scaling

View Full Example

Explore the complete example code

Repository

View the complete example code and documentation: Repository: https://github.com/runagent-dev/runagent/tree/main/examples/lead-agent The repository includes:
  • Complete agent implementation with CrewAI flows
  • Flask backend API
  • React frontend application
  • Deployment guides and documentation
  • Example CSV files and test data
🎉 Great job! You’ve learned how to build a production-ready lead scoring system using RunAgent and CrewAI. This demonstrates the power of multi-agent orchestration for complex business workflows!

Still have a question?