Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/vrashmanyu605-eng/Agentic_Sales-Markerting/llms.txt

Use this file to discover all available pages before exploring further.

The ICP matching agent decides how well a discovered lead fits your ideal customer profile (ICP). It takes the structured research report produced by the lead research agent and your ICP definition, then enriches the analysis with live industry benchmark data from the web. The LLM scores the lead across multiple dimensions and returns a structured assessment that determines how aggressively to pursue the opportunity.

State inputs

lead_research
string
required
The JSON string produced by the lead research agent. Contains the company summary, industry, likely pain points, lead quality, and recommended contacts.
ideal_customer_profile
string
required
A description of your ideal customer. Can be plain text or a structured document defining company size, industry, tech stack, pain points, and buying signals.
target_industry
string
The industry to use when generating the ICP benchmark search query. Defaults to "manufacturing" if not provided.

State outputs

icp_analysis
string
required
A JSON string containing the LLM’s ICP match assessment. See output schema for the full field list.

What it does

1

Build an ICP benchmark search query

The agent constructs a targeted search query using target_industry from state — for example, "Ideal Customer Profile benchmarks for manufacturing IT services". This surfaces industry-specific data that grounds the LLM’s scoring in real-world context rather than generic reasoning.
2

Fetch live benchmarks

The agent calls web_search with the benchmark query and passes the results directly to the LLM. This gives the model current data on typical deal sizes, adoption rates, and buying patterns for the target industry.
3

Score the lead against the ICP

The agent sends lead_research, ideal_customer_profile, and icp_benchmarks to the LLM and asks it to evaluate the lead across seven dimensions: match score, matching attributes, missing attributes, revenue potential, urgency level, buying probability, and best service fit. The LLM returns structured JSON only.

Tools used

web_search

Fetches current ICP benchmarks for the target industry to inform the LLM’s scoring.

Output schema

The LLM is prompted to return structured JSON only. The expected structure is:
{
  "icp_match_score": 82,
  "matching_attributes": [
    "Mid-market company size (200-500 employees)",
    "Manufacturing industry",
    "Active ERP modernization project"
  ],
  "missing_attributes": [
    "No existing cloud infrastructure",
    "No dedicated IT budget line item found"
  ],
  "revenue_potential": "$120,000 - $180,000 annually",
  "urgency_level": "High",
  "buying_probability": "65%",
  "best_service_fit": "ERP Integration & Cloud Migration"
}
icp_match_score is a 0–100 integer. Downstream agents (outreach generation, proposal generation) use the full icp_analysis string to tailor messaging to the lead’s specific strengths and gaps.

Source code

import json
from llm import llm
from tools.search_tool import web_search

def icp_matching_agent(state):
    lead_research = state["lead_research"]
    ideal_customer_profile = state["ideal_customer_profile"]

    # Search for industry-specific ICP benchmarks
    search_query = f"Ideal Customer Profile benchmarks for {state.get('target_industry', 'manufacturing')} IT services"
    icp_benchmarks = web_search(search_query)

    response = llm.invoke(
        f"""
        You are an ICP Matching Agent.

        Compare the lead against the Ideal Customer Profile using provided research and industry benchmarks.

        Lead Research:
        {lead_research}

        ICP Definition:
        {ideal_customer_profile}

        Industry ICP Benchmarks:
        {json.dumps(icp_benchmarks, indent=2)}

        Analyze:
        - icp_match_score
        - matching_attributes
        - missing_attributes
        - revenue_potential
        - urgency_level
        - buying_probability
        - best_service_fit

        Return structured JSON only.
        """
    )

    return {
        "icp_analysis": response.content
    }

Build docs developers (and LLMs) love