"Can I ask our data questions in plain language, the way I would ask a colleague?" It is now the first question executive committees ask. Technically, the answer is yes, today. The real question lies elsewhere: will the answer be right, and can we prove it?
What changes when AI becomes a data consumer
For twenty years, data has been consumed by people: a financial controller reads a dashboard, frowns at a number, calls the data team. That common-sense reflex is the last safety net in many companies.
An AI agent has no such reflex. Plugged straight into raw tables, it picks the columns, the filters and the way to aggregate on its own. It adds up rows that shouldn't be added, mixes yesterday's price with last year's, and presents the result with the same confidence as a correct answer. The more convincing the AI, the more dangerous poorly prepared data becomes.
The core idea
In the age of agents, a data platform no longer just produces dashboards. It becomes the contract that tells the AI what a correct number is.
The demonstrator: fuel prices in France
To test these ideas on something concrete, I built a complete, 100% open source data platform on a public dataset everyone can relate to: the real-time fuel price feed published on data.gouv.fr, the French open data portal (Open Licence).
| Indicator | Value |
|---|---|
| Petrol stations tracked | ≈ 9,800 |
| Fuel types | 6 (diesel, SP95, SP98, E10, E85, LPG) |
| Collection frequency | every 30 minutes, hands-free |
| From start-up to first dashboard | under 5 minutes |
The case has an instructive twist: the feed only provides the latest price for each station. To track trends, the platform itself has to rebuild the history, without duplicates, at every collection. Exactly the kind of invisible work that separates usable data from misleading data.
Four steps, one of which changes everything
1. Collect
The full feed is fetched every 30 minutes and only new prices are kept. History builds itself, and re-running a collection never creates duplicates.
Tool: dlt, orchestrated by Apache Airflow.
2. Transform and test
Data is cleaned, organised into layers (bronze, silver, gold) and checked by 36 quality tests on every run.
Tool: dbt Core, on DuckDB locally or PostgreSQL in the cloud.
3. Govern
Business metrics are defined once: average price, minimum, maximum, spread, number of stations. This is the step that changes everything.
Tool: anfra, an open source semantic layer.
4. Expose
The same metrics feed the dashboard, the plain-language chat and the AI agents. One version of the truth, many uses.
Tools: data app, LibreChat, Claude or a local agent.
Lesson 1: AI should query metrics, not tables
The semantic layer is the heart of the system. It describes, in a language the AI can read, what each metric means. The "average price", for instance, only counts prices updated in the last 7 days: a station that hasn't published for a month doesn't skew the average.
The agent never sees the tables. It goes through a standard connector, the MCP protocol (Model Context Protocol), which gives it three moves: browse the metric catalogue, query a metric, trace its origin.
In the demo, asked "what is the average price of diesel in Nantes?", the agent answered €2.132/L, computed over 15 stations. Three details make the difference:
- the number is identical to the dashboard's, because it comes from the same definition;
- the 7-day rule is applied without the user needing to know it exists;
- the agent states its scope: the city of Nantes, excluding the neighbouring towns of Rezé, Saint-Herblain and Orvault.
That last point is what builds trust. A number without a scope is an opinion; a number with its scope and definition is information.
Lesson 2: upstream quality is no longer optional
A semantic layer doesn't fix wrong data; it spreads it faster. The platform therefore organises data into three layers, following the so-called "medallion" architecture:
- Bronze: a faithful, never-modified copy of the source that keeps the full history. Everything can be recomputed.
- Silver: cleaned and standardised data (types, naming, rounded prices, Paris time zone).
- Gold: a ready-to-use model, the only layer read by the semantic layer, and therefore by users and AI.
On every run, 36 tests check the essentials: unique, non-empty keys, allowed fuel types, prices between €0.50 and €5 per litre, consistent links between tables. A person spots an absurd price at a glance; an agent doesn't. These automated checks replace the missing pair of eyes.
Lesson 3: every answer must be traceable
Lineage, the map linking each metric to the tables and transformations it depends on, is published automatically on every run. The agent can therefore answer a question that is rarely asked yet essential: "which data does this number depend on?"
For an executive committee, it is the difference between "the AI says that" and "here is the number, its definition and its source". For an auditor, it is the precondition for accepting an AI-produced figure in an official document.
Lesson 4: an agent needs instructions, like a new analyst
Governance doesn't stop at the data. The agents themselves receive written instructions, and the most useful ones are surprisingly simple:
- "Never make up a number." Every figure in the answer must come from a query result.
- "For a total, ask the metric; never add up rows." The station count counts distinct stations: summing each region's count would give a false total.
- "Always state the scope." The fuel type, the area, how recent the prices are.
These are the rules you would give a junior analyst on day one. Writing, testing and evolving them is part of running the platform.
Lesson 5: you decide where your data goes
Querying your data with AI doesn't mean shipping it to an American provider. The platform offers two modes, depending on your requirements:
| Cloud LLM (Claude) | Local LLM (goose + Ollama) | |
|---|---|---|
| Reasoning quality | Best in class, including on complex questions | Fine on simple questions, less reliable on complex queries |
| Data | Query results, often aggregated, go through the provider; platform access is token-protected | No data leaves the machine |
| Response time | A few seconds | ≈ 2 minutes per question on CPU, without a GPU |
The local model is a 9-billion-parameter open source model. It doesn't compete with a large cloud model, but it proves a point: thanks to the semantic layer, the choice of LLM becomes a setting, not a rebuild. You can start in the cloud and bring it in-house later, or the other way round.
Bonus: a dashboard built from a simple request
Because the agent knows the metrics, it can also build a dashboard on demand, in minutes, with no developer and no BI tool to configure. The result is always up to date (queries run every time it is opened) and traceable (sources and queries visible, CSV export). The "official" data app, with cross-filters by fuel type, region or road type, lives alongside these ad-hoc views, on the same definitions.
What does it cost?
Every component is open source: no licences. The same image runs on a laptop (one command, about 4 GB of memory), on Google Cloud or on a sovereign Kubernetes such as OVH; only the warehouse engine changes, through configuration.
On Google Cloud, the infrastructure is ephemeral: a job creates the cluster and database for the demo, then deletes them. Switched off, the platform costs about €7 a month (reserved IP address, images and secrets). By comparison, Google's managed Airflow service, Cloud Composer, runs permanently for about €300 a month.
What the demonstrator doesn't prove
Let's be precise. The tools have no authentication when run locally, history is thin before the first run, the local engine (DuckDB) only accepts a single writer, the local LLM is slow, and the OVH deployment is ready but still to be validated in real conditions. Nothing blocks production (SSO, PostgreSQL or cloud warehouse, GPU or cloud LLM, persistent storage), but none of it is automatic either.
What about SMEs and mid-sized companies?
The temptation is to start with the AI: pick an assistant, plug it into the warehouse and see what happens. The reverse order is what works:
- Define ten metrics tracked by the executive committee, in writing, with their calculation rule and scope.
- Make the data behind them reliable: history retained, automated tests, a "ready-to-use" layer separate from raw data.
- Expose those metrics in a semantic layer, readable by people and AI alike.
- Connect the agent to that layer only, with written instructions and protected access.
- Choose the model (cloud or local) based on data sensitivity, knowing you can switch later.
Incidentally, the project was run with the BMAD method: brief, requirements, architecture and decisions are all documented, which makes it possible to evolve the platform with AI agents without losing the thread.
In short
AI agents don't replace the data platform: they make it indispensable. Metrics defined once, data tested on every run, end-to-end traceability and a free choice of model: that foundation is what turns a convincing answer into a reliable one.