Count users by role
“How many users do we have in each role?”
The assistant finds where user roles are stored, groups users by role and counts each group. Four groups, so the answer comes back with totals and a pie chart.


Two questions from the project, replayed with the same figures. Pick one to follow how it gets answered.
There are 200 users across four roles.
The assistant picks the view that fits the answer.
The admin area had a page for every table, somewhere between 60 and 70 of them. Admins could browse and filter one table at a time. A question that needed two tables meant exporting lists into a spreadsheet, or waiting for someone to write a query.
Let admins type the question the way they’d ask a colleague. We wrote the assistant a plain-words guide to the tables, their columns and how they connect, so it can work out where to look.
An AI assistant with a few tools to look up tables, fetch records and count them. It only reads data, through the same data service the application already used, and it fixes its own query when a field name is wrong.
Each answer arrives as the right piece of screen. The way the assistant asks the data decides the view, and one answer can show more than one, so admins never wade through raw data.
Work out what the admin is asking about: which records, which conditions and dates, and whether they want a list, a count or a comparison.
Search a plain-words guide to the data and pick the few tables and columns that can answer it, along with how they connect.
Choose the columns and filters, and what to count or group. If a field name is wrong, the tool says so and suggests the right one, and the assistant tries again.
Run the query through the application’s existing data service. Nothing is copied and nothing is changed.
The kind of query decides the view: records become a table, groups become a chart, activity over time becomes a trend, with the key numbers on top.
“How many users do we have in each role?”
The assistant finds where user roles are stored, groups users by role and counts each group. Four groups, so the answer comes back with totals and a pie chart.

“How many organizations do we have, how many are active, and how many created a report in the last 30 days?”
This one needs two tables. The assistant counts organizations, checks which are active, then looks at their reports from the last 30 days. Here that gives 24 organizations, 18 active, and 11 that created a report.
