# abhavbhanot/bhagwan-gita-summarization-and-verse-retrieval-rag- architecture

> Architecture diagram of the GitHub repository abhavbhanot/bhagwan-gita-summarization-and-verse-retrieval-rag-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abhavbhanot/bhagwan-gita-summarization-and-verse-retrieval-rag-
- Repository: https://github.com/abhavbhanot/bhagwan-gita-summarization-and-verse-retrieval-rag-

## Overview

##### Component Breakdown

a. Data Sources (Top Layer)
- Two main branches: Bhagavad Gita and Patanjali Yoga Sutras
- Sub-components for different data types (verses, concepts, word meanings)

b. Data Ingestion Layer
- Data normalization flow
- Data cleaning and preprocessing steps
- Demonstrate schema unification process

c. Processing Pipeline (Core)
- TF-IDF Vectorization component
- Retrieval Engine with cosine similarity
- T5 Model Integration
- Query Processing Unit

d. Generation Layer
- T5-base model component
- Summary generation pipeline
- Context integration module

e. Output Layer
- JSON response formatter
- Performance metrics collector
- User interface connector

##### Specific Elements

a. Input Processing:
- User Query → Query Processor → Vector Space

b. Retrieval Flow:
- Vector Space → Cosine Similarity → Ranked Results

c. Generation Pipeline:
- Retrieved Verses → T5 Model → Generated Summary

d. Evaluation System:
- Output → Metrics Collector → Performance Dashboard

##### Technical Details to Highlight
- T5-base model architecture
- Where TF-IDF vectorization occurs
- Points where cosine similarity is calculated
- Evaluation metric weightings

##### Performance Monitoring
- Monitoring points for the 8 evaluation criteria
- Cost efficiency metrics
- Error handling pathways

##### Integration Points
- Where future improvements can be integrated
- Extensibility points for additional languages
- Where new sacred texts can be added

Key Visualization Guidelines:
- Use standard UML notation where appropriate
- Implement a clear visual hierarchy
- System boundaries
- External dependencies
- Critical paths
- Failure recovery points

## Diagram (Mermaid)

```mermaid
graph LR
    %% Styles
    classDef datasource fill:#3498db,stroke:#2980b9,color:white
    classDef processing fill:#2ecc71,stroke:#27ae60,color:white
    classDef core fill:#e67e22,stroke:#d35400,color:white
    classDef output fill:#9b59b6,stroke:#8e44ad,color:white
    classDef metrics fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Data Sources
    subgraph DataSources["Data Sources"]
        BG["Bhagavad Gita CSVs"]:::datasource
        PYS["Patanjali Yoga<br/>Sutras CSVs"]:::datasource
    end

    %% Processing Pipeline
    subgraph Processing["Processing Pipeline"]
        DI["Data Ingestion"]:::processing
        PP["Preprocessing"]:::processing
    end

    %% Core Engine
    subgraph CoreEngine["Core Engine"]
        RE["Retrieval Engine<br/>(TF-IDF & Cosine)"]:::core
        GL["Generation Layer<br/>(T5-base model)"]:::core
    end

    %% Output Layer
    subgraph Output["Output Layer"]
        JSON["JSON Response"]:::output
        EM["Evaluation<br/>Metrics"]:::output
    end

    %% Metrics Dashboard
    subgraph Metrics["Performance Metrics"]
        M1["Accuracy: 4.0/5.0"]:::metrics
        M2["Relevance: 4.0/5.0"]:::metrics
        M3["Quality: 4.5/5.0"]:::metrics
    end

    %% Connections
    BG --> DI
    PYS --> DI
    DI --> PP
    PP --> RE
    RE --> GL
    GL --> JSON
    GL --> EM

    %% Click Events
    click BG "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/dataset/Bhagwad_Gita_Verses_Concepts.csv"
    click PYS "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/dataset/Patanjali_Yoga_Sutras_Verses_English.csv"
    click DI "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/code/bhagwad-gita-translation-and-summarization-rag.ipynb"
    click PP "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/code/bhagwad-gita-translation-and-summarization-rag.ipynb"
    click RE "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/code/bhagwad-gita-translation-and-summarization-rag.ipynb"
    click GL "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/code/bhagwad-gita-translation-and-summarization-rag.ipynb"
    click JSON "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/code/bhagwad-gita-translation-and-summarization-rag.ipynb"
    click EM "https://github.com/AbhavBhanot/Bhagwan-Gita-Summarization-and-Verse-Retrieval-RAG-/blob/main/code/bhagwad-gita-translation-and-summarization-rag.ipynb"
```
