Function Calling 101: One Agent Instead of a Zoo of Bots

Evgeny Kononov24 May 2025

Problem

An oil refining company sold technically complex products (lubricants) through a classic chatbot with many buttons and long lists. Users often contacted support or left the site, so support stayed loaded and conversion suffered. The new assistant had to answer from a knowledge base, select a lubricant by vehicle, specification or competitor analog, and find parameters and documents. It also had to avoid recommending products on its own, and the old bot had left no logs.

Example from the article: users write "Shell Helix HX8 ECT 5W-30" as "Shell Shell Helix Kheliks HX8 ECT 5Wv-30" or "Shell Helix HX 8 ECT 5W-30".

Solution in brief

A router prototype (two classifiers plus one assistant per scenario) was replaced by one LLM with one prompt and six tools. Fuzzy string search inside the tools absorbs name distortions, and the user confirms the matched product from a short list. Components were tested offline with Recall@k and exact-match accuracy of the chosen tool and its result.

Questions this case answers
  • How to replace a set of routing classifiers and per-scenario bots with one tool-calling language model agent
  • How to evaluate a tool-calling assistant offline when no logs exist from the earlier system and user input is misspelled
  • How to replace a router-plus-specialist-bots chatbot with a single function-calling LLM agent
  • How to match misspelled, mixed Cyrillic/Latin product names to a catalog inside an LLM tool

Tools and methods

  • Function calling — one LLM chooses among six search tools
  • Fuzzy string matching (thefuzz) — maps distorted names to the catalog
  • Human-in-the-loop — the user picks the exact product from a table
  • Synthetic test data — six-step generation from dimensions of variation
  • Recall@k, exact-match accuracy — offline metrics
  • YandexGPT 5, Qwen2.5-72B, Qwen3-32B, Milvus — models and vector database compared
Continue reading — it's free

Google or a one-time email code. No password.