# kritikaagrahari057-cmyk/raju-chai-wala architecture

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

- Interactive diagram: https://gitdiagram.com/kritikaagrahari057-cmyk/raju-chai-wala
- Repository: https://github.com/kritikaagrahari057-cmyk/raju-chai-wala

## Overview

Raju Tea Shop is a Streamlit question-answering assistant grounded in shop information, with an option to use uploaded documents. Users select a knowledge source, ask a question, and receive an answer generated from retrieved document chunks. The default index is loaded or built from the shop text; uploaded files are parsed and indexed for the session. The RAG pipeline coordinates retrieval and generation, using local HuggingFace embeddings, FAISS, and Groq. The map reflects the excerpts and README; unsampled UI behavior and integrations are not inferred.

Main entry points: [`main.py`](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/main.py) (Streamlit assistant), [`src/rag_pipeline.py`](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/rag_pipeline.py) (RAG orchestrator), [`src/embeddings.py`](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/embeddings.py) (Embedding creation), [`src/vector_store.py`](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/vector_store.py) (FAISS index operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["User experience"]
  node_ui["Streamlit assistant<br/>[main.py]"]
end

subgraph group_ingest["Knowledge ingestion"]
  node_loader["Default document loader<br/>[loader.py]"]
  node_shopdata["Shop knowledge text<br/>[raju_shop.txt]"]
  node_upload["Uploaded file parsing<br/>[main.py]"]
  node_splitter["Document chunking<br/>[splitter.py]"]
end

subgraph group_rag["RAG runtime"]
  node_config["Runtime configuration<br/>[config.py]"]
  node_pipeline["RAG orchestrator<br/>[rag_pipeline.py]"]
  node_retriever["Similarity retrieval<br/>[retriever.py]"]
  node_llm["Prompt and model setup<br/>[llm.py]"]
end

subgraph group_integrations["Models and storage"]
  node_embeddings["Embedding creation<br/>[embeddings.py]"]
  node_hf["HuggingFace embeddings"]
  node_vector["FAISS index operations<br/>[vector_store.py]"]
  node_faiss[("FAISS vector index")]
  node_groq["Groq language model"]
end

node_user(("Shop assistant user"))

node_user -->|"asks questions"| node_ui
node_ui -->|"validates settings"| node_config
node_ui -->|"gets index; asks"| node_pipeline
node_ui -->|"parses uploads"| node_upload
node_ui -->|"chunks uploads"| node_splitter
node_ui -->|"embeds uploads"| node_embeddings
node_ui -->|"indexes uploads"| node_vector
node_pipeline -->|"loads default text"| node_loader
node_loader -->|"reads"| node_shopdata
node_pipeline -->|"chunks documents"| node_splitter
node_pipeline -->|"creates embeddings"| node_embeddings
node_pipeline -->|"builds or loads index"| node_vector
node_embeddings -->|"creates model"| node_hf
node_vector -->|"builds or loads"| node_faiss
node_pipeline -->|"retrieves chunks"| node_retriever
node_retriever -->|"searches index"| node_faiss
node_pipeline -->|"builds prompt"| node_llm
node_llm -->|"configures model"| node_groq

click node_ui "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/main.py"
click node_config "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/config.py"
click node_pipeline "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/rag_pipeline.py"
click node_loader "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/loader.py"
click node_shopdata "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/data/raju_shop.txt"
click node_upload "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/main.py"
click node_splitter "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/splitter.py"
click node_embeddings "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/embeddings.py"
click node_vector "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/vector_store.py"
click node_retriever "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/retriever.py"
click node_llm "https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/llm.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_ui,node_user toneBlue
class node_loader,node_shopdata,node_upload,node_splitter toneAmber
class node_config,node_pipeline,node_retriever,node_llm toneMint
class node_embeddings,node_hf,node_vector,node_faiss,node_groq toneRose
```

## Components

### User experience

- [Streamlit assistant](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/main.py): `main.py`

### Knowledge ingestion

- [Default document loader](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/loader.py): `src/loader.py`
- [Shop knowledge text](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/data/raju_shop.txt): `data/raju_shop.txt`
- [Uploaded file parsing](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/main.py): `main.py`
- [Document chunking](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/splitter.py): `src/splitter.py`

### RAG runtime

- [Runtime configuration](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/config.py): `src/config.py`
- [RAG orchestrator](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/rag_pipeline.py): `src/rag_pipeline.py`
- [Similarity retrieval](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/retriever.py): `src/retriever.py`
- [Prompt and model setup](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/llm.py): `src/llm.py`

### Models and storage

- [Embedding creation](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/embeddings.py): `src/embeddings.py`
- **HuggingFace embeddings**
- [FAISS index operations](https://github.com/kritikaagrahari057-cmyk/raju-chai-wala/blob/main/src/vector_store.py): `src/vector_store.py`
- **FAISS vector index**
- **Groq language model**

### Other components

- **Shop assistant user**

## Connections

- Shop assistant user → Streamlit assistant: asks questions (evidence: `README.md`)
- Streamlit assistant → Runtime configuration: validates settings (evidence: `main.py`)
- Streamlit assistant → RAG orchestrator: gets index; asks (evidence: `main.py`)
- Streamlit assistant → Uploaded file parsing: parses uploads (evidence: `main.py`)
- Streamlit assistant → Document chunking: chunks uploads (evidence: `main.py`)
- Streamlit assistant → Embedding creation: embeds uploads (evidence: `main.py`)
- Streamlit assistant → FAISS index operations: indexes uploads (evidence: `main.py`)
- RAG orchestrator → Default document loader: loads default text (evidence: `src/rag_pipeline.py`)
- Default document loader → Shop knowledge text: reads (evidence: `src/loader.py`)
- RAG orchestrator → Document chunking: chunks documents (evidence: `src/rag_pipeline.py`)
- RAG orchestrator → Embedding creation: creates embeddings (evidence: `src/rag_pipeline.py`)
- RAG orchestrator → FAISS index operations: builds or loads index (evidence: `src/rag_pipeline.py`)
- Embedding creation → HuggingFace embeddings: creates model (evidence: `src/embeddings.py`)
- FAISS index operations → FAISS vector index: builds or loads (evidence: `src/vector_store.py`)
- RAG orchestrator → Similarity retrieval: retrieves chunks (evidence: `src/rag_pipeline.py`)
- Similarity retrieval → FAISS vector index: searches index (evidence: `src/retriever.py`)
- RAG orchestrator → Prompt and model setup: builds prompt (evidence: `src/rag_pipeline.py`)
- Prompt and model setup → Groq language model: configures model (evidence: `src/llm.py`)
