Questions the Dashboards Could Not Answer
Every closing the company handles passes through about twenty workflow stages, and each stage has a turnaround goal the company answers for to its own clients. Managers see the data through a set of Power BI dashboards built on stored procedures. A refresh can take minutes, and a dashboard covers only what it was built to show.
A question outside the dashboards goes to an analyst and waits in a queue. The rules for what counts as on time sit in one place only: inside hundreds of lines of procedure code.
Where Chat-With-Your-Database Tools Go Wrong
- The model invents the business metric. On time differs from stage to stage: which event starts the clock, business hours or calendar hours, which holidays count, which clients are excluded. A model that improvises the formula returns a plausible number that disagrees with the dashboard, and the manager stops trusting both.
- Milestones are found by name. A text match also finds workflow events the company does not use. Milestones have to be fixed, verified codes.
- The tables are large and shared. One unfiltered query over the largest tables stalls the server that production reporting runs on. The check has to happen before the query is sent.
- Similar things are easy to mix up. Clients, closers, offices and property states look alike in a schema. Confusing them never shows as an error, only as a wrong number.
- Two hand-picked questions always look fine. Real defects show when the same fact, asked two ways, gives two answers.
Two Paths for Two Kinds of Question
A manager asks a question in Teams the way they would ask a colleague. The agent reads the database with a read-only login and replies with concrete numbers and names, together with the query it ran. SLA questions and open questions take different paths, because they carry different risks.
- SLA questions. The model recognizes the stage, the period and the filters, and code assembles the query from a catalog transcribed from the company's own procedures. The same question always produces the same query, so the chat and the dashboard show the same number.
- Open questions. For volumes, revenue, workloads and comparisons, the model picks from about 150 verified query patterns and a catalog of tables and business definitions, and writes a single read-only query.
- The check. Before anything runs, code verifies that the query is a read and that it does not scan a very large table without an indexed filter.
- The answer. Numbers, names and the query that produced them. If the result is empty or misses the question, the agent asks a follow-up of its own, a bounded number of times.
Where a stage cannot be measured for part of the business, the agent says so and explains why, instead of offering a neighboring number.
Technology Stack
Why the Chat and the Dashboard Agree
Turnaround figures are what the company reports to its clients, so a merely plausible number is worse than none. The model's job is to understand the question. The arithmetic follows the company's own definitions, in code.
- Read-only by construction. A read-only login, one read query per step, and a cost check before anything reaches the server.
- Quirks are settled by the business. Each stage is copied from the company's procedure as it is. The catalog is designed so that, if the business decides a quirk is a defect, the fix is a change to one field.
- Defects become checks. An offline test suite that needs neither the database nor the model runs every query variant a change can produce. The process is designed so that a defect is written as a failing check before anyone fixes it.
Built to Handle
Each item below describes what the agent is built to do.
- No writes to the company database: a read-only login and read queries only.
- A query over a very large table without an indexed filter is rejected before it is sent.
- SLA queries are assembled by code from the stage catalog.
- An answer contains concrete numbers and names, every item when a list is asked for, and the query that produced them.
- The language model can run in the client's own cloud subscription, and the agent also works with OpenAI, Google and open-weight models.
Other Operations With the Same Shape
Turnaround goals, a large operational database and a wall of reports: the combination is common.
- dozens of reports built on stored procedures, each taking minutes to refresh;
- managers' questions that go beyond what the reports were built to show;
- a key metric whose definition exists only inside procedure code;
- a database shared with production reporting, where a careless query has a cost.
Title and escrow, mortgage servicing, insurance claims, logistics and field service all run this way. The same agent can also answer in Slack or a web chat, and read other databases and reporting tools. The earlier AI assistant for report generation answered analysts' ad-hoc questions in a similar manner, and the text-to-SQL entry in our glossary explains the technique. Our AI agent development and data analytics services pages cover how we scope this work.
SLA stages whose queries are built by code from the company's own procedures
query patterns for open questions, each verified before use
writes to the company database