← All transcripts

How We Took an AI Agent From 41% to 97% Accurate - Milind Sunil Shah, Brainbase Labs Transcript, AI Summary & Key Points

AI Engineer · 7 days ago · Science & Technology · 13:23 · EN

Watch on YouTube

AI Summary

A six-step framework improves back-office AI agents through instructions, skills and playbooks rather than a new model. The worked example is a Brainbase agent for Domino's CMO office that tracks competitors' pizza prices across websites and delivery apps. From version 1 to version 11, accuracy rose from 41% to 97%, cost per source fell from $2 to $1, and run time dropped from 129 to 71 minutes. The steps are kickoff (agree on the win), ontology (define every term so the agent never guesses), benchmarks and evals, shipping a narrow first agent, iterating score-fix-ship, and handing off the whole loop — not just the agent — to the customer. Domino's analysts now review only exceptions, corrections feed back in as benchmark cases, and the agent runs on their schedule or by email trigger.

Key Points

  • The Domino's project answers one question for the CMO office: what does a pizza cost at the competitor down the street, in their delivery app, on their website with and without promos — output as a spreadsheet of lowest prices per item.
  • Results across 11 versions: accuracy went from 41% to 97%, cost per source fell from $2 to $1, run time dropped from 129 to 71 minutes — all from changing instructions, skills and playbooks, not the model.
  • Step 1, kickoff: talk to the end user and agree on what the win looks like — what the human signs off on, how long it takes, how much it costs, who judges the output, and what the agent must never do alone. The manual job cost an analyst 2 hours daily.
  • Step 2, ontology: write down every term the agent needs so it never assumes. Every term needs a definition; anything unwritten will be guessed wrong. Rules came from real failures — e.g. record the price the user pays at checkout, not the struck-out list price; delivery is not takeaway; do promotion math before entering; if unverifiable, write it down as a gap and do not guess.
  • The agent stores findings in a price observations table keyed by item ID, then fills a spreadsheet by looking up the ID and replacing the price; a wrong cell points to the exact page and the rule behind the chosen price.
  • Step 3, benchmarks and evals: offline evals reuse past analyst spreadsheets as test cases; archive.org snapshots of competitor sites formed the benchmark environment, and since delivery apps served data differently, browser screenshots stored from version one onward became the environment.
  • Scoring is layered: deterministic code checks (every ID cell replaced, discount map computed correctly, price within 20% plus or minus of the previous run, flagged or not), an LLM judge checking the trace for right item and promo, and an agent-as-judge that takes multiple turns to confirm each flagged price; analysts review final flags.
  • Step 4, ship a narrow first agent: version one's job is to be measured, not to be good. Scope started at one app, one item, one city, then widened to burgers and takeaway, another app, then other websites.

AI in practice

Used for

What
Agent reads items, finds competitor websites and delivery apps, interprets prices and promos, fills a spreadsheet, flags uncertainty, and hands off for analyst sign-off
What
Navigates competitor websites and apps to find prices; improved via rules like scanning the whole page and checking HTML DOM before images

Business ideas

Deploy a browser-using agent that answers a recurring business question (e.g. 'what does a pizza cost at the competitor down the street, on their website with and without promos, and in their delivery app?'), fills a spreadsheet with the lowest verified price per item, and flags anything it cannot verify. Accuracy is raised not with a new model but by iterating on instructions, rules and playbooks — version one at 41% accuracy, version eleven at 97%, cost per source halved from $2 to $1, run time cut from 129 to 71 minutes.

For
Enterprises with analysts doing slow, error-prone manual web research; started with a single region via the CMO's office before expanding.
Solves
An analyst spends hours daily opening competitor websites, picking the right store, comparing delivery vs takeaway, applying promo math and writing a spreadsheet — one wrong step yields a cell that looks finished but is wrong. The agent replicates the workflow, stores the evidence, and hands off with flags instead of guesses.
  • Domino's competitor pizza-price tracking: agent went from 41% accuracy at version 1 to 97% at version 11, cost per source from $2 to $1, run time from 129 to 71 minutes, using only instruction, skill and playbook changes; now runs daily and is expanding to more markets.
🔒  Build steps and tools for 1 idea. Unlock

Tools & resources

2 items

Links mentioned

🔒 Full analysis locked

Unlock more videos and the full analysis

A credit unlocks one video's full analysis for good — the build steps, the tools and how each was used, the methods behind every use case. Pro opens the whole library instead, and raises how many videos you can analyse a day.

Unlock full analysis — free

Transcript

Searchable transcript of How We Took an AI Agent From 41% to 97% Accurate - Milind Sunil Shah, Brainbase Labs — AI Engineer (13:23). Search for a phrase, then click its timestamp to jump straight to that moment in the video.

Captions sourced from the original video on YouTube, published by AI Engineer. The video, its captions and all related intellectual property remain the property of their respective owners; AINotes claims no ownership. Provided for research, accessibility and search — see the Transcript Notice and Copyright Policy.

00:01 [music] >> Hey, so I'm Milind, MTS at Brainbase. We help enterprises deploy internal agents at scale and manage them. Today I'm going to be talking about hill climbing back office agents and how we did that successfully with a customer. So yeah, our customer in this case I'm going going to be talking about throughout and like the famous local video we use repeatedly is is is Domino's.

00:31 As you all know, they have 20 plus thousand stores, 90 plus markets. We started off with a single region with their CMO office. We wanted to answer this question that they kept asking. What does a pizza cost at the competitor down the street? What what does it cost in their delivery app? What does it cost on their actual website with promos, without promos, things like that.

00:51 They essentially wanted a spreadsheet at the end with the lowest price possible for a bunch of different items. Before we built the agent for them, they had an analyst manually doing these steps. They all look easy in isolation. You open a competitor's website, pick the right store, compare prices with delivery, takeaway, find the right promos, find the cheapest price and write it all down into a spreadsheet.

01:15 It it all looks easy enough, but if you get one of these steps wrong, you look like you you you get a cell at the end that looks finished, but it's just wrong. We had to build an agent that does the same. Reads a bunch of items, finds the website, interprets prices, fills the spreadsheets, hands it off to an agent, and flags anything that it thinks it's not sure of.

01:35 When we created version one of this agent for them, we had 41% accuracy. By the end at version 11, we had 97% accuracy. Our cost per source per source means per item per per competitor per website went from $2 per source to $1 per source. And the amount of minutes it took per run went from 129 to 71. All of this went just with just just instructions and and skills and playbooks changing.

02:03 Here is like the six steps that we use, not just with Domino's, but with other customers as well. We start off with kickoff, followed by anthology, benchmarks, first agent, iterating, and handing off. I'll talk about what these steps mean in detail and what we did for Domino's in each of these and hopefully it's a repeatable framework that y'all can use internally as well.

02:23 So, step one is kickoff. You should ideally talk to your customer or end user and agree on what the win looks like. As of today, what what is the job? What did the human sign off on at the end of it? How long does it take? How much does it cost? How accurate does your agent need to be? Who judges the output? And what must the agent never do alone? What assumptions should it never make?

02:45 For Domino's, we ended up creating this brief that worked really well for us. Our outcome at the end had to be a faster, repeatable way to collect local competitor pricing without losing the judgment edge cases need. So, we asked them uh all of these questions. As of today, the analysts create a spreadsheet and the pricing team uh find finally analyzes it.

03:04 An analyst spent 2 hours daily manually actively working on creating the spreadsheet. Every cell was then checked and and just confirmed and the agent at the end just had to ask for the analyst for sign off and flag anything else it had to. Our win in numbers looked like just having the highest accuracy, the lowest cost of sources possible, run time to be as low as possible, and before we even started, they weren't even sure if we can do this discount search at all.

03:33 >> [snorts] >> Step two is anthology. What does that exactly mean? We we try to write down all the terms that that the agent needs to know to never make assumptions, which means we need to tell the agent exactly what it's supposed to collect, where each answer comes from, where does it go, what does each term mean to the analysts that actually do the do the work manually, and what should the agent do when it can't figure something out.

03:57 If if there's one jewel here, it is that every term should ideally have a definition. If you don't write something down, the agent's going to guess and probably get something wrong. For Domino's, here's what it looked like. We at Brainbase have a memory primitive of our own that has memory that looks like a Postgres database that the agent can do whatever it wants with.

04:16 We gave it a target stable where we gave it up all the items. In this case, let's look at ID number 14. ID 14 is brand B. It's a large pizza. Uh takeaway method is Sorry, it's delivery and on app B. The agent hypothetically does browser use, finds the price on the website, finds that it's 24 and 19. 24 is the striked out price, 19 is the sale price.

04:40 We also now have a rules file where we actually tell the agent to specifically mark down the price that it that a user pays at checkout, not 24. This came from like a valid failure. What it saves at the end, we created a table again called price observations where it with the corresponding ID stores what price it saw, what the full price was, and the actual source.

04:59 And at the end, we give it a spreadsheet that has all placeholder item IDs, and all it has to do is look up the ID and replace the price. When a cell is wrong, it points to the exact page and the rule behind why it chose the selected price. Other rules that we mentioned that came through actual life traces were definition of what a large pizza looks like.

05:23 It's anything that's actually the item itself or a bundle. Delivery is not equal to takeaway. It It got confused with that. It's supposed to do promotion math. If it's 30% off the price, it should do that before entering it in the spreadsheet. And if it can't verify it, write it down as a gap and do not guess. Step three is finding out benchmarks and emails.

05:45 Now Now, these steps can be interchangeable slightly, but essentially you're trying to figure out what you can run offline emails on and what you can run online emails on. For offline emails, you should ideally start off by asking them if they have past cases that they already have answers for. In this case, we had analysts from Domino's who had spreadsheets that they had worked on.

06:03 Can we actually rerun those um input cases to get the same final output? And then at the end, how do you figure out how to score each thing that the agent is doing? For evals, you try to figure out what you can check deterministically, what you can check why an LM as a judge, and what you can check as an agent as a judge. That's a concept that we think is slightly more unique, where if there's an output artifact, you probably want an agent to take multiple turns, multiple tool calls to figure out how correct that that

06:31 artifact is. And at the end, what happens when something goes wrong, and what happens when it's flagged? You should try to score as many things as you can with these three things. So, yeah, at Domino's, our benchmark essentially started off with all the spreadsheets that they had. We tried to create the input environment by going to archive.org and having snapshots of competitor websites at those given dates.

06:53 What we saw that it was that it didn't work with delivery apps because they didn't serve data the same way. So, we ended up storing browser screenshots for everything the agent was doing starting from version one of the agent, and that's how we create up our environment for for the internal benchmark. For evals, we use code for things like checking if every ID cell was replaced with the price, if the discount map was computed correctly, if the price was 20% plus or minus compared to the previous run, was it flagged or

07:21 not. LM as a judge just checks the trace to see if the right item was selected, and if the right promo was applied. Agent as a judge actually goes to every flagged price and actually confirms if the flag was valid or not. And the analyst at the end will go look at the final flags and try to figure out what the reason for it was if something went wrong.

07:42 Step four is actually shipping some version of a first agent. You should ideally ship a narrow first agent in your stack that you can score from from day one. You should probably figure out what the smallest slice worth scoring is. You should figure out how accurate things should be, how long and and you should use this agent to figure out how long does it run take, what what does it cost, what does it get wrong, and things like that.

08:05 Version one's job is to be measured, it's not to be good. You should widen the scope uh widen the scope after you get some baseline score they're trying to meet. For Domino's, as like I mentioned earlier, version one for us was just 41% correct. It took more than 2 hours. It was $2 per source. And and it just wasn't working well. We found a bunch of changes, made fixes, and then improved and increased the scope.

08:29 So, we started off with just one app, one item in one city. Moved on to adding burgers and takeaway options. Moved on to adding another app, and finally other websites as well. So, starting off small narrow scope worked out really well for us to figure out how we can fix things. Step five is to just iterate. You should score, fix, and ship. Here is where you'll do steps two, three, and four.

08:55 Keep iterating, improving your anthology, improving your emails, your benchmarks to get things that work. You should figure out which failures are most expensive, most frequent, fix them, what changes should be used to fix them. If that change results in increased run time or cost, if yes, are you okay with that increased run time and cost? And how can you use those failures to create and add to your benchmark cases or eval criteria?

09:17 Ideally, change one thing at a time and fix the instructions before you want to change the model entirely. At Domino's, we highlighted two examples. Before I get to that, here is a graph of how our progression went. We one started off at 41%. Um more than $2 a source. We 11 after a bunch of changes, it's $1 a source, and and 97% accurate. So, yeah. Here's an example of a very simple rule change that we made.

09:48 We gave the agent a link of of a large pizza to find for brand B. Via delivery on its own website. It went to the link which had the section already highlighted. It clicked on it, found the large pizza, found the price, and ended there. The analyst got that somebody manually caught at the end that there was actually a deal below that website below on the same page, that was just $21 instead, and and it missed that, right?

10:15 So, all we had to do there was add a simple rule to not stop at the section that it gets linked to, but actually look at the entire page. And a simple change like that helped us just like catch this and then make sure it doesn't happen again. Another more intricate change that we had to make was actually browser use behavior of set agent. So, in one of the runs, we saw that for brand D this is a this is a brand called brand D promotions page, where all the promotion prices were inside images, so not actually captured

10:44 in text. What the agent did is it looked at all 26 promo images to find the item it was looking for. It looked them looked at them again by zooming in 4x, 5x, 6x. It found the right card at minute 13, but it still kept zooming to double-check and verify, and it it was just in a loop, and we had to manually stop it at minute 15. We realized after manually looking at the trace and the website, that the HTML DOM is actually super important and could have saved the agent a lot of work here.

11:13 So, we we tell the agent in in our latest rules to go look at the HTML DOM first, look at things like image titles, all text before looking at the actual image rates, and just stopping past a certain zoom level. What that resulted in is is 1/3 the number of image rates, reducing cost by over 50%, and just us getting an actual answer and a finished report.

11:34 So, while we have automated checks and eval criteria to help us catch a lot of things, some things require our engineers to actually look at traces and and browser on use tool calls and and just see what went wrong. So, yeah, we made a bunch of these changes, got to V11, got to 97% accuracy, and now it's just figuring out, hey, like like what next? So, so our our way of this is trying to figure out how best to hand off to the customer at the end.

12:01 We want to figure out who's running these agents, who's reviewing the outputs, who's trying to correct who's trying to take the corrections into and converting into rules and benchmark cases, and who decides when new version is ready to ship. All these questions are things you should probably have written down. Um you're trying to hand off an entire loop and not just the agent.

12:17 Ideally the the user should be empowered enough to make these changes if they're small enough themselves. So for for for Domino's, that's exactly what we did. The agent now runs on their schedule either multi um daily or even by email trigger manually. Analysts review only the exceptions at this point. Each correction that they catch, they're automatically able to add as a benchmark case.

12:39 If they can't, then they obviously they're always available for them. And we are now at a place where we are expanding with them. Um trying to get it into multiple markets and multiple other um areas. So yeah, this is basically how we we used um our framework to work with Domino's to go from an agent that barely works to an agent that works almost perfectly while reducing the cost.

13:05 We found this framework to be very effective for various other use cases, especially where you have messy sources of data where you're trying to figure out the right answer. And um thanks.