# aniketpatel161161/rag_pipeline- architecture

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

- Interactive diagram: https://gitdiagram.com/aniketpatel161161/rag_pipeline-
- Repository: https://github.com/aniketpatel161161/rag_pipeline-

## Overview

This repository is a notebook-based RAG application. Its documented workflow loads text and PDF documents, chunks and embeds them into persistent vector storage, then embeds a user query, retrieves and ranks relevant chunks, and sends augmented context to an OpenAI model for an answer. The notebook is the only source file in the tree, so its distinct responsibilities share that path. Relationships are based on the README; notebook implementation details were not available for inspection.

Main entry points: [`RAG_PIPELINE.ipynb`](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb) (RAG Retriever)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Document Ingestion"]
  node_documents["TXT and PDF Files"]
  node_loaders["Document Loaders<br/>[RAG_PIPELINE.ipynb]"]
  node_chunking["Recursive Chunking<br/>[RAG_PIPELINE.ipynb]"]
end

subgraph group_indexing["Embedding and Storage"]
  node_embedding_manager["Embedding Manager<br/>[RAG_PIPELINE.ipynb]"]
  node_sentence_transformer["Sentence Transformer"]
  node_vector_manager["Vector Store Manager<br/>[RAG_PIPELINE.ipynb]"]
  node_chroma[("Persistent ChromaDB")]
end

subgraph group_retrieval["Retrieval and Context"]
  node_retriever["RAG Retriever<br/>[RAG_PIPELINE.ipynb]"]
end

subgraph group_generation["Answer Generation"]
  node_context_prompt["Context Prompt<br/>[RAG_PIPELINE.ipynb]"]
  node_openai_llm["OpenAI LLM"]
  node_answer["Generated Answer<br/>[RAG_PIPELINE.ipynb]"]
end

node_user(("User"))

node_documents -->|"loads"| node_loaders
node_loaders -->|"provides documents"| node_chunking
node_chunking -->|"provides chunks"| node_embedding_manager
node_embedding_manager -->|"generates vectors"| node_sentence_transformer
node_embedding_manager -->|"provides embeddings"| node_vector_manager
node_vector_manager -->|"persists chunks"| node_chroma
node_user -->|"submits query"| node_retriever
node_retriever -->|"embeds query"| node_embedding_manager
node_retriever -->|"searches vectors"| node_vector_manager
node_vector_manager -->|"searches collection"| node_chroma
node_retriever -->|"returns ranked chunks"| node_context_prompt
node_context_prompt -->|"sends augmented prompt"| node_openai_llm
node_openai_llm -->|"generates response"| node_answer
node_user -->|"asks question"| node_context_prompt

click node_loaders "https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb"
click node_chunking "https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb"
click node_embedding_manager "https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb"
click node_vector_manager "https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb"
click node_retriever "https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb"
click node_context_prompt "https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb"
click node_answer "https://github.com/aniketpatel161161/rag_pipeline-/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_documents,node_loaders,node_chunking,node_user toneBlue
class node_embedding_manager,node_sentence_transformer,node_vector_manager,node_chroma toneAmber
class node_retriever toneMint
class node_context_prompt,node_openai_llm,node_answer toneRose
```

## Components

### Document Ingestion

- **TXT and PDF Files**
- [Document Loaders](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb): `RAG_PIPELINE.ipynb`
- [Recursive Chunking](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb): `RAG_PIPELINE.ipynb`

### Embedding and Storage

- [Embedding Manager](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb): `RAG_PIPELINE.ipynb`
- **Sentence Transformer**
- [Vector Store Manager](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb): `RAG_PIPELINE.ipynb`
- **Persistent ChromaDB**

### Retrieval and Context

- [RAG Retriever](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb): `RAG_PIPELINE.ipynb`

### Answer Generation

- [Context Prompt](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb): `RAG_PIPELINE.ipynb`
- **OpenAI LLM**
- [Generated Answer](https://github.com/aniketpatel161161/rag_pipeline-/blob/main/RAG_PIPELINE.ipynb): `RAG_PIPELINE.ipynb`

### Other components

- **User**

## Connections

- TXT and PDF Files → Document Loaders: loads (evidence: `README.md`)
- Document Loaders → Recursive Chunking: provides documents (evidence: `README.md`)
- Recursive Chunking → Embedding Manager: provides chunks (evidence: `README.md`)
- Embedding Manager → Sentence Transformer: generates vectors (evidence: `README.md`)
- Embedding Manager → Vector Store Manager: provides embeddings (evidence: `README.md`)
- Vector Store Manager → Persistent ChromaDB: persists chunks (evidence: `README.md`)
- User → RAG Retriever: submits query (evidence: `README.md`)
- RAG Retriever → Embedding Manager: embeds query (evidence: `README.md`)
- RAG Retriever → Vector Store Manager: searches vectors (evidence: `README.md`)
- Vector Store Manager → Persistent ChromaDB: searches collection (evidence: `README.md`)
- RAG Retriever → Context Prompt: returns ranked chunks (evidence: `README.md`)
- Context Prompt → OpenAI LLM: sends augmented prompt (evidence: `README.md`)
- OpenAI LLM → Generated Answer: generates response (evidence: `README.md`)
- User → Context Prompt: asks question (evidence: `README.md`)
