The inbound agent's real output is the qualification record

A design for an inbound lead agent where the model extracts, plain rules score and route, and the rep gets a card of sourced facts with the lead.

Inbound lead Enrichment Extractor Rules scorer Rep hand-off Nurture queue Decision log provider waterfall facts, stated intent evidence card attached on the CRM record
A lead is enriched, read by a model and scored by rules, then routed to a rep or to nurture, with the decision logged.
On this page
  1. The model extracts, the rules score
  2. What the waterfall has to write down
  3. The record
  4. Dana Okafor and a Gmail address
  5. Buy the conversation, keep the record

Speed to reply is what AI SDR products like to sell. Someone submits a form, and a minute or two later a friendly, personalized email is on its way back.

I think that reply is the least interesting thing an inbound agent produces. The email is gone the moment it’s sent. Meanwhile the rep who picks up the lead still sees a name, a Gmail address and “Demo request”, so she opens a browser tab, searches the name, guesses at the employer and checks a headcount. Ten minutes later she knows what the system could have told her before the notification went out.

What stays after the reply is the record of what the agent learned and why it routed the lead where it did. That record is what I’d design first.

The model extracts, the rules score

The diagram above is the whole pipeline. A lead comes in. An enrichment waterfall tries data providers in order until one returns a match. A model reads the free text and the enrichment payloads and pulls out facts. A rules scorer adds up points. The lead goes to a rep or to a nurture queue, and either way a decision log lands on the CRM record.

The split I care about is between the extractor and the scorer. The model is good at reading “we’re replacing our current tool this quarter” and turning it into two fields. It’s a poor place to keep your qualification policy. If the model also decides the score, then the answer to “why did this lead get a 72?” is a paragraph of generated prose that may read differently next week. A sales manager can’t argue with that, and can’t change it either.

So the model gets one job: fill in facts, each with the text it came from. Scoring is arithmetic over those facts. Routing is a threshold.

What the waterfall has to write down

Waterfall enrichment is well understood by now. Clay made the pattern mainstream, and CRMs have their own native enrichment, HubSpot’s Breeze Intelligence being one. Whichever you use, the detail that gets lost is provenance. A field that says employees: 300 is far less useful than one that also says which provider returned it and when.

Every fact in my record carries source and fetched_at. That lets the rep judge it (“this headcount is from the second provider, fetched today”) and lets a later job decide the fact is stale without re-enriching everything.

Personal email addresses are where this earns its keep. A provider that keys on email domain has nothing to work with. The waterfall should then fall through to a name-plus-company lookup using whatever the form’s company field says, and record that the match came from there.

The record

This is the JSON Schema for the stored record. The model only fills the facts items it reads out of text; the scorer and router write the rest. I keep it inside the subset that OpenAI’s Structured Outputs accepts in strict mode (every property required, no extra properties), so the same fact shape can be handed to the model as a response format or as a strict function definition. Claude tool use takes the same shape as a tool’s input schema, without the strict guarantee, so validate what comes back.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "QualificationRecord",
  "type": "object",
  "additionalProperties": false,
  "required": ["lead_id", "facts", "score", "route", "reason", "decided_at"],
  "properties": {
    "lead_id": { "type": "string" },
    "facts": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "value", "source", "evidence", "fetched_at"],
        "properties": {
          "name": { "type": "string" },
          "value": { "type": ["string", "number", "boolean"] },
          "source": {
            "type": "string",
            "description": "Provider id, or form:<field> for text the lead typed"
          },
          "evidence": {
            "type": ["string", "null"],
            "description": "Verbatim snippet the value was read from"
          },
          "fetched_at": {
            "type": "string",
            "description": "ISO 8601 UTC timestamp"
          }
        }
      }
    },
    "score": {
      "type": "object",
      "additionalProperties": false,
      "required": ["total", "rules_version", "breakdown"],
      "properties": {
        "total": { "type": "integer" },
        "rules_version": { "type": "string" },
        "breakdown": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["rule", "points"],
            "properties": {
              "rule": { "type": "string" },
              "points": { "type": "integer" }
            }
          }
        }
      }
    },
    "route": { "type": "string", "enum": ["rep_handoff", "nurture"] },
    "reason": { "type": "string" },
    "decided_at": { "type": "string" }
  }
}

And the rules, in a file a sales manager can read and a pull request can change:

version: "2025-02-01"
route:
  rep_handoff_at: 60
rules:
  - id: size_in_range
    when: "employees >= 200 and employees <= 2000"
    points: 25
  - id: stated_replacement
    when: "intent == 'replacing_current_tool'"
    points: 20
  - id: timeline_this_quarter
    when: "timeline == 'this_quarter'"
    points: 10
  - id: demo_form
    when: "form == 'demo_request'"
    points: 15
  - id: target_industry
    when: "industry in ['logistics', 'manufacturing', 'wholesale']"
    points: 10
  - id: personal_email
    when: "email_type == 'personal'"
    points: -8

The when strings are for a small expression evaluator you own, with a fixed list of allowed names. Don’t eval them. A rule that references a missing fact scores zero and still gets its line in the breakdown, so the gap is visible.

Dana Okafor and a Gmail address

To see it run, take a lead I made up for this post; neither the person nor the company exists. Dana Okafor fills in a demo form with a personal email, types “Ironbark Freight” in the company field, and writes in the free-text box: “replacing our current tool this quarter.”

The first provider finds nothing for a Gmail address. The second matches on name and company and returns a logistics business with 300 employees. The extractor reads the free text and emits two facts, intent and timeline, both with the quoted sentence as evidence and form:comments as source.

The scorer runs the table: 25 for size, 20 for the stated replacement, 10 for the timeline, 15 for the demo form, 10 for industry, minus 8 for the personal email. That’s 72, over the line of 60, so the route is rep_handoff. The reason string is assembled from the breakdown by code. The model never writes it.

The rep’s card shows four facts, each with where it came from:

  • Ironbark Freight, about 300 employees (provider two, fetched today)
  • Industry: logistics (provider two)
  • Replacing their current tool (Dana’s own words, quoted)
  • Timeline: this quarter (same sentence)

Below that sits the score with its six lines. She doesn’t open a browser tab.

Buy the conversation, keep the record

Salesforce announced a Sales Development skill with Agentforce 2.0 in December, and it’s the CRM-native take on this job. If it fits your process, the engagement side (replying, answering questions, booking the meeting) is a reasonable thing to buy. I’d still want the qualification record to be mine: a JSON field or a child object on the lead, written by a step I control, in a shape that outlives whichever agent product is doing the talking this year.

Two habits cost almost nothing on day one. Log nurture decisions with the same care as hand-offs, because the leads you didn’t route are the ones someone will ask about in a pipeline review. And stamp rules_version on every record, so when the threshold moves from 60 to 65 you can replay last month’s leads and see who would have dropped out before you ship the change.