# kalyanks-nlp/rag-zero-to-hero-guide architecture

> Architecture diagram of the GitHub repository kalyanks-nlp/rag-zero-to-hero-guide, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kalyanks-nlp/rag-zero-to-hero-guide
- Repository: https://github.com/kalyanks-nlp/rag-zero-to-hero-guide

## Overview

Based on our analysis of the file tree and the comprehensive README, this repository is designed as an educational resource to guide users “From Zero to Hero” on Retrieval-Augmented Generation (RAG). It provides both foundational knowledge (in the “RAG Basics” folder with multiple markdown files and interactive notebooks) and an evaluation perspective (in the “RAG Evaluation” folder) on RAG systems. The repository is essentially a structured set of documentation, example notebooks, and supplementary resources (images and term glossaries) aimed at teaching users the principles and practical implementations of RAG.

##### Main Components
- Documentation & Guides Module: Includes all the educational materials (e.g., “What is RAG?”, “Why RAG?”, “How does RAG work?”, etc.) inside the RAG Basics folder.
- Interactive Notebooks / Code Examples: These are Jupyter notebooks demonstrating different implementations (e.g., “RAG from Scratch”, “RAG with LangChain”, “AgenticRAG_with_CrewAI.ipynb”, etc.).
- Evaluation Module: Contains notebooks and markdown documentation focused on evaluating RAG (metrics, hallucinations, retriever/generator evaluation, etc.).
- Supplementary Assets: Support files such as images and additional guides (for example, in the “RAG Basics/images” and “RAG Evaluation/images” directories).

##### How They Relate and Interact
- The “RAG Basics” module provides the core principles, definitions, and step-by-step guides. Think of it as the knowledge-base.
- The interactive notebooks serve as practical demonstrations of the theoretical concepts in RAG Basics by walking through code and real-world examples.
- The “RAG Evaluation” module supplements the basics by teaching users how to measure performance and potential pitfalls in RAG systems.
- The roadmap, glossary, and developers’ stack files tie these modules together, guiding the learner from introduction to advanced topics such as evaluation and deployment.
- Directional flows: for example, a learner might start with “What is RAG?”, then move to “How does RAG work?”, then try out one of the notebooks (i.e., hands-on demo), and finally learn how to evaluate a system via the “RAG Evaluation” notebooks and docs.

##### Architectural Principles and Patterns
- Separation of Concerns: Clearly separate content for basic theory (RAG Basics) from practical evaluation (RAG Evaluation).
- Layering: Think of the architecture in layers – the foundational documentation, then code examples (which interact with various RAG libraries and frameworks, as mentioned in the README), and then evaluation layers.
- Extensibility: The various notebook implementations (e.g., using LangChain, CrewAI) show that the system is designed to be extended easily to cover different libraries and approaches.

##### Relevant Technologies & Frameworks
- Although this repository is documentation-focused, it makes references to multiple frameworks and libraries (LangChain, CrewAI for Agentic RAG, etc.). Include these as peripheral components or as “external services” that integrate with the code examples.
- That the repository is part of a larger ecosystem that includes frameworks for data extraction, vector databases, chunking, reranking, and more – as detailed in the “RAG Toolkit” section of the README.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Educational Flow Subgraph
    subgraph "Educational Flow"
        A["Documentation/Guides (RAG Basics)"]:::doc
        A1["What is RAG?"]:::doc
        A2["Why RAG?"]:::doc
        A3["How does RAG work?"]:::doc
        B["Interactive Notebooks/Code Examples"]:::notebook
        E["External Libraries/Frameworks"]:::external
        C["Evaluation Metrics & Analysis (RAG Evaluation)"]:::eval
    end

    %% Supplementary Assets Subgraph
    subgraph "Supplementary Assets"
        D1["Basics Images"]:::assets
        D2["Evaluation Images"]:::assets
    end

    %% Connections within Educational Flow
    A1 -->|"contributes_to"| A
    A2 -->|"contributes_to"| A
    A3 -->|"contributes_to"| A
    A -->|"theory-to-practice"| B
    B -->|"leads_to"| C
    B -->|"integrates_with"| E
    E -->|"supports"| C

    %% Connections to Supplementary Assets
    A -->|"provides"| D1
    C -->|"includes"| D2

    %% Click Events for Component Mapping
    click A "https://github.com/kalyanks-nlp/rag-zero-to-hero-guide/tree/main/RAG Basics"
    click B "https://github.com/kalyanks-nlp/rag-zero-to-hero-guide/tree/main/RAG Basics/notebooks"
    click C "https://github.com/kalyanks-nlp/rag-zero-to-hero-guide/tree/main/RAG Evaluation"
    click D1 "https://github.com/kalyanks-nlp/rag-zero-to-hero-guide/tree/main/RAG Basics/images"
    click D2 "https://github.com/kalyanks-nlp/rag-zero-to-hero-guide/tree/main/RAG Evaluation/images"

    %% Styles
    classDef doc fill:#cce5ff,stroke:#333,stroke-width:2px;
    classDef notebook fill:#d4edda,stroke:#333,stroke-width:2px;
    classDef eval fill:#fff3cd,stroke:#333,stroke-width:2px;
    classDef assets fill:#f8d7da,stroke:#333,stroke-width:2px;
    classDef external fill:#d1ecf1,stroke:#333,stroke-width:2px;
```
