MCPcopy Index your code
hub / github.com/datawhalechina/all-in-rag

github.com/datawhalechina/all-in-rag @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
589 symbols 2,042 edges 78 files 334 documented · 57% 20 cross-repo links updated 34d ago★ 9,33513 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

All-in-RAG | Large Model Application Development Practice: RAG Technology Full-Stack Guide

All-in-RAG Logo

🔍 Retrieval-Augmented Generation (RAG) Technology Full-Stack Guide

From theory to practice, from basics to advanced, build your RAG technology system

GitHub stars GitHub forks Python

Online Reading Chinese Version Discussion

🎯 Systematic Learning Complete RAG technology system 🛠️ Hands-on Practice Rich project examples 🚀 Production Ready Engineering best practices 📊 Multimodal Support Text + Image retrieval

Project Introduction(中文 | English)

This project is a comprehensive RAG (Retrieval-Augmented Generation) technology full-stack tutorial for large model application developers. It aims to help developers master RAG application development skills based on large language models through systematic learning paths and hands-on practice projects, building production-grade intelligent Q&A and knowledge retrieval systems.

Main content includes:

  1. RAG Technology Fundamentals: In-depth introduction to RAG core concepts, technical principles, and application scenarios
  2. Complete Data Processing Pipeline: From data loading, cleaning to text chunking - the complete data preparation process
  3. Index Construction and Optimization: Vector embedding, multimodal embedding, vector database construction and index optimization techniques
  4. Advanced Retrieval Techniques: Hybrid retrieval, query construction, Text2SQL and other advanced retrieval technologies
  5. Generation Integration and Evaluation: Formatted generation, system evaluation and optimization methods
  6. Project Practice: Complete RAG application development practice from basic to advanced

Project Significance

With the rapid development of large language models, RAG technology has become the core technology for building intelligent Q&A systems and knowledge retrieval applications. However, existing RAG tutorials are often scattered and lack systematicity, making it difficult for beginners to form a complete understanding of the technical system.

Starting from practice and combining the latest RAG technology development trends, this project builds a complete RAG learning system to help developers: - Systematically master the theoretical foundation and practical skills of RAG technology - Understand the complete architecture of RAG systems and the role of each component - Develop the ability to independently develop RAG applications - Master evaluation and optimization methods for RAG systems

Target Audience

This project is suitable for the following groups: - Developers with Python programming foundation who are interested in RAG technology - AI engineers who want to systematically learn RAG technology - Product developers who want to build intelligent Q&A systems - Researchers with learning needs for retrieval-augmented generation technology

Prerequisites: - Master Python basic syntax and usage of common libraries - Ability to use Docker simply - Understanding of basic LLM concepts (recommended but not required) - Basic Linux command line operation skills

Project Highlights

  1. Systematic Learning Path: From basic concepts to advanced applications, building a complete RAG technology learning system
  2. Theory and Practice Combined: Each chapter includes theoretical explanation and code practice to ensure learning and application
  3. Multimodal Support: Covers not only text RAG, but also multimodal embedding and retrieval technologies
  4. Engineering-Oriented: Focus on engineering problems in practical applications, including performance optimization, system evaluation, etc.
  5. Rich Practical Projects: Provides multiple practical projects from basic to advanced to help consolidate learning outcomes

Content Outline

Part I: RAG Fundamentals

Chapter 1 Unlocking RAG 📖 View Chapter 1. [x] RAG Introduction - RAG technology overview and application scenarios 2. [x] Preparation - Environment configuration and preparation 3. [x] Four Steps to Build RAG - Quick start with RAG development

Chapter 2 Data Preparation 📖 View Chapter 1. [x] Data Loading - Multi-format document processing and loading 2. [x] Text Chunking - Text segmentation strategies and optimization

Part II: Index Construction and Optimization

Chapter 3 Index Construction 📖 View Chapter 1. [x] Vector Embedding - Detailed explanation of text vectorization technology 2. [x] Multimodal Embedding - Image-text multimodal vectorization 3. [x] Vector Database - Vector storage and retrieval systems 4. [x] Milvus Practice - Milvus multimodal retrieval practice 5. [x] Index Optimization - Index performance tuning techniques

Part III: Advanced Retrieval Techniques

Chapter 4 Retrieval Optimization 📖 View Chapter 1. [x] Hybrid Search - Dense + sparse retrieval fusion 2. [x] Query Construction - Intelligent query understanding and construction 3. [x] Text2SQL - Natural language to SQL query 4. [x] Query Rewriting and Routing - Query optimization strategies 5. [x] Advanced Retrieval Techniques - Advanced retrieval algorithms

Part IV: Generation and Evaluation

Chapter 5 Generation Integration 📖 View Chapter 1. [x] Formatted Generation - Structured output and format control

Chapter 6 RAG System Evaluation 📖 View Chapter 1. [x] Evaluation Introduction - RAG system evaluation methodology 2. [x] Evaluation Tools - Common evaluation tools and metrics

Part V: Advanced Applications and Practice

Chapter 7 Advanced RAG Architecture (Extended Elective) 📖 View Chapter

  1. [x] Knowledge Graph-based RAG

Chapter 8 Project Practice I (Basic) 📖 View Chapter 1. [x] Environment Configuration and Project Architecture 2. [x] Data Preparation Module Implementation 3. [x] Index Construction and Retrieval Optimization 4. [x] Generation Integration and System Integration

Chapter 9 Project Practice I Optimization (Elective) 📖 View Chapter

🍽️ Project Demo 1. [x] Graph RAG Architecture Design 2. [x] Graph Data Modeling and Preparation 3. [x] Milvus Index Construction 4. [x] Intelligent Query Routing and Retrieval Strategy

Chapter 10 Project Practice II (Elective) 📖 View Chapter In Planning

Directory Structure

all-in-rag/
├── docs/           # Tutorial documentation
├── code/           # Code examples
├── data/           # Sample data
├── models/         # Pre-trained models
└── README.md       # Project description

Practical Project Showcase

Chapter 8 Project I:

Project I

Chapter 9 Project I (Graph RAG Optimization):

Project I (Graph RAG Optimization)

Chapter 10 Project II:

Acknowledgments

Core Contributors - Yin Dalv - Project Lead (Project initiator and main contributor)

Special Thanks

  • Thanks to @Sm1les for help and support on this project
  • Thanks to all developers who contributed to this project
  • Thanks to the open source community for providing excellent tools and framework support
  • Special thanks to the following developers who contributed to the tutorial!

Contributors

Made with contrib.rocks.

Contributing

We welcome all forms of contributions, including but not limited to:

  • 🚨 Bug Reports: Please submit Issues if you find problems
  • 💭 Feature Suggestions: Welcome to discuss good ideas in Discussions
  • 📚 Documentation Improvement: Help improve documentation content and example code
  • Code Contributions: Submit Pull Requests to improve the project

Star History

all-in-rag stats

If this project helps you, please give us a ⭐️

Let more people discover this project (Food protection? Bring it on!)

star

About Datawhale

<img src="https://raw.githubusercontent.com/datawhalechina/pumpkin-book/master/res/qrcode.jpeg" alt="Datawhale" width="30%">

Scan the QR code to follow Datawhale WeChat Official Account for more quality open source content


License

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.


Core symbols most depended-on inside this repo

Shape

Method 389
Function 106
Class 94

Languages

Python100%

Modules by API surface

code/C3/visual_bge/visual_bge/eva_clip/transformer.py51 symbols
code/C3/visual_bge/visual_bge/eva_clip/eva_vit_model.py36 symbols
code/C9/agent(代码系ai生成)/recipe_ai_agent.py31 symbols
code/C9/rag_modules/graph_rag_retrieval.py29 symbols
code/C3/visual_bge/visual_bge/eva_clip/model.py27 symbols
code/C9/rag_modules/hybrid_retrieval.py21 symbols
code/C3/visual_bge/visual_bge/eva_clip/hf_model.py20 symbols
code/C3/work_hybrid_multimodal_search.py19 symbols
code/C9/rag_modules/milvus_index_construction.py17 symbols
code/C4/03_text2sql_demo_v2.py17 symbols
code/C3/visual_bge/visual_bge/modeling.py17 symbols
code/C3/visual_bge/visual_bge/eva_clip/utils.py16 symbols

Dependencies from manifests, versioned

Markdown3.8.2 · 1×
accelerate0.20.0 · 1×
av17.0.0 · 1×
bilibili-api-python17.3.0 · 1×
chromadb0.4.0 · 1×
dataclasses0.6 · 1×
datasets2.14.0 · 1×
einops0.8.1 · 1×
faiss-cpu1.7.0 · 1×
ftfy6.3.1 · 1×
huggingface-hub0.33.4 · 1×
jieba0.42.1 · 1×

For agents

$ claude mcp add all-in-rag \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page