# atulkashyap404/rag-projects architecture

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

- Interactive diagram: https://gitdiagram.com/atulkashyap404/rag-projects
- Repository: https://github.com/atulkashyap404/rag-projects

## Overview

1. **Overall shape**
   This repository is not one application; it is a collection of mostly standalone LangChain/LLM demos. The main architectural boundary is the folder per project. Most folders contain either a single runnable `app.py` entrypoint or a notebook for experimentation, plus local sample data.

2. **Shared stack**
   The common runtime is Python, with LangChain as the orchestration layer across projects. Jupyter notebooks are used for exploratory builds and walkthroughs, while `app.py` files represent packaged demo entrypoints. `requirements.txt` suggests a shared dependency baseline across the repo.

3. **Core RAG pattern reused throughout**
   The dominant data flow in the repo is: local documents or text files → chunking/preprocessing → embeddings/vector store → retriever → chain/agent → LLM answer. This pattern appears in the RAG pipeline, retriever-chain, document Q&A, advanced Q&A, and on-device projects, with different backends swapped in per folder.

4. **Project 01 and Project 02: chatbot and API boundaries**
   `Project 01 chatbot` appears to be a local chatbot demo centered on `app.py` and `locallama.py`, implying a local model wrapper rather than a remote API dependency. `Project 02 APIs` explicitly splits into `app.py` and `client.py`, so its architecture includes a server/API boundary and a separate consumer/client path.

5. **Project 03 to Project 05: learning progression for retrieval**
   `Project 03 RAG Pipeline` is a basic retrieval pipeline built from a text corpus (`speech.txt`) and notebook experimentation. `Project 04 Retriever and Chain` extends that into retriever + chain composition using PDF input. `Project 05 Advanced RAG Q&A Project` moves into agent-style orchestration, indicating more dynamic tool/chain selection than the earlier deterministic retrieval flows.

6. **Project 06, 08, and 09: hosted LLM-backed Q&A demos**
   `Project 06 Groq inference` demonstrates LLM inference through Groq, with both an app and a notebook. `Project 08 Powerful Doc Q&A Chatbot` and `Project 09 Advance Q&A Chatbot` are likely production-style Q&A frontends that combine document ingestion with hosted LLM calls. These projects shift the main dependency from local models to an external inference service.

7. **Project 07: Hugging Face / GenAI experiments**
   `Project 07 Gen AI` contains Hugging Face notebooks and a `papers/` directory with PDF research papers. Architecturally, this is a document-analysis workspace: research PDFs feed notebook-driven processing, likely for summarization, retrieval, or model experimentation rather than a deployed app.

8. **Project 10: on-device retrieval**
   `Project 10 On-Device AI` is the most infrastructure-specific project. The `data/` folder contains many PDFs, which act as the local knowledge base, and the README indicates ObjectBox vector storage. The key architectural distinction here is that embeddings/retrieval are kept on-device instead of relying on a hosted vector DB or cloud service.

9. **Project 11: image enhancement as a separate vision workflow**
   `Project 11 ImageEnhancer` is a different workload from the RAG/chatbot projects. Its `app.py` suggests a standalone UI or service for image processing, so its pipeline is likely image input → enhancement model/processor → transformed output, rather than text retrieval and generation.

10. **Data and artifact handling**
    PDFs, text files, and papers are the main source assets across the repo. `Outcome.pdf` files appear to be generated deliverables or result snapshots from notebook runs, not runtime dependencies. This makes the repository read like a lab/workshop archive with reproducible examples and exported outcomes.

11. **External services and model providers**
    The repo references several interchangeable backends across projects: Ollama, Groq, Hugging Face, OpenAI GPT-4o, Groq inference, Astra DB Serverless, Pinecone, FAISS, ChromaDB, and ObjectBox. These are not all used together; instead, each project demonstrates one deployment or retrieval variant, which is why the repo is best diagrammed as multiple vertical slices sharing the same LangChain-centered pattern.

12. **How to diagram it accurately**
    The cleanest architecture diagram is a hub-and-spoke view: a central “LangChain-based app patterns” concept with separate spokes for local chatbot, API service, RAG notebook pipelines, hosted-LLM Q&A, on-device vector retrieval, and image enhancement. Avoid drawing one monolithic system; the repository is a portfolio of independent demos with shared ideas, not a single integrated platform.

Main entry points: [`Project 01 chatbot/app.py`](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2001%20chatbot/app.py) (Local chatbot), [`Project 03 RAG Pipeline/rag.ipynb`](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2003%20RAG%20Pipeline/rag.ipynb) (RAG notebook), [`Project 06 Groq inference/app.py`](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2006%20Groq%20inference/app.py) (Groq app), [`Project 10 On-Device AI/app.py`](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2010%20On-Device%20AI/app.py) (On-device app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_shared["Shared stack"]
  node_python_langchain["Python + LangChain<br/>shared runtime"]
  node_requirements["Requirements<br/>deps baseline<br/>[requirements.txt]"]
end

subgraph group_chat_api["Chat and API demos"]
  node_p01_app["Local chatbot<br/>demo entrypoint<br/>[app.py]"]
  node_p01_model["Local LLaMA<br/>model wrapper<br/>[locallama.py]"]
  node_p02_app["API server<br/>service entrypoint<br/>[app.py]"]
  node_p02_client["API client<br/>consumer<br/>[client.py]"]
end

subgraph group_rag_learning["Retrieval demos"]
  node_p03_rag["RAG notebook<br/>retrieval notebook<br/>[rag.ipynb]"]
  node_p03_text["Speech text<br/>source corpus<br/>[speech.txt]"]
  node_p04_chain["Retriever chain<br/>retrieval notebook<br/>[retriver.ipynb]"]
  node_p04_pdf["PDF input<br/>document source<br/>[imagepro.pdf]"]
  node_p05_agents["Agent Q&A<br/>agent notebook<br/>[agents.ipynb]"]
end

subgraph group_hosted_llm["Hosted LLM demos"]
  node_p06_app["Groq app<br/>LLM app<br/>[app.py]"]
  node_p06_nb["Groq notebook<br/>inference notebook<br/>[groq.ipynb]"]
  node_p07_hf["HF notebooks<br/>genai notebook<br/>[huggingface.ipynb]"]
  node_p07_papers["Paper corpus<br/>research docs"]
  node_p08_app["Doc Q&A app<br/>q&a frontend<br/>[app.py]"]
  node_p09_app["Advanced Q&A<br/>q&a frontend<br/>[app.py]"]
end

subgraph group_on_device["On-device retrieval"]
  node_p10_app["On-device app<br/>local retrieval app<br/>[app.py]"]
  node_p10_data["PDF store<br/>local knowledge base"]
end

subgraph group_vision["Vision demo"]
  node_p11_app["Image enhancer<br/>vision app<br/>[app.py]"]
end

node_portfolio["Demo portfolio<br/>repo collection"]

node_portfolio -->|"shared stack"| node_python_langchain
node_portfolio -->|"includes"| node_p01_app
node_p01_app -->|"uses"| node_p01_model
node_portfolio -->|"includes"| node_p02_app
node_p02_client -->|"calls"| node_p02_app
node_portfolio -->|"includes"| node_p03_rag
node_p03_text -->|"feeds"| node_p03_rag
node_portfolio -->|"includes"| node_p04_chain
node_p04_pdf -->|"feeds"| node_p04_chain
node_portfolio -->|"includes"| node_p05_agents
node_portfolio -->|"includes"| node_p06_app
node_p06_nb -.->|"explores"| node_p06_app
node_portfolio -->|"includes"| node_p07_hf
node_p07_papers -->|"feeds"| node_p07_hf
node_portfolio -->|"includes"| node_p08_app
node_portfolio -->|"includes"| node_p09_app
node_portfolio -->|"includes"| node_p10_app
node_p10_data -->|"feeds"| node_p10_app
node_portfolio -->|"includes"| node_p11_app
node_requirements -.->|"supports"| node_p01_app
node_requirements -.->|"supports"| node_p06_app
node_python_langchain -.->|"orchestrates"| node_p03_rag
node_python_langchain -.->|"orchestrates"| node_p10_app

click node_requirements "https://github.com/atulkashyap404/rag-projects/blob/master/requirements.txt"
click node_p01_app "https://github.com/atulkashyap404/rag-projects/blob/master/Project 01 chatbot/app.py"
click node_p01_model "https://github.com/atulkashyap404/rag-projects/blob/master/Project 01 chatbot/locallama.py"
click node_p02_app "https://github.com/atulkashyap404/rag-projects/blob/master/Project 02 APIs/app.py"
click node_p02_client "https://github.com/atulkashyap404/rag-projects/blob/master/Project 02 APIs/client.py"
click node_p03_rag "https://github.com/atulkashyap404/rag-projects/blob/master/Project 03 RAG Pipeline/rag.ipynb"
click node_p03_text "https://github.com/atulkashyap404/rag-projects/blob/master/Project 03 RAG Pipeline/speech.txt"
click node_p04_chain "https://github.com/atulkashyap404/rag-projects/blob/master/Project 04 Retriever and Chain/retriver.ipynb"
click node_p04_pdf "https://github.com/atulkashyap404/rag-projects/blob/master/Project 04 Retriever and Chain/imagepro.pdf"
click node_p05_agents "https://github.com/atulkashyap404/rag-projects/blob/master/Project 05 Advanced RAG Q&A Project/agents.ipynb"
click node_p06_app "https://github.com/atulkashyap404/rag-projects/blob/master/Project 06 Groq inference/app.py"
click node_p06_nb "https://github.com/atulkashyap404/rag-projects/blob/master/Project 06 Groq inference/groq.ipynb"
click node_p07_hf "https://github.com/atulkashyap404/rag-projects/blob/master/Project 07 Gen AI/huggingface.ipynb"
click node_p07_papers "https://github.com/atulkashyap404/rag-projects/tree/master/Project 07 Gen AI/papers"
click node_p08_app "https://github.com/atulkashyap404/rag-projects/blob/master/Project 08 Powerful Doc Q&A Chatbot/app.py"
click node_p09_app "https://github.com/atulkashyap404/rag-projects/blob/master/Project 09 Advance Q&A Chatbot/app.py"
click node_p10_app "https://github.com/atulkashyap404/rag-projects/blob/master/Project 10 On-Device AI/app.py"
click node_p10_data "https://github.com/atulkashyap404/rag-projects/tree/master/Project 10 On-Device AI/data"
click node_p11_app "https://github.com/atulkashyap404/rag-projects/blob/master/Project 11 ImageEnhancer/app.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_python_langchain,node_requirements toneBlue
class node_p01_app,node_p01_model,node_p02_app,node_p02_client toneAmber
class node_p03_rag,node_p03_text,node_p04_chain,node_p04_pdf,node_p05_agents toneMint
class node_p06_app,node_p06_nb,node_p07_hf,node_p07_papers,node_p08_app,node_p09_app toneRose
class node_p10_app,node_p10_data toneIndigo
class node_p11_app toneTeal
class node_portfolio toneNeutral
```

## Components

### Shared stack

Common runtime and dependency baseline used across the demo projects.

- **Python + LangChain**: shared runtime · Common orchestration layer and execution environment across the repository.
- [Requirements](https://github.com/atulkashyap404/rag-projects/blob/master/requirements.txt): deps baseline · Shared dependency baseline for the demo projects. · `requirements.txt`

### Chat and API demos

Local chatbot and a split client/server example.

- [Local chatbot](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2001%20chatbot/app.py): demo entrypoint · Main runnable entrypoint for the local chatbot project. · `Project 01 chatbot/app.py`
- [Local LLaMA](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2001%20chatbot/locallama.py): model wrapper · Local model integration used by the chatbot demo. · `Project 01 chatbot/locallama.py`
- [API server](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2002%20APIs/app.py): service entrypoint · Server-side entrypoint for the API demo. · `Project 02 APIs/app.py`
- [API client](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2002%20APIs/client.py): consumer · Separate client path that calls the API service. · `Project 02 APIs/client.py`

### Retrieval demos

Progression of RAG, retriever-chain, and agent-style notebook experiments.

- [RAG notebook](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2003%20RAG%20Pipeline/rag.ipynb): retrieval notebook · Basic retrieval pipeline experiment over a text corpus. · `Project 03 RAG Pipeline/rag.ipynb`
- [Speech text](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2003%20RAG%20Pipeline/speech.txt): source corpus · Plain-text source document used by the RAG pipeline. · `Project 03 RAG Pipeline/speech.txt`
- [Retriever chain](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2004%20Retriever%20and%20Chain/retriver.ipynb): retrieval notebook · Retriever-plus-chain composition over document input. · `Project 04 Retriever and Chain/retriver.ipynb`
- [PDF input](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2004%20Retriever%20and%20Chain/imagepro.pdf): document source · Document input used to drive the retriever-chain workflow. · `Project 04 Retriever and Chain/imagepro.pdf`
- [Agent Q&A](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2005%20Advanced%20RAG%20Q%26A%20Project/agents.ipynb): agent notebook · More dynamic orchestration using agent-style composition. · `Project 05 Advanced RAG Q&A Project/agents.ipynb`

### Hosted LLM demos

Groq, Hugging Face, and document Q&A projects backed by external model services.

- [Groq app](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2006%20Groq%20inference/app.py): LLM app · Runnable Groq-backed inference demo. · `Project 06 Groq inference/app.py`
- [Groq notebook](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2006%20Groq%20inference/groq.ipynb): inference notebook · Notebook used to explore Groq-based model calls. · `Project 06 Groq inference/groq.ipynb`
- [HF notebooks](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2007%20Gen%20AI/huggingface.ipynb): genai notebook · Hugging Face experimentation and walkthrough notebooks. · `Project 07 Gen AI/huggingface.ipynb`
- [Paper corpus](https://github.com/atulkashyap404/rag-projects/tree/HEAD/Project%2007%20Gen%20AI/papers): research docs · Collection of PDF papers used for document analysis experiments. · `Project 07 Gen AI/papers`
- [Doc Q&A app](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2008%20Powerful%20Doc%20Q%26A%20Chatbot/app.py): q&a frontend · Standalone document question-answering demo. · `Project 08 Powerful Doc Q&A Chatbot/app.py`
- [Advanced Q&A](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2009%20Advance%20Q%26A%20Chatbot/app.py): q&a frontend · Expanded question-answering chatbot demo. · `Project 09 Advance Q&A Chatbot/app.py`

### On-device retrieval

Local PDF knowledge base with on-device vector storage.

- [On-device app](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2010%20On-Device%20AI/app.py): local retrieval app · Entry point for the on-device AI project. · `Project 10 On-Device AI/app.py`
- [PDF store](https://github.com/atulkashyap404/rag-projects/tree/HEAD/Project%2010%20On-Device%20AI/data): local knowledge base · Many local PDFs used as the retrieval corpus. · `Project 10 On-Device AI/data`

### Vision demo

Standalone image enhancement workflow.

- [Image enhancer](https://github.com/atulkashyap404/rag-projects/blob/HEAD/Project%2011%20ImageEnhancer/app.py): vision app · Standalone image enhancement workflow. · `Project 11 ImageEnhancer/app.py`

### Other components

- **Demo portfolio**: repo collection · A set of mostly independent LangChain and LLM demo projects rather than one integrated application.

## Connections

- Demo portfolio → Python + LangChain: shared stack · The demos are built around a common Python and LangChain runtime.
- Demo portfolio → Local chatbot: includes · Project 01 provides a local chatbot entrypoint.
- Local chatbot → Local LLaMA: uses · The chatbot delegates model handling to the local LLaMA wrapper.
- Demo portfolio → API server: includes · Project 02 exposes an API service boundary.
- API client → API server: calls · A separate client path consumes the API.
- Demo portfolio → RAG notebook: includes · Project 03 demonstrates the basic RAG pattern.
- Speech text → RAG notebook: feeds · The text corpus is the retrieval source for the notebook.
- Demo portfolio → Retriever chain: includes · Project 04 extends retrieval into chain composition.
- PDF input → Retriever chain: feeds · A PDF document provides the source material.
- Demo portfolio → Agent Q&A: includes · Project 05 moves toward agent-style orchestration.
- Demo portfolio → Groq app: includes · Project 06 is a Groq-backed inference demo.
- Groq notebook → Groq app: explores · The notebook supports the runnable Groq app.
- Demo portfolio → HF notebooks: includes · Project 07 is a Hugging Face experimentation workspace.
- Paper corpus → HF notebooks: feeds · Research PDFs are processed in notebook experiments.
- Demo portfolio → Doc Q&A app: includes · Project 08 is a document Q&A frontend.
- Demo portfolio → Advanced Q&A: includes · Project 09 is an advanced Q&A chatbot frontend.
- Demo portfolio → On-device app: includes · Project 10 implements local, on-device retrieval.
- PDF store → On-device app: feeds · The local PDF corpus is the knowledge base.
- Demo portfolio → Image enhancer: includes · Project 11 is a separate vision workflow.
- Requirements → Local chatbot: supports · Shared dependencies support the runnable demos.
- Requirements → Groq app: supports · Shared dependencies support the runnable demos.
- Python + LangChain → RAG notebook: orchestrates · LangChain-style orchestration appears in retrieval demos.
- Python + LangChain → On-device app: orchestrates · The on-device project also follows the LangChain-centered pattern.
