# thasvithu/educational-rag-research architecture

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

- Interactive diagram: https://gitdiagram.com/thasvithu/educational-rag-research
- Repository: https://github.com/thasvithu/educational-rag-research

## Overview

This repository is an educational RAG research project, not a deployed RAG application. Its implemented workflow explores source PDFs, cleans and prepares a traceable corpus, validates its integrity, and provides notebooks comparing five chunking strategies plus an embedding introduction. The README also describes RAG and evaluation technologies, but marks those work-plan stages as upcoming; they are therefore not represented as implemented runtime components. Edges reflect excerpts or README statements, not inspection of the notebooks' internal code.

Main entry points: [`02_data_cleaning/clean_pdfs.py`](https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/clean_pdfs.py) (PDF Cleaner), [`02_data_cleaning/prepare_texts.py`](https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/prepare_texts.py) (Text Preparation), [`02_data_cleaning/validate_corpus.py`](https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/validate_corpus.py) (Corpus Validator), [`03_chuncking_implementation/01_fixed_size_chunking.ipynb`](https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/01_fixed_size_chunking.ipynb) (Fixed-Size)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["PDF Ingestion"]
  node_pdf_explorer["PDF Explorer<br/>[explore_pdfs.py]"]
end

subgraph group_corpus["Corpus Preparation"]
  node_pdf_cleaner["PDF Cleaner<br/>[clean_pdfs.py]"]
  node_text_preparer["Text Preparation<br/>[prepare_texts.py]"]
  node_corpus_validator["Corpus Validator<br/>[validate_corpus.py]"]
  node_prepared_corpus["Prepared Corpus"]
end

subgraph group_experiments["Chunking Experiments"]
  node_fixed_chunking["Fixed-Size"]
  node_sliding_chunking["Sliding Window"]
  node_structure_chunking["Structure-Aware"]
  node_semantic_chunking["Semantic Chunking"]
  node_late_chunking["Late Chunking"]
end

subgraph group_embedding["Embedding Study"]
  node_embedding_study["Embedding Introduction"]
end

node_researcher(("Researcher"))
node_source_pdfs["Source PDFs"]

node_researcher -->|"collects"| node_source_pdfs
node_researcher -->|"runs"| node_pdf_explorer
node_source_pdfs -->|"loads and analyzes"| node_pdf_explorer
node_researcher -.->|"runs"| node_pdf_cleaner
node_pdf_cleaner -->|"builds"| node_prepared_corpus
node_pdf_cleaner -->|"precedes"| node_text_preparer
node_text_preparer -->|"prepares"| node_prepared_corpus
node_text_preparer -->|"imports helpers"| node_pdf_cleaner
node_researcher -.->|"runs"| node_corpus_validator
node_corpus_validator -->|"uses helpers"| node_pdf_cleaner
node_prepared_corpus -->|"feeds experiments"| node_fixed_chunking
node_prepared_corpus -->|"feeds experiments"| node_sliding_chunking
node_prepared_corpus -->|"feeds experiments"| node_structure_chunking
node_prepared_corpus -->|"feeds experiments"| node_semantic_chunking
node_prepared_corpus -->|"feeds experiments"| node_late_chunking
node_fixed_chunking -.->|"chunks become vectors"| node_embedding_study

click node_pdf_explorer "https://github.com/thasvithu/educational-rag-research/blob/main/01_Load_pdfs/explore_pdfs.py"
click node_pdf_cleaner "https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/clean_pdfs.py"
click node_text_preparer "https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/prepare_texts.py"
click node_corpus_validator "https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/validate_corpus.py"
click node_fixed_chunking "https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/01_fixed_size_chunking.ipynb"
click node_sliding_chunking "https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/02_sliding_window_chunking.ipynb"
click node_structure_chunking "https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/03_structure_aware_chunking.ipynb"
click node_semantic_chunking "https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/04_semantic_chunking.ipynb"
click node_late_chunking "https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/05_late_chunking.ipynb"
click node_embedding_study "https://github.com/thasvithu/educational-rag-research/blob/main/04_embedding/01_what_is_Embedding.ipynb"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pdf_explorer toneBlue
class node_pdf_cleaner,node_text_preparer,node_corpus_validator,node_prepared_corpus toneAmber
class node_fixed_chunking,node_sliding_chunking,node_structure_chunking,node_semantic_chunking,node_late_chunking toneMint
class node_embedding_study toneRose
class node_researcher,node_source_pdfs toneIndigo
```

## Components

### PDF Ingestion

- [PDF Explorer](https://github.com/thasvithu/educational-rag-research/blob/main/01_Load_pdfs/explore_pdfs.py): `01_Load_pdfs/explore_pdfs.py`

### Corpus Preparation

- [PDF Cleaner](https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/clean_pdfs.py): `02_data_cleaning/clean_pdfs.py`
- [Text Preparation](https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/prepare_texts.py): `02_data_cleaning/prepare_texts.py`
- [Corpus Validator](https://github.com/thasvithu/educational-rag-research/blob/main/02_data_cleaning/validate_corpus.py): `02_data_cleaning/validate_corpus.py`
- **Prepared Corpus**

### Chunking Experiments

- [Fixed-Size](https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/01_fixed_size_chunking.ipynb): `03_chuncking_implementation/01_fixed_size_chunking.ipynb`
- [Sliding Window](https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/02_sliding_window_chunking.ipynb): `03_chuncking_implementation/02_sliding_window_chunking.ipynb`
- [Structure-Aware](https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/03_structure_aware_chunking.ipynb): `03_chuncking_implementation/03_structure_aware_chunking.ipynb`
- [Semantic Chunking](https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/04_semantic_chunking.ipynb): `03_chuncking_implementation/04_semantic_chunking.ipynb`
- [Late Chunking](https://github.com/thasvithu/educational-rag-research/blob/main/03_chuncking_implementation/05_late_chunking.ipynb): `03_chuncking_implementation/05_late_chunking.ipynb`

### Embedding Study

- [Embedding Introduction](https://github.com/thasvithu/educational-rag-research/blob/main/04_embedding/01_what_is_Embedding.ipynb): `04_embedding/01_what_is_Embedding.ipynb`

### Other components

- **Researcher**
- **Source PDFs**

## Connections

- Researcher → Source PDFs: collects (evidence: `README.md`)
- Researcher → PDF Explorer: runs (evidence: `README.md`)
- Source PDFs → PDF Explorer: loads and analyzes (evidence: `README.md`)
- Researcher → PDF Cleaner: runs
- PDF Cleaner → Prepared Corpus: builds (evidence: `02_data_cleaning/clean_pdfs.py`)
- PDF Cleaner → Text Preparation: precedes (evidence: `02_data_cleaning/prepare_texts.py`)
- Text Preparation → Prepared Corpus: prepares (evidence: `02_data_cleaning/prepare_texts.py`)
- Text Preparation → PDF Cleaner: imports helpers (evidence: `02_data_cleaning/prepare_texts.py`)
- Researcher → Corpus Validator: runs
- Corpus Validator → PDF Cleaner: uses helpers (evidence: `02_data_cleaning/validate_corpus.py`)
- Prepared Corpus → Fixed-Size: feeds experiments (evidence: `README.md`)
- Prepared Corpus → Sliding Window: feeds experiments (evidence: `README.md`)
- Prepared Corpus → Structure-Aware: feeds experiments (evidence: `README.md`)
- Prepared Corpus → Semantic Chunking: feeds experiments (evidence: `README.md`)
- Prepared Corpus → Late Chunking: feeds experiments (evidence: `README.md`)
- Fixed-Size → Embedding Introduction: chunks become vectors
