Skip to content

15 different RAG implementation from Scratch #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
adithya-s-k opened this issue May 23, 2025 · 0 comments
Open
3 tasks done

15 different RAG implementation from Scratch #18

adithya-s-k opened this issue May 23, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@adithya-s-k
Copy link
Owner

Content Type

This issue is to create 15 different Retrieval-Augmented Generation (RAG) implementations from scratch using base libraries like:

  • litellm for LLM interaction
  • lancedb for vector storage and retrieval
  • Embedding models from HuggingFace (e.g., BAAI/bge-base-en-v1.5, sentence-transformers family)

The goal is to recreate each RAG variant found in repo using a minimal stack with readable, modifiable code, integrating AI Engineering Academy’s educational focus and data sources.

Topic Area

  • Retrieval-Augmented Generation (RAG)
  • LLMOps
  • Embedding Techniques
  • Knowledge Graphs
  • RLHF for Retrieval

Target Knowledge Level

  • Beginner
  • Intermediate
  • Advanced

Content Description

This initiative will rebuild 15 of the most educational and distinct RAG pipelines from the original “all-rag-techniques” repository into modular notebooks compatible with the [AI Engineering Academy format](https://github.com/adithya-s-k/AI-Engineering.academy/blob/main/docs/RAG/01_Basic_RAG/basic_rag_scratch.ipynb).

Each notebook should:

Notebooks to create:

  1. Simple RAG
  2. Semantic Chunking
  3. Chunk Size Selector
  4. Context Enriched RAG
  5. Contextual Chunk Headers
  6. Document Augmentation RAG
  7. Query Transformation (includes subquery + step-back prompting)
  8. Reranker (LLM-based)
  9. RSE (Relevant Segment Extraction)
  10. Contextual Compression
  11. Feedback Loop RAG
  12. Adaptive RAG
  13. Fusion RAG (BM25 + vectors)
  14. Graph RAG (concept traversal using networkx)
  15. Self-RAG (retrieval + decision via LLM)

add more if possible

Each notebook will include:

  • An explanation block (Markdown)
  • Inline commentary for each code block
  • Evaluation code (either LLM-assisted or metric-based)
  • Visualizations for similarity scores and retrieval steps (matplotlib/seaborn)

Educational Rationale

Retrieval-Augmented Generation is a cornerstone of modern LLM applications. By rebuilding these techniques from scratch:

  • Learners get a transparent view into retrieval pipelines.
  • They learn to decouple from opaque frameworks like LangChain or LlamaIndex.
  • It provides a foundation for deploying RAG in constrained environments.
  • Each variant highlights different trade-offs (speed, interpretability, relevance, adaptability), which are crucial to master in AI product engineering.

By using open-source embedding models and a fast, local vector DB like lancedb, the content aligns with privacy-first and cost-effective AI engineering practices.

Resources

@adithya-s-k adithya-s-k added the enhancement New feature or request label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant