How we are developing an agentic service for working with analytical data

Artyom (AMyrkin)16 Oct 2026

Problem

YooMoney analysts face a growing queue of data questions, and dashboards do not always give the needed detail. A text-to-SQL service here has to handle three failure modes: a model that drifts across a dialogue, valid SQL that answers a different question, and failures that vanish silently inside the pipeline. The author does not give usage or accuracy numbers.

Example from the article: a user asks how many wallets were opened in May 2025, then follows up with "And in December? And group by week", and the system must rebuild a full query from that fragment.

Solution in brief

The service is a LangGraph pipeline with fixed nodes and loops. It rewrites the question as standalone, detects the topic, normalizes dates in code, picks tables, trims the context, generates SQL, validates it in layers and formats the answer. Deterministic code surrounds the model at every risky step. Quality is measured by a result-based test suite with an experiment endpoint.

Questions this case answers
  • How to turn a natural-language question into a verified query result when a free-running agent is too unpredictable and a syntactically valid query can still answer the wrong question
  • How to evaluate a data-question answering pipeline when many different queries are correct and ground truth needs partial human labeling
  • How to let business users get answers from a warehouse in plain language without queuing for an analyst?
  • How to catch SQL that runs without errors but answers the wrong question?

Tools and methods

  • LangGraph — pipeline as a graph with shared state, cycles and clarification pauses
  • Langfuse — traces of model calls, plus a "decision trace" of silent failure points
  • Rules plus LLM classifier — topic detection, with a clarifying question when they disagree
  • Layered SQL validation — text checks, plan check, semantic check, result check
  • LLM judge with manual queue — arbitration of disputed test cases
Continue reading — it's free

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