The Intent Agent went from one big guess to four separate signals. Here's what was added, how it helped the product, and real proof from a live run.
One ~600-line prompt guessed the intent and the location together. If the answer looked wrong, the trace couldn't show what broke — the intent, or the location.
# one call, one result classifyIntent → { intent, location } // all together # nearest / fit / best lenses — none # "best" theme — none # vague query → 3 separate dead-ends
Two separate calls: intent first, then location. Each is tuned and traced on its own.
Three signals: closest, best fit, or top-rated. Ranking now knows what the user really wants.
Tells "best burger" from "date-night spot". Knows Michelin / James Beard mean top-rated.
Instead of three dead-ends — one smart clarifying question.
Before — one classification row. Now — five rows, and you can see every one.
nearest / fit / best signals and the "best" theme appear.{
"specified_location": null,
"location_source": "device",
"proximity_anchored": true // ← "closest" makes the search area smaller around the user
}
Location has its own request and answer. You can see exactly what the model understood about the location and what it returned.
Every location field is on view — proximity_anchored and the rest. We change the behavior in the right place, by one clear field.
Model returned "the stadium" as a place? The check caught it and did not search on a made-up place — and left a mark in the trace.
{
intent: "restaurant_recommendation",
nearest: false, // A2 — proximity
fit: true, // A2 — taste fit
best: true, // A2 — top-rated
best_theme_family: "food", // A3 — which kind of "best"
best_theme_key: "burger", // A3
best_theme_key_canonical: "burger",
}
Also, at the end, A4 adds a ready follow-up question when the query is too vague to search.
| Query | nearest | fit | best | best_theme |
|---|---|---|---|---|
| "closest burger place" | true | true | false | — |
| "closest place with vegan options" | true | true | false | — |
| "great pizza near me now" | true | true | false | — |
| "best burger in Boston" | false | true | true | food / burger |
"Closest burger place" really returns the closest one, not just "burger places". The system understands what the user wants — near / by taste / top-rated — and ranks for it.
A vague query no longer loops on "name a city/state". Instead — one simple follow-up question.
Every decision shows in the trace. Bugs are fixed in the right place, and problems are easier and faster to catch.