# shahzaibkaramat67-coder/rag_chroma_agent_v2 architecture

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

- Interactive diagram: https://gitdiagram.com/shahzaibkaramat67-coder/rag_chroma_agent_v2
- Repository: https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2

## Overview

This repository implements a document question-answering assistant: a setup script indexes a PDF into a persistent Chroma store, and an interactive command-line loop retrieves relevant passages and asks Gemini to answer using that context. The graph reflects only the two sampled source files; the stored Agent directory is runtime data, not a separate source component. No README was provided, so capabilities beyond the sampled workflow cannot be confirmed.

Main entry points: [`main.py`](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py) (Interactive assistant), [`createDB.py`](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/createDB.py) (PDF indexing), [`Agent`](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/tree/main/Agent) (Chroma index), [`document/FYP_Blog_Site_Final.pdf`](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/document/FYP_Blog_Site_Final.pdf) (Source PDF)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Document indexing"]
  node_indexer["PDF indexing<br/>[createDB.py]"]
  node_chunker["Text splitting<br/>[createDB.py]"]
  node_embed_index["Index embeddings<br/>[createDB.py]"]
end

subgraph group_qa["Question answering"]
  node_cli["Interactive assistant<br/>[main.py]"]
  node_retrieval["Passage retrieval<br/>[main.py]"]
  node_prompt["Context prompt<br/>[main.py]"]
  node_generation["Gemini response<br/>[main.py]"]
end

subgraph group_services["Models and storage"]
  node_store[("Chroma index")]
  node_query_embed["Query embeddings<br/>[main.py]"]
  node_gemini{{"Google Gemini"}}
end

node_operator(("CLI user"))
node_pdf["Source PDF"]

node_operator -->|"asks question"| node_cli
node_pdf -->|"loads pages"| node_indexer
node_indexer -->|"splits pages"| node_chunker
node_chunker -->|"embeds chunks"| node_embed_index
node_embed_index -->|"persists vectors"| node_store
node_cli -->|"submits query"| node_retrieval
node_retrieval -->|"embeds query"| node_query_embed
node_retrieval -->|"searches passages"| node_store
node_retrieval -->|"provides passages"| node_prompt
node_cli -->|"provides question"| node_prompt
node_cli -->|"invokes prompt"| node_generation
node_generation -->|"requests answer"| node_gemini
node_generation -->|"prints response"| node_cli

click node_pdf "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/document/FYP_Blog_Site_Final.pdf"
click node_indexer "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/createDB.py"
click node_chunker "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/createDB.py"
click node_embed_index "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/createDB.py"
click node_store "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/tree/main/Agent"
click node_cli "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py"
click node_retrieval "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py"
click node_prompt "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py"
click node_generation "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py"
click node_query_embed "https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py"

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_indexer,node_chunker,node_embed_index,node_operator toneBlue
class node_cli,node_retrieval,node_prompt,node_generation toneAmber
class node_store,node_query_embed,node_gemini toneMint
class node_pdf toneTeal
```

## Components

### Document indexing

- [PDF indexing](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/createDB.py): `createDB.py`
- [Text splitting](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/createDB.py): `createDB.py`
- [Index embeddings](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/createDB.py): `createDB.py`

### Question answering

- [Interactive assistant](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py): `main.py`
- [Passage retrieval](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py): `main.py`
- [Context prompt](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py): `main.py`
- [Gemini response](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py): `main.py`

### Models and storage

- [Chroma index](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/tree/main/Agent): `Agent`
- [Query embeddings](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/main.py): `main.py`
- **Google Gemini**

### Other components

- **CLI user**
- [Source PDF](https://github.com/shahzaibkaramat67-coder/rag_chroma_agent_v2/blob/main/document/FYP_Blog_Site_Final.pdf): `document/FYP_Blog_Site_Final.pdf`

## Connections

- CLI user → Interactive assistant: asks question (evidence: `main.py`)
- Source PDF → PDF indexing: loads pages (evidence: `createDB.py`)
- PDF indexing → Text splitting: splits pages (evidence: `createDB.py`)
- Text splitting → Index embeddings: embeds chunks (evidence: `createDB.py`)
- Index embeddings → Chroma index: persists vectors (evidence: `createDB.py`)
- Interactive assistant → Passage retrieval: submits query (evidence: `main.py`)
- Passage retrieval → Query embeddings: embeds query (evidence: `main.py`)
- Passage retrieval → Chroma index: searches passages (evidence: `main.py`)
- Passage retrieval → Context prompt: provides passages (evidence: `main.py`)
- Interactive assistant → Context prompt: provides question (evidence: `main.py`)
- Interactive assistant → Gemini response: invokes prompt (evidence: `main.py`)
- Gemini response → Google Gemini: requests answer (evidence: `main.py`)
- Gemini response → Interactive assistant: prints response (evidence: `main.py`)
