SAPT Loyalty & Dual-Intent AI Shopping Assistant
On-Premise Fine-Tuned LLM · pgvector RAG · React Native Expo

Retailers need intelligent shopping assistants, but cloud LLM API fees destroy margins.
SAPT Central Markets required a loyalty mobile application to replace verbal phone-number lookups at checkout. In addition, customers on the shop floor needed a fast, bilingual (AR/EN) conversational shopping assistant to query product prices, stock, and loyalty information. Pushing all traffic to a commercial cloud LLM API created unsustainable ongoing costs and posed data privacy concerns, while direct transactional DB queries for fuzzy/semantic text searches overloaded the Odoo ERP database.
THE STANDARD APPROACH FAILS BECAUSE:
Deliver sub-second, bilingual AI search and conversation without incurring cloud API costs, while guaranteeing 100% accurate pricing to prevent hallucination.
"Hosted an auto-tuned Qwen2.5-3B-Instruct model locally on Ollama, fine-tuned via Unsloth LoRA on a custom grocery dataset."
— KEY ARCHITECTURAL DECISION
TECHNICAL DECISIONS // 5 MADE
On-premise deployment of Qwen2.5-3B-Instruct via Ollama to eliminate token costs
Fine-tuned via Unsloth LoRA on a custom Saudi-grocery dataset
Dual-intent routing engine: Semantic RAG vs Navigation
Strict Tool-Wait streaming interruption protocol to prevent price hallucinations
Secure JWT authentication tunneled over Ngrok

Sub-second bilingual (AR/EN) conversational search
Dual-Intent AI Engine
ON-PREMISE LLM- Product & Price Queries: Routes to high-performance pgvector cosine similarity search
- Strict Tool-Wait Protocol: Interrupts stream generation to inject real Odoo data and prevent hallucination
- General Info & Navigation: Identifies intents (points, vouchers) and returns deep-linked markdown
- Vision Search: Local Llama 3.2 Vision (11B) extracts brand text from user photos
Mobile Application
REACT NATIVE + EXPO- Auto-Brightness Barcode: Maximizes screen illumination during loyalty barcode displays
- Dynamic CMS Flyer: Weekly flyer viewer with multi-image caching and zoom
- Branch-Aware Locators: Real-time open/closed indicators based on local branch time logic
- Encrypted JWT tokens for authenticated JSON-RPC requests via Expo SecureStore