Yoomoney developed a Text2SQL service that allows users to query analytical data using natural language. The system processes requests by identifying the subject area, generating and validating SQL queries, and returning results as text, tables, Excel files, or charts.

The service utilizes LangGraph to manage a non-linear pipeline of nodes. It features a two-level memory system: a snapshot of the last query and a periodically updated summary of the entire dialogue. A context resolver rephrases follow-up questions into independent queries to maintain accuracy.

The system employs a multi-layered validation process to prevent errors. This includes checking for destructive SQL operations, validating syntax via MS SQL Server, and a four-layer subsystem that verifies query logic, data consistency, and result accuracy against business rules.

To ensure reliable visualization, the system uses predefined rules to determine chart types, preventing the summation of identifiers or mixing incompatible metrics. The service also tracks potential silent failures through a structured decision log, recording branching, suppressed exceptions, and data filtering events.

Testing involves an experimental circuit that allows for modifying subsystem behavior and comparing results. The team uses Langfuse for tracing, which provides insights into generated SQL, model confidence, error rates, and processing time for each step of the pipeline.