# RAG Techniques > A comprehensive open-source collection of 42+ advanced Retrieval-Augmented Generation (RAG) tutorials and implementations using LangChain, LlamaIndex, and PydanticAI. RAG Techniques is one of the most comprehensive open-source repositories for Retrieval-Augmented Generation (RAG) tutorials, covering 42+ techniques from foundational to advanced architectures. Maintained by Nir Diamant, the repository provides Jupyter notebook tutorials with runnable scripts for each technique, spanning query enhancement, context enrichment, advanced retrieval, evaluation, and agentic RAG. It leverages cutting-edge frameworks including LangChain, LlamaIndex, PydanticAI, and Contextual AI to help researchers and practitioners build production-ready RAG systems. - **Basic RAG & Foundational Techniques** — *Clone the repo and run the simple_rag.ipynb notebook to get started with basic retrieval pipelines using LangChain or LlamaIndex.* - **Query Enhancement** — *Explore query transformations, HyDE (Hypothetical Document Embedding), and HyPE (Hypothetical Prompt Embeddings) to improve retrieval alignment.* - **Context Enrichment** — *Apply semantic chunking, contextual chunk headers, contextual compression, and relevant segment extraction to improve context quality.* - **Advanced Retrieval** — *Use fusion retrieval, intelligent reranking, hierarchical indices, dartboard retrieval, and multi-modal RAG with captioning or Colpali.* - **Iterative & Adaptive Techniques** — *Implement retrieval with feedback loops and adaptive retrieval strategies that adjust dynamically to query types.* - **RAG Evaluation** — *Evaluate systems end-to-end using DeepEval, GroUSE, Open-RAG-Eval, and RAGAS with metrics for faithfulness, relevance, and hallucination detection.* - **Advanced Architectures** — *Build Graph RAG with LangChain or Milvus, Microsoft GraphRAG, RAPTOR, Self-RAG, Corrective RAG (CRAG), and Agentic RAG with Contextual AI.* - **Memory-Augmented Retrieval** — *Implement MemoRAG with FAISS-based retrieval, surrogate query generation, and key-value pair extraction.* - **Explainability** — *Use explainable retrieval techniques to provide transparency into why specific documents were retrieved.* - **Community & Contributions** — *Join the RAG Techniques Discord community or Educational AI Subreddit and contribute via pull requests following the CONTRIBUTING.md guide.* ## Features - 42+ RAG technique tutorials in Jupyter notebooks - Foundational RAG implementations (Simple RAG, CSV RAG, Reliable RAG) - Query enhancement techniques (HyDE, HyPE, query transformations) - Context enrichment (semantic chunking, contextual compression, chunk headers) - Advanced retrieval (fusion retrieval, reranking, hierarchical indices, dartboard) - Multi-modal RAG with captioning and Colpali - Graph RAG with LangChain, Milvus, and Microsoft GraphRAG - RAPTOR recursive tree-organized retrieval - Self-RAG and Corrective RAG (CRAG) architectures - Agentic RAG with Contextual AI - MemoRAG memory-augmented retrieval - RAG evaluation with DeepEval, GroUSE, Open-RAG-Eval, and RAGAS - Runnable Python scripts for each technique - LangChain and LlamaIndex implementations - PydanticAI integration for type-safe agent workflows - Community-driven contributions via GitHub PRs ## Integrations LangChain, LlamaIndex, PydanticAI, Contextual AI, OpenAI, FAISS, Milvus, DeepEval, GroUSE, RAGAS, Microsoft GraphRAG, Google Colab ## Platforms WEB, API, CLI ## Pricing Open Source ## Links - Website: https://github.com/NirDiamant/RAG_Techniques - Documentation: https://github.com/NirDiamant/RAG_Techniques/blob/main/CONTRIBUTING.md - Repository: https://github.com/NirDiamant/RAG_Techniques - EveryDev.ai: https://www.everydev.ai/tools/rag-techniques