0 viewsAsked at 2 companies
You said you built an AI agent to automate impact analysis of SQL changes. Could you tell me more about it?
AI answer
The goal of such an agent is to determine, from a changed SQL statement, which objects and reports might be affected and to explain the chain of impact. For example, if a column in a table changes, the agent should find the queries, views, or data models that depend on it.
A practical architecture combines deterministic analysis and an LLM:
- It receives the SQL diff and repository context: dialect, object catalog, schemas, configuration, and, if available, a lineage graph.
- A parser builds an AST and extracts changed tables, columns, expressions, and dependencies. It is better to use a SQL parser for this than to ask an LLM to guess the structure from text.
- A dependency graph helps trace from changed objects to downstream views, models, and consumers. The agent ranks the findings by likelihood and severity of impact.
- The LLM produces an understandable summary: what changed, which consumers are affected, why, and what checks should be performed. Where possible, the output includes links to specific SQL lines and graph nodes.
- The result is checked with tests or static rules and passed to a human for review; the agent should not automatically treat its output as complete or safe to apply.
Key limitations include dynamic SQL, SELECT *, stored procedures, UDFs, an incomplete catalog, and dialect differences. These should be explicitly identified as areas of uncertainty. Quality can be measured on labeled changes by the completeness of the dependencies found, the precision of warnings, and the proportion of important consumers missed.
Also asked at СБЕР
Similar questions
- Tell me how that agent for SQL impact analysis was built: what was the architecture, and how did you evaluate its quality?
- How did you evaluate the SQL impact analysis agent to make sure it provided valid information and assigned the correct risk label?
- Why was the Qwen 32B model chosen for the SQL impact analysis agent, and how was it deployed?
- Could you tell me more about the SQL assistant for analysts and the BI team: what kind of tool was it, and how was it architected?
- Did the agent know the entire database and all SQL scripts in advance, or did it analyze only the diff?