The problem
A D2C skincare brand with 40,000+ monthly orders was drowning in pre-purchase support tickets. 73% of inbound queries were variations of the same questions: ingredient compatibility, shipping timelines, return policy, product recommendations for skin types. Two support agents were spending 80% of their time answering questions that were already answered somewhere on the site.
The RAG pipeline architecture
1
Knowledge base ingestion
Ingested the entire product catalog (340 SKUs), ingredient database, FAQ pages, return/shipping policy docs, and 6 months of resolved support tickets. Text chunked, embedded using OpenAI text-embedding-3-large, and indexed in Pinecone with metadata filters for product category, ingredient type, and content type.
2
Retrieval & answer generation
When a customer asks a question, the query is embedded and the top 8 most relevant chunks retrieved from Pinecone. A GPT-4o prompt combines the retrieved context with the customer's conversation history to generate a grounded, accurate answer — citing specific products and policies, never hallucinating.
3
Live Shopify order context
For order status questions, the assistant calls the Shopify API in real-time to retrieve the customer's current order status, tracking number, and estimated delivery. Order-specific answers are accurate to the minute — not based on static FAQs.
4
Escalation detection & handoff
An n8n workflow monitors assistant conversations for escalation signals — complaint language, repeated questions, explicit agent requests. When detected, a human handoff is triggered: conversation context, product details, and customer order history are packaged and routed to a live agent in Gorgias with full context.
5
Continuous improvement loop
Every resolved ticket is analysed by the pipeline — if the AI couldn't answer it, the question and agent's response are flagged for knowledge base expansion. The knowledge base self-improves monthly with no manual curation required.
We launched in peak season and it handled Black Friday traffic without breaking a sweat. Our two agents went from being overwhelmed to handling only the genuinely complex cases. CSAT actually went up — customers get answers instantly instead of waiting hours.
— Head of CX, D2C Skincare Brand, UK