AI / ML
Implementing AI agents in analytics
I deploy LLM-based AI agents that answer data questions in natural language and automate routine analytics — self-service for the whole team.
What is AI agents in analytics
LLM-based AI agents solve two related tasks in analytics: they answer data questions in natural language (NL-to-SQL) and they monitor the quality of the data itself across the pipeline. Both the user assistant and the pipeline AI rest on one shared semantic layer and metadata catalog, so they work in sync. The goal is fast, reliable self-service: an employee gets an answer with numbers and a chart without queuing for an analyst, while the data behind that answer stays documented, validated and up to date.
What's included
Semantic layer and metadata
I describe tables and columns, build a business glossary (what counts as revenue, an active customer), metrics and relationships. This is the basis of the assistant's accuracy and order in the data.
NL-to-SQL AI assistant
I set up a RAG index over the schema and example 'question → SQL' pairs, and connect the LLM and the database. The user asks in words and gets a table, a chart and an explanation.
Guardrails and security
I give the assistant read-only access only, configure RBAC and row-level security — it sees only what's permitted. I add query validation and limits and isolate execution in a sandbox.
AI-driven data quality control
I set up observability for data and pipelines and replace manual thresholds with ML anomaly detection. I lock down schema agreements with versioned data contracts.
Auto-cataloging and lineage
I connect auto-discovery and description of data artifacts and end-to-end lineage. The catalog fills itself automatically and stays current as the pipeline grows.
Accuracy evaluation and support
I prepare a benchmark on a set of real questions, show the generated SQL for review and build in a human-in-the-loop. I launch a pilot, expand coverage and monitor answer quality.
What the implementation stages are
- 01
Audit and semantic layer
I bring order to the metadata: table and column descriptions, a business glossary, metrics and relationships, a catalog. This is the foundation that both the assistant's accuracy and the reliability of the data depend on.
- 02
Observability and data quality
I set up monitoring of data and pipelines — freshness, volume, schema, distribution — and ML anomaly detection instead of manual thresholds. I lock down the schema with versioned data contracts.
- 03
Setting up the AI assistant
I build a RAG index over the schema and example 'question → SQL' pairs, and connect the LLM and the database. The assistant returns a table, a chart and an explanation with the answer.
- 04
Guardrails and security
I restrict access to read-only, configure RBAC and row-level security, and add query validation and limits. I isolate execution in a sandbox so the assistant can't expose too much or overload the database.
- 05
Accuracy evaluation and human-in-the-loop
I run a benchmark on a set of real questions and assess answer quality. I show the generated SQL to the user for review, especially for decisions made on numbers.
- 06
Pilot, rollout and monitoring
I launch a pilot on a single data mart, gather feedback and expand coverage. Auto-cataloging and lineage fill the shared layer, while quality monitoring keeps the assistant and the data under control.
Example implementation
On a data foundation (DWH/Lakehouse) sits a shared semantic layer and metadata catalog: the pipeline AI fills this layer with quality, anomalies, auto-catalog and lineage, while the AI assistant reads from it for NL-to-SQL. The two flows pass through one layer and reinforce each other; the stack is predominantly open-source and deploys in the client's infrastructure.
Data — the foundation
The shared warehouse or lakehouse everything else sits on: S3/MinIO object storage with Apache Iceberg, the ClickHouse or Greenplum analytical databases. It's the single source of data for both AI scenarios.
Shared layer
The semantic layer and metadata catalog: OpenMetadata or DataHub, dbt Semantic Layer or Cube, plus a vector store for RAG. This layer determines NL-to-SQL accuracy and is at the same time the result of bringing order to the data.
AI assistant (NL-to-SQL)
Reads from the shared layer: a natural-language question → RAG over the schema and documentation + LLM → SQL → guardrails (read-only, RBAC/row-level, limits) → a table, a chart and an explanation for the user.
AI for the data pipeline
Fills the shared layer: observability of data and pipelines, ML anomaly detection, Data Quality, auto-cataloging and end-to-end lineage. It shifts the pipeline from reactive fixes to early problem detection.
How it ties together
One flow fills the shared layer (auto-catalog, lineage, quality), the other reads from it (NL-to-SQL). They don't compete — they reinforce each other: the better the data is described and cleaned, the more accurate and safe the assistant becomes.
Tech stack
Apache Iceberg
dbt Clients
Testimonials
The core value of this service is fast, reliable self-service on data that’s been put in order. Employees ask their data in words and get an answer with numbers and a chart in seconds, without queuing for an analyst, and underneath those answers lies a shared semantic layer and metadata catalog. The pipeline AI fills this layer with quality, anomalies and lineage, the assistant reads from it — and the better the data is described and cleaned, the more accurate and safe the answers become.
Shall we discuss your task?
FAQ
Can you really 'ask your data in words', and what does the assistant return? +
Yes, that's exactly NL-to-SQL: you ask a question in natural language, the assistant generates SQL, runs it and returns a table, a chart and an explanation with the answer. You don't need to know SQL or wait for an analyst — it's self-service for the whole team. The path from question to insight takes seconds, and the data team is freed from ad-hoc requests.
How much can you trust the answers, and where does accuracy come from here? +
NL-to-SQL accuracy is almost entirely determined by the quality of the semantic layer: a 'raw' LLM generates text well, but without schema descriptions, a glossary and metrics it struggles with complex business logic. That's why I invest in semantics and metadata and keep a human-in-the-loop. The assistant shows the generated SQL so it can be verified — especially for decisions made on numbers.
Is it safe — won't the assistant expose too much or break the database? +
The assistant has read-only access only, so it can't change or delete data. Through RBAC and row-level security it sees only what's permitted to the specific user. Queries go through validation and limits, and execution runs in a sandbox — this protects the database from heavy or dangerous queries.
Why AI inside the data pipeline itself? +
Here AI is applied not to a business question but to data engineering: it automates quality checks, anomaly detection, cataloging and lineage. ML catches problems that manual threshold rules miss, so there's less dirty data and fewer broken dashboards, and fewer pipeline incidents. Beyond that, clean, AI-ready data is the foundation on which the assistant works accurately and safely.
Do you need a cloud product, or can it be open-source and on-premise? +
It can be fully open-source: Vanna AI or Wren AI and LangChain for the assistant, Soda Core or Great Expectations and OpenMetadata for quality and catalog. The LLM is your choice: cloud (OpenAI, Anthropic) or local via Ollama if the data can't leave your perimeter. Everything deploys in the client's infrastructure; managed options like Databricks Genie or Snowflake Cortex remain optional.
Where do you start? +
It's best to start with the semantic layer and order in the metadata — descriptions, a glossary, metrics and a catalog: this is the foundation of the whole implementation, and almost the entire result depends on it. Once the foundation is ready, I launch a pilot on a single data mart, gather feedback and gradually expand coverage. In parallel I connect quality control and auto-catalog so the shared layer keeps filling and stays current.












