The problem
Al Majed Oud's staff across the GCC relied on analysts and Power BI reports for everyday sales numbers, mostly in English, while most of them work in Arabic. An assistant that improvises figures would do more harm than good: a plausible wrong number is worse than no answer.
Approach
- A router and 9 specialist agents on LangGraph: sales, customers, products, staff, stores, loyalty, payments, discounts, and one that clarifies or declines. A planner splits compound questions across agents.
- SQL guardrails on every query: read-only, one statement, a table whitelist per agent, a row cap and a time limit. An answer never states a figure that isn't in the returned rows.
- Clarifying or declining is a feature: with no period in the question, it asks for one; when the data can't answer, it says so. 64 test cases check exactly that.
- Arabic first: hybrid name search (dense and sparse vectors) for the many spellings of Arabic names, Hijri dates with Ramadan and Eid, and a right-to-left interface.
- A query-optimised copy of the Microsoft Fabric warehouse in PostgreSQL, with today's sales refreshed every 15 minutes.
- Answers stream in as they are written (SSE), with a chart the backend picks from the same rows, behind Microsoft Entra single sign-on.
- Eval-gated CI/CD and tracing: a bilingual test suite runs against each new build in the production environment and blocks any deploy that regresses; Langfuse traces every request, and an admin dashboard shows latency, quality scores and negative feedback.
Screens
Screens from the app. The chat screens run on illustrative demo data, not company figures.
The sales assistant
-
An Arabic answer, right to left: the figure, its sources and a chart drawn from the same rows, with illustrative demo data, not company figures. -
The home screen: starter questions in Arabic and English and past conversations, with illustrative demo data, not company figures. -
An English follow-up in the same conversation: the sales agent compares branches in a table and a chart, with illustrative demo data, not company figures. -
Sign-in on a phone: staff use their company Microsoft account (Entra single sign-on), with no password field. -
The same Arabic answer on a phone, with illustrative demo data, not company figures.
Architecture
Capability view: staff sign in with Microsoft Entra; a router sends each question to one of 9 agents, which write SQL through a guardrail layer over a PostgreSQL copy of the Fabric warehouse; an eval gate blocks any deploy that regresses. Figure 1
Outcome
- Went into production on Azure in June 2026, behind Microsoft Entra SSO and available to all staff; delivered and handed over in August 2026.
- The final release passed its release gate at 155/155, and the full nightly suite of 399 bilingual cases (248 Arabic, 151 English) reached 399/399.
- Answers in Arabic or English, streamed with charts, with figures built to match the company's financial reports.
- Handed over with runbooks, a mobile integration kit for the company's app team, and a disaster-recovery path rehearsed with a restore in about 2 minutes.
Stack
- Orchestration
- LangGraph
- Models
- Azure OpenAI
- Retrieval
- Qdrant
- Data
- PostgreSQLMicrosoft Fabric
- Services
- FastAPINext.jsPython
- Infrastructure
- Azure Container Apps
- Quality
- LangfuseMicrosoft Entra ID
Where these facts come from. No figure here is estimated: where a client hasn't published a number, the page describes what the system does. Sources: project details approved for publication.