Stiekema StudioNederlands

Case sheet

Chat with your data warehouse

An AI agent that answers questions about the data warehouse in plain language, alongside the existing Power BI. The language model never touches the data directly; it only calls grounded tools behind a security layer.

XBAS Business Intelligence · Almere NL · Case datawarehouse-chat

Summary

An agent that lets staff put questions to the data warehouse in plain language, as an addition to the existing Power BI reports, not as a replacement. The agent turns a question into a planned tool call, has a separate security layer run the query, and phrases the answer with the real figures attached. The system is built as a modular monolith: one application, split internally into separate modules with a fixed interface that can be switched on or off per environment. The core that guards the scope, a list of permitted sources and fields, is maintained separately as the most important piece of knowledge in the system.

The brief

Find out whether staff can ask questions in natural language about data from the data warehouse, without the language model ever getting direct access to the data warehouse or to information it is not allowed to see.

What I built

  • An orchestrator that plans a question, calls the right tool and reports the result back
  • A tool that fetches key figures by turning natural language into a query on a semantic layer (cube)
  • A tool that fetches detail data through a secured, read-only SQL layer on a fixed list of permitted views
  • A security layer that checks every query and lets through only read statements on those permitted views
  • An extensible module registry that lets parts be switched on or off per environment
  • A light chat interface that shows, besides the answer, the result table and where it came from (which tool, which query)

In detail

  • Two data sources, one entrance: key figures from the semantic cube layer (the same figures as in Power BI), detail data through a tightly bounded SQL route; the agent picks the route that fits
  • A security layer between language model and data: every generated query is validated, only read statements on an approved list get through, so the language model can never request data that has not been released
  • Provenance with every answer: the interface shows not only the answer in prose but also the result table and which tool and query produced it
  • An extensible module setup: a new capability is added as a standalone module, switchable per environment, without touching the core logic
  • Refusing outside scope: questions that fall outside the permitted sources are recognised and turned down instead of answered with something made up

Outcome

Works end to end on real production data, covered by about 95 Python tests and 13 JavaScript tests. Two parts were still open at the last state: a document search function (the underlying search infrastructure was switched off for the time being) and an alternative REST connection to the cube layer that still had to be verified against a real dataset.