# vansh3829/rag-technical-documentation-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/vansh3829/rag-technical-documentation-assistant
- Repository: https://github.com/vansh3829/rag-technical-documentation-assistant

## Overview

This is a local-first technical-documentation RAG assistant. Users ask questions through the Streamlit UI or API; the API runs a LangGraph workflow that analyzes the query, retrieves and grades indexed chunks, then answers with sources, retries, optional web search, and a groundedness check. Documents enter through file or URL ingestion, are chunked, embedded, and stored in Chroma. The API also exposes index status and feedback, with conversation history kept in memory and feedback persisted in SQLite. Relationships are based on the README and shown source/index references; unsampled details are not expanded.

Main entry points: [`main.py`](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/main.py) (FastAPI endpoints), [`graph/nodes.py`](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/nodes.py) (RAG nodes), [`vectorstore/store.py`](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/vectorstore/store.py) (Chroma vector store), [`graph/workflow.py`](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/workflow.py) (LangGraph workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_ui["Streamlit UI<br/>[streamlit_app.py]"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_sessions["Session history<br/>[main.py]"]
  node_feedback[("Feedback records<br/>[main.py]")]
end

subgraph group_workflow["Answer workflow"]
  node_workflow["LangGraph workflow<br/>[workflow.py]"]
  node_state["Query state<br/>[state.py]"]
  node_nodes["RAG nodes<br/>[nodes.py]"]
end

subgraph group_knowledge["Knowledge ingestion"]
  node_corpus["Documentation corpus"]
  node_ingest["Document ingestion<br/>[ingest.py]"]
end

subgraph group_services["Models and storage"]
  node_vector[("Chroma vector store<br/>[store.py]")]
  node_config["Application settings<br/>[config.py]"]
  node_llm["Groq language model<br/>[client.py]"]
  node_embeddings["Local embeddings<br/>[client.py]"]
end

node_user(("Questioner"))
node_groq["Groq service"]
node_tavily["Tavily search"]

node_user -->|"asks"| node_ui
node_ui -->|"sends requests"| node_api
node_user -->|"calls endpoints"| node_api
node_api -->|"runs query"| node_workflow
node_api -->|"reads and updates"| node_sessions
node_api -->|"stores feedback"| node_feedback
node_workflow -->|"uses schema"| node_state
node_workflow -->|"dispatches nodes"| node_nodes
node_nodes -->|"retrieves chunks"| node_vector
node_nodes -->|"invokes model"| node_llm
node_llm -->|"calls"| node_groq
node_vector -->|"embeds documents"| node_embeddings
node_ingest -->|"adds chunks"| node_vector
node_corpus -->|"provides documents"| node_ingest
node_api -->|"ingests uploads or URLs"| node_ingest
node_api -->|"lists index"| node_vector
node_nodes -.->|"searches fallback"| node_tavily

click node_ui "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/streamlit_app.py"
click node_api "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/main.py"
click node_sessions "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/main.py"
click node_feedback "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/main.py"
click node_workflow "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/workflow.py"
click node_state "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/state.py"
click node_nodes "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/nodes.py"
click node_corpus "https://github.com/vansh3829/rag-technical-documentation-assistant/tree/main/data/corpus"
click node_ingest "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/ingest.py"
click node_vector "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/vectorstore/store.py"
click node_config "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/config.py"
click node_llm "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/llm/client.py"
click node_embeddings "https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/llm/client.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_api,node_sessions,node_feedback toneBlue
class node_workflow,node_state,node_nodes toneAmber
class node_corpus,node_ingest toneMint
class node_vector,node_config,node_llm,node_embeddings toneRose
class node_user,node_groq,node_tavily toneIndigo
```

## Components

### User interfaces

- [Streamlit UI](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/streamlit_app.py): `streamlit_app.py`
- [FastAPI endpoints](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/main.py): `main.py`
- [Session history](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/main.py): `main.py`
- [Feedback records](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/main.py): `main.py`

### Answer workflow

- [LangGraph workflow](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/workflow.py): `graph/workflow.py`
- [Query state](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/state.py): `graph/state.py`
- [RAG nodes](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/graph/nodes.py): `graph/nodes.py`

### Knowledge ingestion

- [Documentation corpus](https://github.com/vansh3829/rag-technical-documentation-assistant/tree/main/data/corpus): `data/corpus`
- [Document ingestion](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/ingest.py): `ingest.py`

### Models and storage

- [Chroma vector store](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/vectorstore/store.py): `vectorstore/store.py`
- [Application settings](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/config.py): `config.py`
- [Groq language model](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/llm/client.py): `llm/client.py`
- [Local embeddings](https://github.com/vansh3829/rag-technical-documentation-assistant/blob/main/llm/client.py): `llm/client.py`

### Other components

- **Questioner**
- **Groq service**
- **Tavily search**

## Connections

- Questioner → Streamlit UI: asks (evidence: `streamlit_app.py`)
- Streamlit UI → FastAPI endpoints: sends requests (evidence: `streamlit_app.py`)
- Questioner → FastAPI endpoints: calls endpoints (evidence: `README.md`)
- FastAPI endpoints → LangGraph workflow: runs query (evidence: `main.py`)
- FastAPI endpoints → Session history: reads and updates (evidence: `main.py`)
- FastAPI endpoints → Feedback records: stores feedback (evidence: `main.py`)
- LangGraph workflow → Query state: uses schema (evidence: `graph/workflow.py`)
- LangGraph workflow → RAG nodes: dispatches nodes (evidence: `graph/workflow.py`)
- RAG nodes → Chroma vector store: retrieves chunks (evidence: `graph/nodes.py`)
- RAG nodes → Groq language model: invokes model (evidence: `graph/nodes.py`)
- Groq language model → Groq service: calls (evidence: `llm/client.py`)
- Chroma vector store → Local embeddings: embeds documents (evidence: `vectorstore/store.py`)
- Document ingestion → Chroma vector store: adds chunks (evidence: `ingest.py`)
- Documentation corpus → Document ingestion: provides documents (evidence: `README.md`)
- FastAPI endpoints → Document ingestion: ingests uploads or URLs (evidence: `main.py`)
- FastAPI endpoints → Chroma vector store: lists index (evidence: `main.py`)
- RAG nodes → Tavily search: searches fallback (evidence: `graph/nodes.py`)
