AI agents for natural-language queries on Power BI dashboards
A module I built from scratch with LangChain agents. It lets users ask questions in natural language about Power BI dashboards for contract management and for audit planning and monitoring.
- A hybrid strategy keeps hallucination and cost low. Each question first goes through semantic routing (embeddings + cosine similarity) to a catalog of pre-validated DAX queries. Only when nothing matches does the LLM generate DAX from the dataset schema.
- The catalog and routing rules are declarative YAML, so new queries are added without changing Python code.
- Queries run over REST or XMLA. Results are normalized, the number of records sent to the LLM is capped, and a debug mode shows the executed DAX.
- A CLI mirrors the API for operations and troubleshooting.
- The agents share helper code instead of duplicating it.