|
|
Claude RAG with Citations
Author: Venkata Sudhakar
RAG (Retrieval-Augmented Generation) with citations grounds Claude's responses in specific documents and provides verifiable sources for each claim. For ShopMax India, a warranty policy assistant must not only answer questions accurately but also tell customers exactly which policy clause applies to their situation. Without citations, customers distrust AI responses on sensitive topics like returns and refunds. With citations, each answer links back to the exact policy document section, building confidence and reducing escalations to human agents.
Claude's native citation support works by sending documents as content blocks alongside the query. When asked to cite sources, Claude returns citation objects that reference specific text spans within the provided documents. The document_index, start_char_index, and end_char_index fields pinpoint exactly which text was used, enabling your application to highlight the source in the UI. This is more reliable than asking Claude to quote sources in free text, where it may paraphrase or misattribute.
The following example shows ShopMax India using Claude RAG with citations to answer warranty policy questions, returning answers with precise document references:
It gives the following output,
Answer: Unfortunately, the standard return window for ShopMax India electronics is 10 days
from delivery [1]. However, since your TV arrived damaged, this falls under the
"Damaged on Arrival" policy which allows immediate replacement or full refund within
48 hours of delivery [1]. Since 15 days have passed, you should still contact ShopMax
support immediately as damaged-on-arrival claims have separate handling.
Source: [1] ShopMax India Return Policy 2026
Excerpt: Items damaged during transit or with manufacturing defects qualify for
immediate replacement or full refund within 48 hours
Answer: No, water damage is explicitly excluded from warranty coverage at ShopMax India [2].
Only defects in materials and workmanship are covered under the standard 1-year warranty.
Source: [2] ShopMax India Warranty Policy 2026
Excerpt: Physical damage, water damage, unauthorized repairs, and normal wear and tear
are not covered under warranty.
For ShopMax India production RAG systems, store policy documents in a vector database like Chroma or Pinecone and retrieve only the top 3-5 most relevant chunks before sending to Claude - this reduces token usage versus sending all documents. Enable citations on all document blocks in customer-facing applications; the cited_text field lets your frontend highlight the exact policy text, which dramatically reduces follow-up questions. Track which policy sections get cited most frequently in your analytics - high citation frequency on the exclusions section means customers are trying to return non-returnable items and your product listing may need clearer warnings.
|
|