# harsh-singh-2023/rag_pipeline_for_pdf architecture

> Architecture diagram of the GitHub repository harsh-singh-2023/rag_pipeline_for_pdf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harsh-singh-2023/rag_pipeline_for_pdf
- Repository: https://github.com/harsh-singh-2023/rag_pipeline_for_pdf

## Overview

This is a notebook-based PDF RAG chatbot. Users add PDFs, ingest and index their contents, then ask questions in an interactive chat; answers are grounded in retrieved passages and include source citations. The graph follows the README’s documented pipeline and capabilities. The notebook is listed in the tree but its contents were not sampled, so implementation-level relationships are supported by the README rather than inspected notebook code.

Main entry points: [`rag_pipeline.ipynb`](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb) (Context retrieval), [`data/pdf/.gitkeep`](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/data/pdf/.gitkeep) (PDF files)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Document ingestion"]
  node_loader["PDF loader<br/>[rag_pipeline.ipynb]"]
  node_chunker["Text chunker<br/>[rag_pipeline.ipynb]"]
end

subgraph group_indexing["Vector indexing"]
  node_embedder["Local embeddings<br/>[rag_pipeline.ipynb]"]
  node_store[("Chroma vector store<br/>[rag_pipeline.ipynb]")]
end

subgraph group_answering["Question answering"]
  node_notebook["RAG chat notebook<br/>[rag_pipeline.ipynb]"]
  node_retrieval["Context retrieval<br/>[rag_pipeline.ipynb]"]
  node_prompt["Grounded prompt<br/>[rag_pipeline.ipynb]"]
  node_answer["Grounded answer<br/>[rag_pipeline.ipynb]"]
end

node_user(("User"))
node_pdfs["PDF files<br/>[.gitkeep]"]
node_groq["Groq LLM API"]

node_user -->|"asks questions"| node_notebook
node_pdfs -->|"loads pages"| node_loader
node_loader -->|"splits pages"| node_chunker
node_chunker -->|"embeds chunks"| node_embedder
node_embedder -->|"upserts vectors"| node_store
node_notebook -->|"embeds query"| node_embedder
node_notebook -->|"retrieves context"| node_retrieval
node_retrieval -->|"searches vectors"| node_store
node_store -->|"returns matches"| node_retrieval
node_retrieval -->|"supplies context"| node_prompt
node_prompt -->|"requests answer"| node_groq
node_groq -->|"generates response"| node_answer
node_retrieval -->|"provides citations"| node_answer
node_answer -->|"shows response"| node_user

click node_pdfs "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/data/pdf/.gitkeep"
click node_notebook "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb"
click node_loader "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb"
click node_chunker "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb"
click node_embedder "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb"
click node_store "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb"
click node_retrieval "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb"
click node_prompt "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb"
click node_answer "https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.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_loader,node_chunker,node_user toneBlue
class node_embedder,node_store toneAmber
class node_notebook,node_retrieval,node_prompt,node_answer,node_groq toneMint
class node_pdfs toneTeal
```

## Components

### Document ingestion

- [PDF loader](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`
- [Text chunker](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`

### Vector indexing

- [Local embeddings](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`
- [Chroma vector store](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`

### Question answering

- [RAG chat notebook](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`
- [Context retrieval](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`
- [Grounded prompt](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`
- [Grounded answer](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/rag_pipeline.ipynb): `rag_pipeline.ipynb`

### Other components

- **User**
- [PDF files](https://github.com/harsh-singh-2023/rag_pipeline_for_pdf/blob/main/data/pdf/.gitkeep): `data/pdf/.gitkeep`
- **Groq LLM API**

## Connections

- User → RAG chat notebook: asks questions (evidence: `README.md`)
- PDF files → PDF loader: loads pages (evidence: `README.md`)
- PDF loader → Text chunker: splits pages (evidence: `README.md`)
- Text chunker → Local embeddings: embeds chunks (evidence: `README.md`)
- Local embeddings → Chroma vector store: upserts vectors (evidence: `README.md`)
- RAG chat notebook → Local embeddings: embeds query (evidence: `README.md`)
- RAG chat notebook → Context retrieval: retrieves context (evidence: `README.md`)
- Context retrieval → Chroma vector store: searches vectors (evidence: `README.md`)
- Chroma vector store → Context retrieval: returns matches (evidence: `README.md`)
- Context retrieval → Grounded prompt: supplies context (evidence: `README.md`)
- Grounded prompt → Groq LLM API: requests answer (evidence: `README.md`)
- Groq LLM API → Grounded answer: generates response (evidence: `README.md`)
- Context retrieval → Grounded answer: provides citations (evidence: `README.md`)
- Grounded answer → User: shows response (evidence: `README.md`)
