# ys-pundir/sindhu-rag architecture

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

- Interactive diagram: https://gitdiagram.com/ys-pundir/sindhu-rag
- Repository: https://github.com/ys-pundir/sindhu-rag

## Overview

Sindhu-RAG is a historical-question-answering RAG application. Users ask through the Streamlit chat; it retrieves report chunks from Chroma, builds a prompt with conversation context, and requests a grounded answer from Groq. The README also describes a PDF-to-chunks-and-vector-store knowledge workflow and prompt/config experimentation. The ingestion path is documented and represented in notebooks, but its runtime wiring was not sampled; the graph omits uncertain implementation details. The sampled pipeline supports the retrieval, prompt, persistence, and generation links shown.

Main entry points: [`src/streamlit_app.py`](https://github.com/ys-pundir/sindhu-rag/blob/main/src/streamlit_app.py) (Streamlit chat), [`src/rag_pipelines.py`](https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py) (Context prompting), [`Notebooks/ingest_chunking.ipynb`](https://github.com/ys-pundir/sindhu-rag/blob/main/Notebooks/ingest_chunking.ipynb) (Chunking workflow), [`Data/processed/sindhu_report_chunks.json`](https://github.com/ys-pundir/sindhu-rag/blob/main/Data/processed/sindhu_report_chunks.json) (Processed chunks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["User interaction"]
  node_app["Streamlit chat<br/>[streamlit_app.py]"]
end

subgraph group_rag["RAG runtime"]
  node_pipeline["RAG pipeline<br/>[rag_pipelines.py]"]
  node_retrieval["Chunk retrieval<br/>[rag_pipelines.py]"]
  node_prompting["Context prompting<br/>[rag_pipelines.py]"]
  node_generation["Answer generation<br/>[rag_pipelines.py]"]
end

subgraph group_knowledge["Knowledge preparation"]
  node_pdf["Historical report<br/>[report.pdf]"]
  node_chunking["Chunking workflow"]
  node_chunks["Processed chunks"]
  node_embedding["Embedding workflow"]
end

subgraph group_state["Configuration and state"]
  node_chroma[("Chroma vector store")]
  node_config["Pipeline config<br/>[v2_config.json]"]
  node_prompts["Versioned prompts"]
  node_history[("Conversation history")]
end

node_user(("Questioner"))
node_groq{{"Groq chat API"}}

node_user -->|"asks"| node_app
node_app -->|"requests chunks"| node_retrieval
node_app -->|"builds message"| node_prompting
node_app -->|"requests answer"| node_generation
node_retrieval -->|"searches"| node_chroma
node_prompting -->|"reads history"| node_history
node_prompting -->|"uses settings"| node_config
node_config -->|"selects prompt"| node_prompts
node_generation -->|"sends messages"| node_groq
node_groq -->|"returns answer"| node_generation
node_pdf -.->|"chunks report"| node_chunking
node_chunking -.->|"produces chunks"| node_chunks
node_chunks -.->|"embeds chunks"| node_embedding
node_embedding -.->|"stores vectors"| node_chroma

click node_app "https://github.com/ys-pundir/sindhu-rag/blob/main/src/streamlit_app.py"
click node_pipeline "https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py"
click node_retrieval "https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py"
click node_prompting "https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py"
click node_generation "https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py"
click node_pdf "https://github.com/ys-pundir/sindhu-rag/blob/main/Data/raw/report.pdf"
click node_chunking "https://github.com/ys-pundir/sindhu-rag/blob/main/Notebooks/ingest_chunking.ipynb"
click node_chunks "https://github.com/ys-pundir/sindhu-rag/blob/main/Data/processed/sindhu_report_chunks.json"
click node_embedding "https://github.com/ys-pundir/sindhu-rag/blob/main/Notebooks/vector_storage.ipynb"
click node_chroma "https://github.com/ys-pundir/sindhu-rag/tree/main/Storage/sindhu_db"
click node_config "https://github.com/ys-pundir/sindhu-rag/blob/main/config/v2_config.json"
click node_prompts "https://github.com/ys-pundir/sindhu-rag/tree/main/prompts/hind_agent"
click node_history "https://github.com/ys-pundir/sindhu-rag/blob/main/Storage/conversation/conversation_history.json"

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_app toneBlue
class node_pipeline,node_retrieval,node_prompting,node_generation toneAmber
class node_pdf,node_chunking,node_chunks,node_embedding,node_groq toneMint
class node_chroma,node_config,node_prompts,node_history toneRose
class node_user toneIndigo
```

## Components

### User interaction

- [Streamlit chat](https://github.com/ys-pundir/sindhu-rag/blob/main/src/streamlit_app.py): `src/streamlit_app.py`

### RAG runtime

- [RAG pipeline](https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py): `src/rag_pipelines.py`
- [Chunk retrieval](https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py): `src/rag_pipelines.py`
- [Context prompting](https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py): `src/rag_pipelines.py`
- [Answer generation](https://github.com/ys-pundir/sindhu-rag/blob/main/src/rag_pipelines.py): `src/rag_pipelines.py`

### Knowledge preparation

- [Historical report](https://github.com/ys-pundir/sindhu-rag/blob/main/Data/raw/report.pdf): `Data/raw/report.pdf`
- [Chunking workflow](https://github.com/ys-pundir/sindhu-rag/blob/main/Notebooks/ingest_chunking.ipynb): `Notebooks/ingest_chunking.ipynb`
- [Processed chunks](https://github.com/ys-pundir/sindhu-rag/blob/main/Data/processed/sindhu_report_chunks.json): `Data/processed/sindhu_report_chunks.json`
- [Embedding workflow](https://github.com/ys-pundir/sindhu-rag/blob/main/Notebooks/vector_storage.ipynb): `Notebooks/vector_storage.ipynb`

### Configuration and state

- [Chroma vector store](https://github.com/ys-pundir/sindhu-rag/tree/main/Storage/sindhu_db): `Storage/sindhu_db`
- [Pipeline config](https://github.com/ys-pundir/sindhu-rag/blob/main/config/v2_config.json): `config/v2_config.json`
- [Versioned prompts](https://github.com/ys-pundir/sindhu-rag/tree/main/prompts/hind_agent): `prompts/hind_agent`
- [Conversation history](https://github.com/ys-pundir/sindhu-rag/blob/main/Storage/conversation/conversation_history.json): `Storage/conversation/conversation_history.json`

### Other components

- **Questioner**
- **Groq chat API**

## Connections

- Questioner → Streamlit chat: asks
- Streamlit chat → Chunk retrieval: requests chunks
- Streamlit chat → Context prompting: builds message
- Streamlit chat → Answer generation: requests answer
- Chunk retrieval → Chroma vector store: searches
- Context prompting → Conversation history: reads history
- Context prompting → Pipeline config: uses settings
- Pipeline config → Versioned prompts: selects prompt
- Answer generation → Groq chat API: sends messages
- Groq chat API → Answer generation: returns answer
- Historical report → Chunking workflow: chunks report
- Chunking workflow → Processed chunks: produces chunks
- Processed chunks → Embedding workflow: embeds chunks
- Embedding workflow → Chroma vector store: stores vectors
