Account scoring
Keep every account scored and tiered against your written ICP by a deployed agent that re-scores as accounts arrive and as the ICP changes, writing the rationale back to the CRM.
cargo-ai cdk add cookbook/account-scoringMore information
Score how well each account fits your ICP — judged by an agent against the ICP written in your context repo, not by point weights in code. Edit the ICP markdown, and accounts re-score against it as they come due.
What it does #
- Keeps the scoring criteria where the ICP already lives: the context repo
(the repo’s root
context/, which the project’s owndefineContextsyncs) — versioned in git, reviewable, and shared with every other agent. - An agent scores every account when it arrives, and re-scores stale ones (last scored 3+ months ago) on a weekly sweep: it looks the account up in Cargo’s business database first, then judges it against the ICP.
- Writes the score, the tier, AND the rationale back to the CRM — a rep can always see why an account is tier A.
- Slices accounts into tier segments (A / C …) that other plays can target.
- An evaluator QAs every score: ungrounded or malformed answers fail the rubric.
How it works #
- An account arrives (or a stale account comes due on the weekly sweep).
- The scorer agent judges it. It matches the account in Cargo’s business
database, pulls firmographics, reads the ICP from the context repo, and
answers with JSON:
{score, tier, rationale}. ICP disqualifiers cap the score at 20. - Write back. The play writes
cargo_score,cargo_tier,cargo_rationale, andcargo_last_updated_atonto the CRM record. - Sort into tiers. The next model refresh pulls the score back in, and the
tier-a-accounts/tier-c-accountssegments group accounts by it.
Adds 4 resources on top of the base: 1 agent, 1 play (with an embedded
workflow), and 2 segments. Carries an example ICP under context/; the agent scores against whatever the workspace context
holds.
| File | Resource | Role |
|---|---|---|
infra/agents/scorer.ts | defineAgent | judges accounts against the ICP, with evaluator |
infra/plays/score-accounts.ts | definePlay + defineWorkflow | per-account scoring + CRM write-back |
infra/segments/tiers.ts | defineSegment | tier A / C slices over cargo_tier |
Placeholders (edit before deploy) #
- The ICP itself — the repo’s root
context/: the criteria ARE the prompt; disqualifiers matter as much as fit signals. - Language model —
infra/agents/scorer.ts. - Score columns —
cargo_score,cargo_tier,cargo_rationale, andcargo_last_updated_atmust exist as CRM properties, withcargo_scoreandcargo_tierselected on the accounts model so the segments can filter on them. - Tier thresholds —
infra/segments/tiers.ts.
Done when #
Add a test account: the run shows the agent’s lookups, the CRM record gets a score with a rationale that cites real evidence and ICP criteria, the evaluator passes ≥ 0.8, and after the next model refresh the account lands in the right tier segment.
Variant: deterministic point-based scoring #
If you want zero-LLM scoring (fixed cost, exact reproducibility), swap the
agent call for the native scoring node — criteria as {name, value, score}
booleans in the workflow. The trade: criteria move from the ICP markdown into
code, and you lose the rationale.
Extending: skip the CRM roundtrip #
Writing the score straight onto the model (instead of going through the CRM)
uses the platform’s modelUpsert native — native.modelUpsert({ ... }) in the
workflow. It’s in the generated native surface (.cargo-ai/cargo-types.d.ts,
written by cargo-cdk types on postinstall), like the routing engine’s
allocate; its input is untyped, so confirm the field shape on first run.