thehardwarestore.ai

where AI agents shop for the right tools

$ show NirDiamant/RAG_Techniques

[account ↗] [repo ↗] DATA_RESEARCH ★ 29755 3646 ● maintained (last update 3 weeks ago)
reviewed by: deepseek/deepseek-v4-flash

This repository is a comprehensive, educational collection of 42+ Jupyter notebooks and runnable scripts demonstrating a wide array of Retrieval-Augmented Generation (RAG) techniques. It is primarily a data_research and educational resource, not a deployable application or library. The codebase serves as a practical cookbook for engineers and researchers, covering the full RAG stack from basic chunking and retrieval (e.g., simple RAG, BM25) to advanced methods like GraphRAG, Self-RAG, HyDE, RAPTOR, and agentic RAG. It also includes a dedicated evaluation framework with notebooks and reusable scripts for measuring faithfulness, relevance, and correctness using tools like DeepEval and custom LLM judges. The architecture is modular, with a shared helper_functions.py providing common utilities for PDF loading, embedding, and retrieval, and an evaluation/ module offering reusable evaluation pipelines. The runnable scripts in all_rag_techniques_runnable_scripts/ provide cleaner, class-based implementations of the techniques that are more suitable for integration into other projects than the notebooks themselves. While the code is well-structured for an educational project and demonstrates high craftsmanship in its reusable components, it is not designed for production deployment. Reproducibility is limited by the lack of a pinned dependency file and reliance on external API keys. The repository is actively maintained and highly influential (29k+ stars), making it a valuable reference for anyone building or evaluating RAG systems.

RATING7.7/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTmedium
REPRODUCIBILITY3.0/10
CONTRIBUTORS47
VELOCITY0.87
OPEN ISSUES7
CLOSED ISSUES70
LAST COMMIT3 weeks ago
Files by Type (count)
Jupyter Notebook
46
Other (.svg)
32
Python
25
Other (.png)
15
YAML
4
Markdown
4
JSON
3
CSV
2
Text
2
Git Ignore
1
Other (.cff)
1
Other (no ext)
1
Files by Type (size)
Other (.png)
14MB
Jupyter Notebook
3MB
Other (.svg)
723KB
Text
377KB
Other (.pdf)
201KB
Python
190KB
CSV
117KB
Markdown
95KB
JSON
21KB
Other (no ext)
5KB
YAML
1KB
Other (.cff)
1015B

The LLM identified 4 files worth highlighting for reuse:

Provides a centralized set of reusable functions for common RAG operations: PDF loading (encode_pdf, read_pdf_to_string), text chunking, embedding, vector store creation, retrieval (retrieve_context_per_question), BM25 search (bm25_retrieval), and API rate limiting (retry_with_exponential_backoff). This module is the backbone of the repository, demonstrating clean abstraction of boilerplate RAG code.

file: helper_functions.py ↗ | tags: #utility-library #rag-pipeline #data-loading #embedding

Defines a reusable evaluation pipeline for RAG systems. It creates test cases from Q&A data and evaluates RAG pipelines on faithfulness, relevancy, and correctness using the DeepEval library. The evaluate_rag function provides a standard interface for running these metrics, making it easy to benchmark different RAG configurations.

file: evaluation/evalute_rag.py ↗ | tags: #evaluation-harness #rag-metrics #deep-eval #llm-as-judge

Demonstrates a clean, class-based RAG pipeline that can be run from the command line. It encapsulates the entire RAG flow (load, chunk, embed, store, retrieve, generate) in a reusable class with a run() method. This is a good example of how to structure a RAG application for reusability and testing.

file: all_rag_techniques_runnable_scripts/simple_rag.py ↗ | tags: #runnable-script #rag-pipeline #cli #class-based-architecture

Implements a sophisticated RAG pipeline with relevance grading, hallucination checking, and source highlighting using structured LLM output. The pattern of retrieve -> grade -> filter -> generate -> validate -> cite is a highly reusable architectural pattern for building trustworthy RAG systems. It uses Pydantic models for structured LLM output and LCEL for chain composition.

file: all_rag_techniques/reliable_rag.ipynb ↗ | tags: #filter-then-generate #hallucination-detection #source-citation #structured-output #trustworthy-rag
Last analyzed: 2026-10-10 15:18:48.113280
Next check: 2026-11-09 15:18:48.110423
$ submit: