PRJ_007
007
NLP · RAG · E-commerce · Data Engineering
NLQ Inventory Search via RAG
RedCloud Technology · London, UK · Sep, 2024 – May, 2025
Overview

Enhanced natural language query capabilities for RedCloud's B2B commerce platform by vectorising product inventory and building a RAG pipeline. Integrated WhatsApp Flows API to bring NLQ directly into merchant chat interfaces. Applied K-Means clustering on transaction data for geographic market segmentation.

The Problem

Merchants on the platform had diverse linguistic backgrounds and no standardised product naming conventions. Getting an NLQ system to reliably surface the right inventory item from a colloquial or misspelled query was fundamentally harder than standard search. The WhatsApp integration added latency constraints that ruled out heavier retrieval architectures.

Key Metrics
40%
NLQ accuracy uplift
<300ms
Query response time
12
Market segments identified
3
Countries deployed
Process & Timeline
Phase 1
Data audit & vectorisation
Cleaned and standardised 800k+ product records. Selected a multilingual embedding model to handle linguistic diversity. Built the Pinecone vector index with metadata filters for category and region.
Phase 2
RAG pipeline
Designed the retrieval pipeline with a hybrid approach — dense retrieval (vector) + sparse reranking. Built intent classification as a preprocessing step to route ambiguous queries.
Phase 3
WhatsApp integration
Integrated with WhatsApp Flows API, working within a 5-second response budget. Designed a streaming response pattern for longer results to avoid timeout failures.
Phase 4
Clustering & segmentation
Applied K-Means (k=12) on transaction vectors to identify geographic product distribution patterns. Outputs fed into the platform's market segmentation dashboard.
Tech Stack
BigQueryPythonSnow
Critical Self-Evaluation
NLQ quality is deceptively hard to measure rigorously. Our precision metrics looked strong in testing but qualitative gaps only surfaced in live user sessions — merchants were phrasing queries in ways that fell outside our test distribution. I should have built an intent failure logging system from the start rather than relying on aggregate accuracy scores. The K-Means clustering work was genuinely insightful — the geographic distribution of product preferences was more granular than anyone expected, and that finding influenced product strategy beyond the technical scope. That's the kind of work I want to do more of: analysis that changes how people think, not just systems that run.