Enterprise DNA
Directories / Use Cases / Build a Lead Scoring Agent

Use case

Build a Lead Scoring Agent

Automatically qualify and score inbound leads from CRM data so sales time goes to the deals most likely to close.

Sales teams lose real hours every week deciding which inbound leads to call first. The problem is not a lack of data. CRM records contain firmographic fields, activity history, and deal stage, but nobody has encoded a scoring rule that runs automatically on every new record. The people who build this are RevOps engineers, growth engineers, or technical sales leaders who want a system that ranks leads without a manual weekly triage call. What makes it genuinely hard is the feedback loop: a scoring model trained on last quarter's closes will drift wrong in weeks if nothing corrects it when won and lost deals come in. The stack below is designed around that reality, not a one-shot classifier.

The stack

Each pick is a real entry on the index. Click any one for the full detail page.

  1. 1
    O OSS Orchestration

    LangGraph

    by LangChain

    Why this: Lead scoring is a multi-step pipeline: fetch record, enrich, score, write back, log. LangGraph's state machine gives you explicit checkpoints at each step so a failed enrichment call does not silently produce a junk score. You can also wire a human-approval node for borderline leads without restructuring the whole graph.

    Full entry
  2. 2
    M MCP CRM record store

    Supabase MCP Server

    by Supabase

    Why this: If your CRM or lead table lives in Supabase, the official MCP server lets the scoring agent read firmographics, activity counts, and previous scores through a scoped token. No service-role key near the model. The write path, updating the priority tier column, goes through the same server with a tighter role.

    Full entry
  3. 3
    M MCP Data access (raw Postgres path)

    Postgres MCP Server

    by Model Context Protocol (reference)

    Why this: Teams on RDS or a non-Supabase Postgres can use the reference Postgres MCP server instead. Pin it to a read-only analytics role for scoring reads and a second, narrowly scoped write role for the tier update. Identical pattern to the Supabase server, just without the project-management tooling.

    Full entry
  4. 4
    A Agents Driver

    Claude Code

    by Anthropic

    Why this: The scoring logic itself, field weighting, firmographic rules, recency decay on activity, lives in a versioned skill file. Claude Code runs that skill on demand or on a cron schedule, making the scoring rules a readable document rather than buried prompt strings. Headless mode handles the nightly batch over new records.

    Full entry
  5. 5
    O OSS Score evaluation

    promptfoo

    by Community

    Why this: Lead scoring without evaluation drifts quietly wrong. Promptfoo runs a YAML test suite against your scoring prompt on every change: does a healthcare company with 50 employees in APAC still land in the right tier after the prompt edit? Declarative, version-controlled, and runs in CI before any updated scorer ships to production.

    Full entry
  6. 6
    O OSS Feedback metrics

    Ragas

    by Community

    Why this: Once won and lost deals accumulate, Ragas gives you a quantitative read on whether the scores predicted outcomes. It runs automated metrics against the scoring pipeline output and actual deal results so you can catch model drift without building a bespoke evaluation harness from scratch.

    Full entry
Why we picked this stack

Get this running with Enterprise DNA.

Enterprise DNA connects this stack through OPM and the CRM layer. When a lead crosses the score threshold, the agent creates an OPM work item with the lead's tier, firmographics, and the scoring rationale attached. That work item shows up in the sales inbox alongside email threads from Omni Mail, so the rep sees context and contact history in one place without switching tools. Secrets for the CRM connection, the Supabase MCP token, and the OpenRouter key all live in Infisical, pulled at runtime by the same secrets pipeline that governs every other agent job in the cockpit.

Free Blueprint

Get the Stack Blueprint

A printable architecture card with every tool, role, and rationale on one page.

Enter your email. We send one useful update per week. Unsubscribe any time.

Alternative stacks

Different angles on the same outcome.