TRIKHYA INTELLIGENCE FOUNDRY
Contact us
SOLUTION 01 · B-AI-B · IN PRODUCTION

Natural Language Query Assistant.

Ask the business a question in plain words. Get a checked, sourced answer with a chart, in seconds.

92.4%answers correct end to end
3live systems joined in one warehouse
3languages, by text and voice
0write access: every query is read-only
THE PROBLEM

A multi-plant manufacturer could not get a straight answer out of its own data.

Delivery, material and finance data lived in three separate systems across several plants: an ERP, a warehouse system and an order-management system. A simple question such as which orders will miss dispatch this week took three people most of a day, passed through spreadsheets, and was stale by the time it reached the manager who asked. People learned to stop asking.

01Three systems, one questionEvery operational question needed someone to join data by hand across the ERP, the warehouse and order management.
02Answers arrived lateBy the time a report was ready the shift had changed and the at-risk order had already slipped.
03No trust without the sourceA number on a slide could not be checked. Managers wanted to see which records an answer came from.
WHAT WE BUILT

Ask in plain words. Get the answer, the source and the chart.

Built for a multi-plant insole manufacturer. Plant staff ask about orders, materials and finance in English, Tamil or Hindi. The assistant writes a read-only query against a governed warehouse, has a second model check the result, and answers with its sources and a chart.

Follow-up questions keep the thread. A vague question gets a clarifying prompt instead of a confident wrong answer. Every answer shows the records it came from.

0:00 / 0:00
OUR APPROACH

Definitions first. Then a system that can be measured.

Most failures we had seen in this space were not wrong SQL. They were a word that meant two things in two departments, or a join that looked valid and was not. So before any model was chosen we sat with the people who answer these questions today and wrote the rulebook down: the business glossary, the metrics, and the only joins that are allowed. The assistant reads that rulebook. It does not invent one.

01Governed, not open-endedA fixed sequence of stages rather than a free-form agent loop, so the number of model calls per question is known before it runs.
02Read-only by designQueries run under a database role that cannot write, against approved tables, along approved join paths, with a time budget.
03Checked before it is shownA second model reviews every query and result against the question. If it disagrees twice, the assistant says it has no answer.
04Measured on every releaseA fixed set of real questions runs each time we ship. Accuracy is a number we publish to the client, not an adjective.
HOW IT WORKS

How a question becomes an answer.

Nine stages, three early exits. Out of scope stops. A vague question gets a clarifying prompt instead of a confident guess. A close match in the semantic cache replays a known-good query, still executed fresh and still validated.

Question
text or voice
Normalise
clean the wording
Resolve context
follow-ups stand alone
Scope & route
pick the domain
Out of scope
say so, stop
Clarity check
anything missing?
Semantic cache
seen this before?
Select tables
approved set only
Generate SQL
glossary, rules, joins
Execute
read-only, time budget
Ask to clarify
“did you mean…?”
Answer
sources + chart
Insight & chart
narrative, card
Validate
second model checks
unclear
cache hit · replay query
retry with feedback · max 2 attempts
01Normalise and resolveThe wording is cleaned deterministically. A follow-up such as “and last month?” becomes a standalone question using the earlier turns.
02Scope and routeThe question is scored for scope and assigned a business domain. Out-of-scope questions are answered honestly and stopped.
03Clarity checkIf a metric, a time range or a reference is missing, the assistant asks “did you mean…?” before anything runs.
04Semantic cacheCurated past answers are embedded and searched. A close match replays its query, which is still executed and validated.
05Select tables and generateAt most eight approved tables, joined only along hand-written join paths, with curated examples in the prompt.
06Execute read-onlyUnder a role that cannot write, with a per-question time budget.
07ValidateA second model judges query and result against the question. A rejection sends the exact failure and the previous query back into generation.
08Retry, boundedTwo attempts, with a third only if the table set changed. The same rejection twice stops the loop. No answer beats a bad one.
09Insight and chartThe narrative streams word by word while the chart or table is planned. The answer carries its sources and a trace id.
THE DATA

Where the data comes from and where answers go.

Three live business systems feed an hourly incremental ingest into a layered warehouse. A separate control-plane database holds what makes the assistant trustworthy: the table catalogue, the business glossary, the join registry, curated examples, users and feedback.

ERP
commercial, finance
Warehouse system
BOM, jobcards, material
Order management
output, QC, dispatch
Hourly ingest
incremental loads
Governed warehouse
bronze → silver → gold → reference
Query assistant
Web app
chat, role dashboards
WhatsApp alerts
acknowledge, resolve
Voice
Tamil, Hindi, English
Control-plane DB
catalogue, glossary, join registry, examples, users, feedback
Tracing & evaluation
every answer rated
read-only
catalogue · glossary · joins · examples
traces & ratings
THE RESULT

What changed on the floor.

92.4%of questions answered correctly end to end, measured on real questions from the client’s own staff, re-run on every release.
A sourced answer in secondsPlant heads open the day with a live picture of delivery and risk instead of a spreadsheet request.
The system says noWhen it cannot verify an answer it says so, rather than serving a plausible wrong one. That is why people trust the ones it does give.
Three languages, one pipelineTamil, Hindi and English, by voice or text, on top of the same tested query path.
AROUND IT

What else we built for the same floor.

Role dashboardsFloor supervisors see today’s priorities and line output. Plant heads see delivery, money and risk. Country heads see every plant at once.
Proactive alerts on WhatsAppOverdue and at-risk orders, material shortages and pending approvals reach the right person with acknowledge and resolve actions in the message.
Order capture from emailThe orders mailbox is read continuously. Purchase orders that were emailed but never entered are flagged before they become late deliveries.
Voice in three languagesSpeak the question, hear the answer. Voice adds two touch-points around the tested text pipeline, which stays unchanged.
Admin and governance consoleUsers and roles, every conversation traced, feedback analytics, human-approved onboarding of new tables and example answers.
Regression harnessA fixed question set runs on every release, and deployment refuses to ship if the catalogue or glossary falls below its minimum size.
BUILT WITHClaudePostgreSQL + pgvectorFastAPINext.jsVega-LiteGoogle Cloud RunLangfuseTwilio WhatsApp

Want this, shaped to your business?

Talk to us →All solutions