Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG Production Setup

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.

Version License: MIT Stars Skill Type Last Updated

What this skill does

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

Why this skill exists

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.

Install

Claude Code

git clone https://github.com/datawithusman/rag-production-setup.git
cp rag-production-setup/SKILL.md .claude/skills/rag-production-setup.md

Or 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.md

Cursor

Save SKILL.md as .cursor/rules/rag-production-setup.mdc in any RAG project.

OpenCode / Windsurf / others

Copy the contents of SKILL.md into your tool rules or system prompt file.

How to use

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:

  1. Pick the right loader and chunker for policy PDFs
  2. Set up Chroma for dev, pgvector for prod
  3. Build a streaming FastAPI endpoint
  4. Add hybrid search and a reranker
  5. Set up RAGAS evaluation
  6. Wire up LangSmith tracing

What is inside

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

Who this is for

  • 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

Who this is NOT for

  • Pure chatbots with no retrieval
  • Image/video/audio search
  • Multi-agent or agentic RAG (different skill)
  • Simple keyword search where BM25 alone is enough

Tech stack

  • 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

About the author

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.

Contributing

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.

License

MIT. Use it for client work, paid projects, your own product.

Other skills in this series

About

Claude Code skill - Production RAG systems with FastAPI + LangChain + Chroma + pgvector + Next.js. Chunking, hybrid search, reranking, RAGAS evaluation, LangSmith tracing.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors