Mazza Builds
← All projects

9 to 5 · AI agent at Freshpaint, in testing

Pipeline Attribution Agent

Works out where each new sales deal came from.

76%accurate so far. It goes live at 80%

  1. What it does

    Every new deal needs a label for what brought it in: an ad, a cold email, a partner, an event. The agent reads everything known about the deal and the people on it, picks the source, and writes down why.

  2. Why it's cool

    It replaces a stack of about 15 brittle rules that grabbed the first match and broke whenever something got renamed. The agent weighs all the evidence like an analyst would, and every correction from the team makes it sharper.

  3. The impact

    It's right 76% of the time on a test set of 139 deals and goes live once it clears 80%. Then leadership gets a source report they can trust.

Under the hood

Context

Every new sales deal at Freshpaint needs a source tag (paid ads, outbound, partnerships, and so on) so leadership can see what's actually driving revenue. The old setup was a stack of about 15 HubSpot rules that fired on the first match. They couldn't weigh competing signals, couldn't explain their decisions, and quietly broke whenever a field name changed. The result was attribution data the team didn't trust.

Build

When a new deal is created in HubSpot, the system pulls together everything known about it (the contact, the company, marketing touches, sales activity, full timeline) and hands that complete picture to Claude. The model reasons over the evidence the way an analyst would and returns a single source category along with its rationale. Whenever the sales ops team overrides a call, that correction feeds back into the agent, so it keeps getting sharper over time.

Result

Currently classifying deals at 76% accuracy on a 139-deal test set, with three of four categories already past the 80% target. The next round of tuning sharpens how the agent reads engagement history to close the last gap. Once it clears the bar, it goes live in production to replace the old rules.

Stack

Python, Claude API, FastAPI, HubSpot

Links

Source

Next projectEvent Hub