RAG Crash Course — AI skill for Claude Code
Step-by-step RAG tutorial in Python: basic, hybrid (BM25 + dense), query rewriting, re-ranking, metadata filters and agentic RAG, using Actian VectorAI DB.
How to install RAG Crash Course
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open AIwithhassan/rag-crash-course and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What RAG Crash Course does
Step-by-step RAG tutorial in Python: basic, hybrid (BM25 + dense), query rewriting, re-ranking, metadata filters and agentic RAG, using Actian VectorAI DB.
Alternatives in AI
- Xerj — Local-first search engine and MCP server for AI agents 12.5k ★
- Codeseek — Rust-powered code intelligence CLI for AI coding agents 764 ★
- K Dense Byok — An AI co-scientist powered by Claude Scientific Skills running on your desktop 583 ★
README
RAG Crash Course
📺 **Video tutorial:** [Watch on YouTube](https://youtu.be/hYYk9S_8UXg)
A hands-on, step-by-step tutorial that builds a Retrieval-Augmented Generation (RAG) chatbot from scratch. Each step is one small Python file that adds **one new idea** and ends by showing a question the current approach still fails on, which motivates the next step.
The demo company is **Star Motors**, a fictional motorcycle maker. Its knowledge base is 10 short documents (HR policies, maintenance manuals, parts catalogs, safety rules, a confidential salary sheet) in [data/star_motors.py](data/star_motors.py).
**Stack:** [Actian VectorAI DB](https://www.actian.com/) (vector database, runs in Docker) · `sentence-transformers` (local embeddings and re-ranker) · `rank-bm25` (keyword search) · an LLM of your choice (OpenAI, Anthropic or Gemini).
The steps
| Step | File | New idea | Fails on, so we need the next step |
|---|---|---|---|
| 0 | build_index.py | Chunk → embed → store. Split documents into paragraphs, embed them, save them in VectorAI DB. | n/a (run this first) |
| 1 | step1_basic_rag.py | Semantic (dense) search + answer only from the retrieved chunks. | Exact codes like BRK-2270 have no "meaning" for an embedding model. |
| 2 | step2_hybrid_search.py | Hybrid search: dense + BM25 keyword search, merged with Reciprocal Rank Fusion. | A German question against English documents shares no words and no embedding space. |
| 3a | step3a_query_rewriting.py | Query rewriting: the LLM turns a messy question into a clean English query; both are searched and fused server-side. | The right chunk can still rank below look-alike chunks (e.g. prices vs. wear limits). |
| 3b | step3b_reranking.py | Re-ranking with a cross-encoder: fetch 20 candidates fast, re-score them carefully. | Better |
Related Skills
Hybrid Code RAG MCP
Local code search engine for AI agents: incremental indexer, hybrid retrieval (BM25 + dense embeddings in Qdra
Production RAG
Production Multimodal RAG & Autonomous ReAct Agent platform: Dense+BM25+CLIP hybrid retrieval, cross-encoder r
Anyindex MCP
Local MCP server for semantic code search. AST-aware chunking with tree-sitter, offline ONNX embeddings, hybri
InterviewLabAI
Adaptive AI interview-prep platform: LLM interviewer across 12 domains, hybrid RAG (BM25 + embeddings + re-ran
Anchored Memory MCP
面向 Claude Code、Codex、Cursor 等 多工具协同研发场景的本地/团队级上下文与研发经验管理服务。基于 Git 维护项目确定性规范(AGENTS.md / CLAUDE.md),通过 Basic Me
Fidelis
Zero-LLM agent memory for Claude Code and AI agents: local-first BM25, dense-vector, and reciprocal-rank-fusio
Related Agents
Mpep Researcher
Expert in searching and interpreting USPTO MPEP, 35 USC statutes, 37 CFR regulations using hybrid RAG search (
Python RAG Backend Engineer
Production-grade Python RAG backend engineer specializing in ChromaDB vector storage, sentence-transformers em
Engineering RAG Pipeline Engineer
Production RAG specialist focused on chunking strategy, retrieval quality, hybrid search, re-ranking, and eval