Back to DATATEAM projects

LLM Analytics Agent

A natural-language analytics agent connected to governed operational data, allowing users to ask business questions while keeping answers grounded in approved warehouse models.

Problems we had to solve

  • Executives and analysts needed faster access to operational answers without waiting for custom dashboard changes or ad-hoc analyst queries.
  • Generic chat interfaces were not reliable enough because they could invent metrics, query the wrong table, or ignore operational definitions.
  • The agent needed to explain results using live governed data while respecting access boundaries and table semantics.

What we implemented

  • Built an agent workflow that routes questions through metadata retrieval, metric selection, SQL generation, query execution, and answer synthesis.
  • Grounded answers on the warehouse gold layer and documented semantic context instead of allowing arbitrary source-system exploration.
  • Added validation steps for generated SQL, result summaries, and fallback behavior when the question cannot be answered from available models.

Tools used

Stack selected for production data work, not a demo.

AWS
Terraform
Git
OpenAI API
LangGraph
Snowflake
Python
FastAPI
Svelte

Architecture

How the project is structured technically.

01

Semantic retrieval

The agent first retrieves relevant table descriptions, metrics, and business definitions before selecting how to answer a question.

02

Guarded SQL execution

Generated SQL is constrained to approved tables and checked before execution to reduce hallucinated joins, unsafe statements, and unsupported metrics.

03

Answer synthesis

The final response combines query results, metric context, and caveats so users see both the answer and the evidence behind it.

Work showcase

Sanitized project screens

AI embedded in the client's dashboard

AI embedded in the client's dashboard

Usable AI right inside the operational dashboard — users ask questions, generate charts, and export data without leaving their workflow.

Related PLN EPI work