A Claude Code skill for engineers who build production-grade Retrieval-Augmented Generation systems.
Most RAG tutorials stop at "embed documents, query GPT". This skill teaches Claude (or any coding agent) the patterns that actually work in production: chunking strategy, hybrid search, reranking, streaming, evaluation, observability, and deployment.
When you load this skill in Claude Code, the agent learns how to:
- Pick the right document loader for PDF, Word, Markdown, HTML
- Chunk documents for maximum retrieval precision
- Choose between Chroma, pgvector, Pinecone, Weaviate, and Qdrant
- Build hybrid search (BM25 + vector) that beats pure vector
- Add a reranker (highest-ROI upgrade you can make)
- Stream answers from the LLM to the UI
- Build a golden test set and evaluate with RAGAS
- Set up LangSmith observability
- Deploy with FastAPI + Next.js + Docker
RAG is the most common LLM application pattern. It is also the one most engineers ship broken.
The failure mode is always the same: developer follows a tutorial, embeds some PDFs, queries GPT, gets bad answers, blames the model.
The model is rarely the problem. The retriever is. And the retriever is determined by your chunking, your embedding, your search strategy, your reranker, and your evaluation set.
This skill teaches Claude all of those, with real code, real metrics, and real trade-offs.
git clone https://github.com/datawithusman/rag-production-setup.git
cp rag-production-setup/SKILL.md .claude/skills/rag-production-setup.mdOr install globally:
mkdir -p ~/.claude/skills
curl -sL https://raw.githubusercontent.com/datawithusman/rag-production-setup/main/SKILL.md -o ~/.claude/skills/rag-production-setup.mdSave SKILL.md as .cursor/rules/rag-production-setup.mdc in any RAG project.
Copy the contents of SKILL.md into your tool rules or system prompt file.
After installing, describe what you are building:
I want to build a RAG chatbot over 500 company policy PDFs.
Users will ask things like "How many vacation days do I get?"
I need source citations and the answer should stream.
Claude will use this skill to:
- Pick the right loader and chunker for policy PDFs
- Set up Chroma for dev, pgvector for prod
- Build a streaming FastAPI endpoint
- Add hybrid search and a reranker
- Set up RAGAS evaluation
- Wire up LangSmith tracing
| Section | What you learn |
|---|---|
| Document loading | Universal loader with metadata preservation |
| Chunking strategy | Recursive, semantic, markdown-aware patterns |
| Embedding | OpenAI vs self-hosted, cost estimation |
| Vector stores | Decision matrix for 5 major stores |
| Retrieval | Hybrid search + reranker (highest ROI) |
| Generation | Streaming chain with source citations |
| FastAPI backend | Production SSE streaming endpoint |
| Next.js frontend | Streaming chat UI component |
| Evaluation | RAGAS metrics + golden set methodology |
| Observability | LangSmith/Langfuse tracing setup |
| Deployment | Docker compose with pgvector |
| Anti-patterns | 8 mistakes that kill RAG in production |
- AI engineers building RAG for clients or products
- Backend developers adding chat-to-documents features
- Founders building internal knowledge assistants
- Consultants shipping AI products to enterprise clients
- Anyone who has built a RAG demo, watched it fail in production, and wants to know why
- Pure chatbots with no retrieval
- Image/video/audio search
- Multi-agent or agentic RAG (different skill)
- Simple keyword search where BM25 alone is enough
- Backend: FastAPI + LangChain
- Embeddings: OpenAI text-embedding-3-small (default) or BGE/E5 (self-hosted)
- Vector store: Chroma (dev) / pgvector (prod)
- LLM: GPT-4o-mini for chat, GPT-4o for evals
- Reranker: Cohere rerank-3 or BGE-reranker
- Frontend: Next.js 14 App Router
- Evaluation: RAGAS
- Observability: LangSmith
- Deployment: Docker Compose
Muhammad Usman. I build production RAG systems for clients through Data With Usman. I also teach Python as a Stanford Code in Place Section Leader and build AI systems at Nobel AI.
- GitHub: @datawithusman
- Site: datawithusman.com
If you have a chunking pattern, reranker comparison, or evaluation strategy that is not covered here, open a pull request. Include measured metrics.
See CONTRIBUTING.md.
MIT. Use it for client work, paid projects, your own product.
- business-data-automator - Convert messy spreadsheets into dashboards and automations
- rag-production-setup - This repo
- ml-pipeline-builder - End-to-end ML pipelines from data to API