# krishnavamshi2912/enterprise-rag-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/krishnavamshi2912/enterprise-rag-assistant
- Repository: https://github.com/krishnavamshi2912/enterprise-rag-assistant

## Overview

This is a Telecom BSS knowledge-base RAG assistant. A user submits a question through Streamlit; the backend runs the assistant workflow, which checks input safety, handles simple or out-of-domain queries directly, and routes technical questions through retrieval, response generation, and output safety checks. Startup prepares section-aware knowledge-base chunks and a Qdrant retriever; technical retrieval includes FlashRank reranking. Portkey routes LLM requests, while LangSmith tracing and evaluation support the application. Some links reflect README capabilities or SOURCE INDEX references; unsampled internals are not expanded beyond that evidence.

Main entry points: [`app/retrieval/pipeline.py`](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/pipeline.py) (RAG setup and ask), [`app/agents/graph.py`](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/graph.py) (Workflow graph), [`app/retrieval/vector_store.py`](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/vector_store.py) (Vector store), [`app/retrieval/llm.py`](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/llm.py) (LLM access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_ui["Streamlit UI<br/>[streamlit_app.py]"]
  node_api["Backend API<br/>[main.py]"]
  node_pipeline["RAG setup and ask<br/>[pipeline.py]"]
end

subgraph group_knowledge["Knowledge preparation"]
  node_source_doc["BSS knowledge base"]
  node_loader["Document loader<br/>[loader.py]"]
  node_chunker["Section chunking<br/>[chunking.py]"]
  node_vector[("Vector store<br/>[vector_store.py]")]
  node_reranker["FlashRank reranker<br/>[reranker.py]"]
  node_qdrant[("Qdrant service")]
end

subgraph group_workflow["Assistant workflow"]
  node_graph["Workflow graph<br/>[graph.py]"]
  node_state["Agent state<br/>[state.py]"]
  node_guardrails["Input/output guardrails<br/>[guardrails.py]"]
  node_planner["Query planner<br/>[planner.py]"]
  node_classifier["Deterministic classifier"]
  node_retriever["Retriever node<br/>[retriver.py]"]
  node_responder["Response generator<br/>[responder.py]"]
end

subgraph group_services["Models and services"]
  node_embeddings["Jina embeddings<br/>[embeddings.py]"]
  node_llm["LLM access<br/>[llm.py]"]
  node_gateway["Portkey gateway<br/>[gateway.py]"]
  node_portkey{{"Portkey service"}}
  node_tracing["LangSmith tracing<br/>[tracing.py]"]
end

node_user(("User"))

node_user -->|"asks"| node_ui
node_ui -.->|"submits query"| node_api
node_api -->|"uses RAG pipeline"| node_pipeline
node_pipeline -->|"loads documents"| node_loader
node_source_doc -.->|"provides content"| node_loader
node_pipeline -->|"chunks documents"| node_chunker
node_pipeline -->|"builds or loads"| node_vector
node_vector -->|"embeds chunks"| node_embeddings
node_vector -->|"stores vectors"| node_qdrant
node_pipeline -->|"checks tracing"| node_tracing
node_pipeline -->|"creates workflow"| node_graph
node_pipeline -->|"invokes workflow"| node_graph
node_graph -->|"registers guardrails"| node_guardrails
node_graph -->|"routes to planner"| node_planner
node_planner -->|"checks simple queries"| node_classifier
node_planner -->|"classifies queries"| node_llm
node_graph -->|"routes technical queries"| node_retriever
node_retriever -->|"reranks results"| node_reranker
node_retriever -.->|"searches vectors"| node_vector
node_graph -->|"routes retrieved context"| node_responder
node_responder -->|"generates answer"| node_llm
node_guardrails -->|"checks safety"| node_llm
node_llm -->|"requests model"| node_gateway
node_gateway -->|"routes model calls"| node_portkey
node_graph -->|"uses workflow state"| node_state

click node_ui "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/ui/streamlit_app.py"
click node_api "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/main.py"
click node_pipeline "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/pipeline.py"
click node_source_doc "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/Documents/Telecom_BSS_Knowledge_Base.txt"
click node_loader "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/ingestion/loader.py"
click node_chunker "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/ingestion/chunking.py"
click node_vector "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/vector_store.py"
click node_embeddings "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/embeddings.py"
click node_graph "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/graph.py"
click node_state "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/state.py"
click node_guardrails "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/guardrails/guardrails.py"
click node_planner "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/nodes/planner.py"
click node_classifier "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/utils/query_classifier.py"
click node_retriever "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/nodes/retriver.py"
click node_reranker "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/reranker.py"
click node_responder "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/nodes/responder.py"
click node_llm "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/llm.py"
click node_gateway "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/gateway/gateway.py"
click node_tracing "https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/tracing.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_pipeline,node_user toneBlue
class node_source_doc,node_loader,node_chunker,node_vector,node_reranker,node_qdrant toneAmber
class node_graph,node_state,node_guardrails,node_planner,node_classifier,node_retriever,node_responder toneMint
class node_embeddings,node_llm,node_gateway,node_portkey,node_tracing toneRose
```

## Components

### Application entry

- [Streamlit UI](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/ui/streamlit_app.py): `app/ui/streamlit_app.py`
- [Backend API](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/main.py): `app/main.py`
- [RAG setup and ask](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/pipeline.py): `app/retrieval/pipeline.py`

### Knowledge preparation

- [BSS knowledge base](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/Documents/Telecom_BSS_Knowledge_Base.txt): `Documents/Telecom_BSS_Knowledge_Base.txt`
- [Document loader](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/ingestion/loader.py): `app/ingestion/loader.py`
- [Section chunking](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/ingestion/chunking.py): `app/ingestion/chunking.py`
- [Vector store](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/vector_store.py): `app/retrieval/vector_store.py`
- [FlashRank reranker](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/reranker.py): `app/retrieval/reranker.py`
- **Qdrant service**

### Assistant workflow

- [Workflow graph](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/graph.py): `app/agents/graph.py`
- [Agent state](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/state.py): `app/agents/state.py`
- [Input/output guardrails](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/guardrails/guardrails.py): `app/guardrails/guardrails.py`
- [Query planner](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/nodes/planner.py): `app/agents/nodes/planner.py`
- [Deterministic classifier](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/utils/query_classifier.py): `app/utils/query_classifier.py`
- [Retriever node](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/nodes/retriver.py): `app/agents/nodes/retriver.py`
- [Response generator](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/agents/nodes/responder.py): `app/agents/nodes/responder.py`

### Models and services

- [Jina embeddings](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/embeddings.py): `app/retrieval/embeddings.py`
- [LLM access](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/llm.py): `app/retrieval/llm.py`
- [Portkey gateway](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/gateway/gateway.py): `app/gateway/gateway.py`
- **Portkey service**
- [LangSmith tracing](https://github.com/krishnavamshi2912/enterprise-rag-assistant/blob/main/app/retrieval/tracing.py): `app/retrieval/tracing.py`

### Other components

- **User**

## Connections

- User → Streamlit UI: asks (evidence: `README.md`)
- Streamlit UI → Backend API: submits query
- Backend API → RAG setup and ask: uses RAG pipeline (evidence: `app/main.py`)
- RAG setup and ask → Document loader: loads documents (evidence: `app/retrieval/pipeline.py`)
- BSS knowledge base → Document loader: provides content
- RAG setup and ask → Section chunking: chunks documents (evidence: `app/retrieval/pipeline.py`)
- RAG setup and ask → Vector store: builds or loads (evidence: `app/retrieval/pipeline.py`)
- Vector store → Jina embeddings: embeds chunks (evidence: `app/retrieval/vector_store.py`)
- Vector store → Qdrant service: stores vectors (evidence: `README.md`)
- RAG setup and ask → LangSmith tracing: checks tracing (evidence: `app/retrieval/pipeline.py`)
- RAG setup and ask → Workflow graph: creates workflow (evidence: `app/retrieval/pipeline.py`)
- RAG setup and ask → Workflow graph: invokes workflow (evidence: `app/retrieval/pipeline.py`)
- Workflow graph → Input/output guardrails: registers guardrails (evidence: `app/agents/graph.py`)
- Workflow graph → Query planner: routes to planner (evidence: `app/agents/graph.py`)
- Query planner → Deterministic classifier: checks simple queries (evidence: `app/agents/nodes/planner.py`)
- Query planner → LLM access: classifies queries (evidence: `app/agents/nodes/planner.py`)
- Workflow graph → Retriever node: routes technical queries (evidence: `app/agents/graph.py`)
- Retriever node → FlashRank reranker: reranks results (evidence: `app/agents/nodes/retriver.py`)
- Retriever node → Vector store: searches vectors
- Workflow graph → Response generator: routes retrieved context (evidence: `app/agents/graph.py`)
- Response generator → LLM access: generates answer (evidence: `app/agents/nodes/responder.py`)
- Input/output guardrails → LLM access: checks safety (evidence: `app/guardrails/guardrails.py`)
- LLM access → Portkey gateway: requests model (evidence: `app/retrieval/llm.py`)
- Portkey gateway → Portkey service: routes model calls (evidence: `app/gateway/gateway.py`)
- Workflow graph → Agent state: uses workflow state (evidence: `app/agents/graph.py`)
