all-rag-techniques  by FareedKhan-dev

Jupyter notebooks for RAG technique implementations

created 4 months ago
1,916 stars

Top 23.2% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides a hands-on, educational implementation of over 20 Retrieval-Augmented Generation (RAG) techniques using fundamental Python libraries. It targets developers and researchers seeking to understand and experiment with RAG without relying on heavy frameworks, offering clear, modifiable code for demystifying advanced concepts.

How It Works

The project breaks down RAG into modular Jupyter Notebooks, each demonstrating a specific technique from basic retrieval to advanced methods like Self-RAG and Fusion RAG. Implementations are built from scratch using libraries like NumPy and OpenAI's API for embeddings and generation, emphasizing readability and educational value. It utilizes cosine similarity for vector search within a custom NumPy-based vector store.

Quick Start & Requirements

  • Install dependencies: pip install -r requirements.txt
  • Set OPENAI_API_KEY environment variable (Nebius AI API key required).
  • Run notebooks via Jupyter Notebook or JupyterLab.
  • Sample data (AI_Information.pdf, attention_is_all_you_need.pdf, val.json) is included.

Highlighted Details

  • Implements 21 distinct RAG techniques, including Semantic Chunking, Query Transform, Reranking, Self-RAG, Multimodal RAG (with LLaVA), Fusion RAG, and Graph RAG.
  • Features a "Best RAG Finder" notebook to identify optimal techniques for specific queries.
  • Utilizes both Nebius AI embeddings and BAAI/bge-en-icl embeddings.
  • Demonstrates RAG with Reinforcement Learning and adaptive strategies.

Maintenance & Community

The repository is actively updated, with recent additions including RL-based RAG and a best RAG finder. Contributions are welcomed.

Licensing & Compatibility

The repository does not explicitly state a license in the README. Compatibility for commercial use or closed-source linking is not specified.

Limitations & Caveats

The project relies on an OpenAI API key (specifically Nebius AI), which may incur costs. The absence of a specified license could pose restrictions on usage and distribution.

Health Check
Last commit

1 month ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
4,325 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.