AI assistant in M42: how we at Avito sped up chart building and grew the audience in Trisigma

Andrey Starostin28 Nov 2025

Problem

Avito's BI tool M42 offers 16,000+ metrics, 120+ breakdowns and many aggregation modes. Users, from marketers to analysts, have trouble finding the right metric among similar ones with inconsistent or missing descriptions. Setting up a chart also takes time and care, because many breakdown values, filters and parameters must be chosen.

Example from the article: a request for the weekly percent change of the number of listings in Electronics by subcategory for Q1 2025, shown as a table, must be mapped to a metric, category, period, value format and output format.

Solution in brief

The service splits a request into main metrics, a denominator metric and remaining parameters, and handles the parts in parallel. Chart parameters come from an LLM with a strict JSON schema and retrieved few-shot examples. Metrics come from several candidate generators, an LLM ranking and post-checks against the registry.

Questions this case answers
  • How to let non-technical users query a large governed catalog of metrics and breakdowns in natural language when the catalog is too large to fit in a prompt and names are inconsistent
  • How to map a free-text request onto a closed set of allowed parameter values without the model inventing values
  • How to help business users find the right metric among thousands of similarly named ones in a BI tool?
  • How to turn a free-text request into the exact parameters of a chart (metric, breakdowns, dates, format) without hallucinated values?

Tools and methods

  • Semantic layer — metrics and breakdowns stored in one standard format with names, descriptions and YAML methodology
  • Structured output (JSON schema) — fixes allowed values and removes invented fields
  • RAG few-shot — embeddings plus FAISS pick the most similar labeled examples for each request
  • Candidate metric search — embeddings, fuzzy lexical search (rapidfuzz), exact name match and a popularity list
  • DSPy MIPROv2 — automatic prompt and example search against a quality metric
  • Golden sets — 225 and 570 labeled requests for chart parameters and metric search
Continue reading — it's free

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