Case Study ยท Full Stack ยท AI ยท MCP

Retail Industry Bot POC

An agentic AI chatbot that lets retail staff query live order, inventory, and customer data using natural language โ€” with an enterprise-grade pattern to ensure customer PII never reaches the AI model.

RoleFull Stack Architect & Developer
PlatformAWS EC2 ยท Nginx ยท GitHub Actions
DomainRetail Operations
TypeAI / MCP Agentic POC

Retail staff spending 20+ minutes per shift hunting through dashboards for basic answers

The retail client's operations team needed answers like "what's the stock level for SKU-4821?" and "how many orders are pending dispatch in the North region?" โ€” all requiring separate dashboard logins and SQL knowledge.

Critical Constraint: Customer PII (names, addresses, phone numbers, email) must never be sent to the OpenAI API. GDPR and internal data policy required all external AI calls to operate on anonymised identifiers only.

MCP Server as the intelligent data access layer

1
React Chat UIClean streaming chat interface with SSE for real-time response streaming. Responses stream token by token.
2
FastAPI Orchestration LayerReceives user messages, manages conversation history, calls AI with tools available, and routes tool results through the agentic loop until a final answer is reached.
3
MCP Server (Tool Definitions)Exposes typed tools: get_order_by_id, get_stock_level, list_pending_dispatch. Each tool returns only fields needed โ€” never full customer records.
4
ID-Based Lazy Loading (PII Protection)AI model is given only numeric IDs. Full PII is assembled server-side and presented to the user โ€” never sent to OpenAI. This is the enterprise data boundary pattern.
5
PostgreSQL Retail DatabaseNormalised retail schema. MCP tools use parameterised queries exclusively โ€” no dynamic SQL construction.

Engineering the PII boundary correctly

Staff got answers in seconds, not dashboards

~8s
Average query response time
0
PII records sent to OpenAI
92%
Query accuracy in testing
CI/CD
Auto-deploy via GitHub Actions

Result: Client approved Phase 2 โ€” expanding tool coverage to supplier and logistics data.


Back to all projects