# imanoop7/agentic-rag architecture

> Architecture diagram of the GitHub repository imanoop7/agentic-rag, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imanoop7/agentic-rag
- Repository: https://github.com/imanoop7/agentic-rag

## Overview

##### Project Type and Purpose
- Although the README is empty, the structure makes it clear that this project is an experimental suite of implementations focused on Retrieval-Augmented Generation (RAG).
- Notice the three separate folders: one for “autogen-RAG”, one for “crewai”, and one for “langgrapg-RAG”. Each folder hosts its own version of a RAG solution (with notebooks and Python scripts). This indicates that the project is likely comparing or demonstrating multiple approaches to RAG.

##### File Structure
- Top-level Files: Standard Git configuration files (.gitattributes, .gitignore) and a README.md.
- autogen-RAG:
- Includes a Jupyter Notebook (rag.ipynb) that likely demonstrates the autogen variant.
- A tmp/ directory with a nested database file (tmp/db/chroma.sqlite3) which is a signal that this approach uses a local database (Chroma for vector storage) for retrieval.
- crewai:
- Contains its own Jupyter Notebook (rag.ipynb), likely representing another variant or experimental approach.
- langgrapg-RAG:
- Contains a Python script (rag_assistant.py) plus another notebook (using-langgraph.ipynb), indicating an approach that likely leverages the LangGraph (or similar) framework for orchestrating language or graph-based interactions.

##### Main Components
a. Core RAG Implementations:
- Implementation variant (autogen-RAG, crewai, langgrapg-RAG) as distinct modules/components.
b. Data Storage:
- For autogen-RAG, include a “Database” component which is represented by the Chroma vector store (shown by the chroma.sqlite3 file).
c. User Interface and Execution Environment:
- Jupyter Notebooks and Python scripts as execution/UI components where the RAG workflows are implemented.
d. Data Flow and Processing:
- How input data (likely user prompts or documents) flows through a retrieval step (querying the vector DB or other data store) and then to a generation module (using language models to assemble an answer).
e. External Dependencies:
- Where applicable, annotate which parts use external APIs, libraries, or frameworks (e.g., language model APIs, vector embedding processes, LangGraph if that’s part of the tech stack).

##### Final Assembly
- Branch out into three modules (autogen-RAG, crewai, langgrapg-RAG) with their internal components as described.
- For autogen-RAG, indicate how the notebook triggers a retrieval module that accesses the Chroma DB, then sends data to a language model for generation.
- Similarly for crewai and langgrapg-RAG, map the unique data flow.
- Optionally, annotate differences (for example, if one module uses a different retrieval method) to make the comparative architecture clear.

- Variant of the RAG implementation.
- Out internal components (UI/Notebook, retrieval engine, data store, generation engine).

This detailed approach will help you capture every nuance of the project’s architecture for the principal software engineer. Happy diagramming!

## Diagram (Mermaid)

```mermaid
graph TD
    Overall["Overall RAG System"]:::system

    %% autogen-RAG subgraph
    subgraph "autogen-RAG"
        A1["User Input"]:::input
        A2["autogen-RAG Notebook"]:::notebook
        A3["Retrieval Module"]:::module
        A4["Local Vector DB (Chroma)"]:::database
        A5["Generation Engine"]:::engine
        A6["Output Render"]:::output
        A1 --> A2
        A2 --> A3
        A3 --> A4
        A3 --> A5
        A5 --> A6
    end

    %% crewai subgraph
    subgraph "crewai"
        C1["User Input"]:::input
        C2["crewai Notebook"]:::notebook
        C3["Processing & Generation"]:::module
        C4["Output Render"]:::output
        C1 --> C2
        C2 --> C3
        C3 --> C4
    end

    %% langgrapg-RAG subgraph
    subgraph "langgrapg-RAG"
        L1["User Input"]:::input
        L2a["rag_assistant.py"]:::script
        L2b["using-langgraph.ipynb"]:::notebook
        L3["LangGraph Orchestrator"]:::module
        L4["Generation Engine"]:::engine
        L5["Output Render"]:::output
        L1 --> L2a
        L2a --> L2b
        L2b --> L3
        L3 --> L4
        L4 --> L5
    end

    %% Overall connections to each variant
    Overall --> A1
    Overall --> C1
    Overall --> L1

    %% Click Events (do not show paths to user)
    click A2 "https://github.com/imanoop7/agentic-rag/blob/main/autogen-RAG/rag.ipynb"
    click A4 "https://github.com/imanoop7/agentic-rag/blob/main/autogen-RAG/tmp/db/chroma.sqlite3"
    click C2 "https://github.com/imanoop7/agentic-rag/blob/main/crewai/rag.ipynb"
    click L2a "https://github.com/imanoop7/agentic-rag/blob/main/langgrapg-RAG/rag_assistant.py"
    click L2b "https://github.com/imanoop7/agentic-rag/blob/main/langgrapg-RAG/using-langgraph.ipynb"

    %% Styles
    classDef system fill:#d1e8ff,stroke:#1f78b4,stroke-width:2px;
    classDef input fill:#fff5ba,stroke:#a67c00,stroke-width:2px;
    classDef notebook fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef script fill:#e1bee7,stroke:#6a1b9a,stroke-width:2px;
    classDef module fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef engine fill:#ffe0b2,stroke:#e65100,stroke-width:2px;
    classDef database fill:#ffcdd2,stroke:#c62828,stroke-width:2px;
    classDef output fill:#dcedc8,stroke:#558b2f,stroke-width:2px;
```
