Retail and eCommerce Case study
Ecommerce AI chatbot on Azure OpenAI
Ecommerce AI chatbot for a supplement store: approved answers first, Azure OpenAI only from retrieved passages (RAG), and guards for health claims, prices and unsafe topics.

- Client
- Saba
- Service
- AI, Web apps, Integrations
- Years
- 2026
- Stack
- Azure Functions, Azure AI Search, Azure OpenAI, .NET and 5 more
- Platforms
- Web
Overview
Saba wanted visitors to get quick answers about products, orders, the company and policies. The assistant searches an index of approved question-and-answer entries and crawled site pages, returns a stored answer word for word when it is clearly right, and otherwise drafts a reply from the retrieved passages or says it cannot answer. It replaced an earlier bot whose answers were shipped to every visitor's browser. We built the chat engine inside the storefront, the nightly ingestion job, the chat widget and the test suite.
The challenge
Supplement wording carries regulatory risk, and similarity scores alone cannot tell a right answer from a wrong one. Prices must not come from stale text, and a bad crawl must never wipe the search index.
What we built
- A curated question-and-answer set, each entry tagged with how it may be served: as written, with a disclaimer, as a link only, held for review or hedged
- A nightly Azure Functions job that reads the sitemap, crawls and cleans the pages, chunks and embeds the text and loads it into a hybrid keyword and vector index, with price masking, host allow-lists and an abort rule for a bad crawl
- A chat engine in the storefront: fixed replies for greetings, contact, order status, price questions, abuse and self-harm, then retrieval with a stored answer returned only above set thresholds, and a model that answers only from the retrieved passages
- An output guard that removes disease claims, quoted prices, leaked instructions, foreign links and emails
- Safety-topic tracking across a conversation, with a caring reply and a crisis line for self-harm
- Request limits, anti-forgery protection and a lazy-loaded, keyboard and screen-reader accessible chat widget that re-checks links before showing them
- Automated tests for adversarial input, intent routing, the orchestrator, the output guard and live retrieval, and Bicep templates for the Azure resources
- Removal of the previous bot and its in-browser answer data
How a system like this fits together
Reference architecture: guarded retrieval-grounded AI assistant
Simplified reference architecture, not a client schematic.
- A shopper types a question in the chat widget on the storefront. The widget sends it, with the last few messages, to the chat API.
- Fixed rules answer greetings, contact, order-status, price and abusive questions, and handle self-harm, without calling Azure.
- Otherwise the engine embeds the question (Azure OpenAI) and searches the index (Azure AI Search) for approved answers and site pages.
- A clear stored answer is returned as written. If none fits, the model drafts a reply only from the retrieved passages, or says it cannot answer. The answer guard then removes disease claims, quoted prices and foreign links before the widget shows it with its sources.
- Separately, a nightly Azure Function reads the approved Q&A and crawls the site pages, embeds them and refreshes the index.
Technology used
| Layer | Choice | Purpose |
|---|---|---|
| Search | Azure AI Search | hybrid keyword and vector retrieval |
| AI | Azure OpenAI | embeddings and grounded answers |
| Ingestion | .NET, Azure Functions | nightly crawl, chunking and embedding |
| Engine | C# inside the ASP.NET storefront | routing, retrieval, guards |
| Delivery | Bicep, xUnit | repeatable resources and a test safety net |
| Monitoring | Application Insights | logs and function monitoring |
What happened next
- Delivered
The work described above was delivered to the client.
- Operational facts
- Our work on this project took place in 2026.
Could this be your project?
- You have a defined job in a real process that automation or AI could take on. AI services
- You need a web application with user accounts, admin tools and reporting. Website and web app development
- You work in retail and ecommerce and want a team that has built for it before. Retail and eCommerce work
Questions about this project
How long did this project take?
Our work on it took place in 2026.
What technology was used?
Azure Functions, Azure AI Search, Azure OpenAI, .NET, C#, RAG, Bicep, xUnit, Application Insights.
Similar work
Also AI assistants and .NET, also an AI project
AI assistant that guides residents to city services
A chat assistant that answers property and permit questions from city documents and live GIS layers, cites its sources and routes people to the right department.

Also .NET, same industry
Top Tier Editing: quote calculator and order platform
A .NET Blazor quote calculator, order and checkout flow and back office for Top Tier Editing, an editing service: instant prices from admin-set rules, document upload with word count, Stripe and PayPal payments and scheduled emails.
Also .NET, same industry
Direct selling storefront and distributor back office
Direct selling website for a US supplement brand: a replicated storefront and a distributor back office with guest checkout, enrollment, auto-orders and marketing automation.


