Ratel Docs
Guides

Find why your agent picks the wrong tool

Follow one missed search from Agent health to a trace, see it in Quality and Test a search, then fix it with a description rewrite.

Goal: find a search that misses the right tool, and fix it without changing your code.

Time: about 10 minutes.

You need:

  • A project that sends searches from the Ratel SDK. See Send data.
  • Pro or higher for Quality's Misses and Descriptions. See Plans and limits.

The screenshots come from the Meridian Travel demo: a travel agent that searches about 90 tools.

Open the issue in Agent health

Open Monitor › Agent health. Under Issues, click Two tools get mixed up. Then click the pair get_fare_rules + get_refund_status.

Agent health with the Two tools get mixed up issue open on the get_fare_rules and get_refund_status pair, with example turns

Why it matters says the two tools are shown together and picked at random. Example turns lists real turns where it happened.

Read one turn

Under Example turns, click Open in Traces on the first turn.

A turn in Traces: the search 'If I cancel, do I get my money back?' listed get_refund_status first, the agent called it, then searched again

The traveler asked "If I cancel, do I get my money back?". The search listed get_refund_status first, and the agent called it. cancel_flight, which returns the refund a fare qualifies for, was not in the list. The agent then searched again.

Confirm it in Quality

Open Improve › Improvements › Quality. On Misses, type cancel_flight in Search misses….

Quality, Misses filtered on cancel_flight: 'If I cancel, do I get my money back?' with outcome Not returned and get_refund_status ranked first, 5 times

The row "If I cancel, do I get my money back?" says Not returned, Ranked first get_refund_status, 5 Times. It is not a one-off.

Open Catalog › Test a search. Type "If I cancel, do I get my money back?" and click Search.

Test a search for 'If I cancel, do I get my money back?': get_refund_status first, and cancel_flight not in the top 5

cancel_flight is not in the top 5. Its searchable description uses none of the traveler's words.

Apply the rewrite

Back in Quality, open the Descriptions tab and click cancel_flight.

The cancel_flight rewrite: found in a replay 7 of 9, +33 pts, the description now and after the rewrite, and the searches it missed

The panel shows the description Now and the Rewrite, which adds the words of the Searches it missed. Found in a replay of past searches says how many of them the rewrite fixes. Click Apply rewrite.

The rewrite reaches your agent the next time its SDK loads the Platform's catalog overrides. The panel warns you when nothing has fetched them recently.

Check the result

Run the same search again in Test a search.

Test a search after the rewrite: cancel_flight ranks first for 'If I cancel, do I get my money back?'

Result: cancel_flight now ranks first for the ask, and the change shows on Ship. Next, measure it after shipping.

On this page