# rs6739171-hash/enterprise_agentic_rag architecture

> Architecture diagram of the GitHub repository rs6739171-hash/enterprise_agentic_rag, 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/rs6739171-hash/enterprise_agentic_rag
- Repository: https://github.com/rs6739171-hash/enterprise_agentic_rag

## Overview

This is an agentic RAG application for answering Kubernetes-documentation questions, with a protected chat UI and a hosted evaluation workspace. The main flow sends a chat query from Streamlit to FastAPI, applies safety checks, routes it through LangGraph, retrieves and ranks context when needed, and returns a grounded answer and sources. The graph also shows document ingestion and evaluation as distinct product branches. Relationships are based on the excerpts, SOURCE INDEX references, or README; ingestion details are not sampled, so its runtime connections are omitted.

Main entry points: [`Interprise Grade Rag/app/agents/graph.py`](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/graph.py) (LangGraph router), [`Interprise Grade Rag/evals/hosted.py`](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/hosted.py) (Hosted evaluation), [`Interprise Grade Rag/app/main.py`](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/main.py) (FastAPI service), [`Interprise Grade Rag/ui/app.py`](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/ui/app.py) (Chat UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interfaces"]
  node_chat["Chat UI<br/>[app.py]"]
  node_evalui["Evaluation UI<br/>[dashboard.py]"]
end

subgraph group_runtime["Query runtime"]
  node_api["FastAPI service<br/>[main.py]"]
  node_safety["Safety gate<br/>[rails.py]"]
  node_safetyrules["Safety rules<br/>[colang_rules.py]"]
  node_graph["LangGraph router<br/>[graph.py]"]
  node_planner["Request planner<br/>[planner.py]"]
  node_responder["Answer responder<br/>[responder.py]"]
  node_state["Agent state<br/>[state.py]"]
end

subgraph group_knowledge["Knowledge and retrieval"]
  node_retriever["Context retriever<br/>[retriever.py]"]
  node_ingestion["Document ingestion<br/>[processor.py]"]
  node_qdrantservice["Vector search<br/>[qdrant_service.py]"]
  node_embeddings["Embedding service<br/>[embeddings.py]"]
  node_ranking["Context ranking<br/>[ranking_service.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_evalroutes["Evaluation routes<br/>[routes.py]"]
  node_hostedeval["Hosted evaluation<br/>[hosted.py]"]
  node_pipeline["Query pipeline<br/>[pipeline.py]"]
  node_guardseval["Safety cases<br/>[guardrails_eval.py]"]
  node_metrics["Evaluation metrics<br/>[metrics.py]"]
  node_reports["Evaluation reports<br/>[dashboard.py]"]
end

node_user(("Questioner"))
node_qdrant[("Qdrant")]
node_llm{{"LLM provider"}}

node_user -->|"asks"| node_chat
node_chat -->|"posts query"| node_api
node_api -->|"checks request"| node_safety
node_safety -->|"uses rules"| node_safetyrules
node_api -->|"invokes graph"| node_graph
node_graph -->|"routes requests"| node_planner
node_graph -->|"routes technical"| node_retriever
node_graph -->|"routes answers"| node_responder
node_planner -->|"plans with"| node_llm
node_responder -->|"generates with"| node_llm
node_retriever -->|"searches"| node_qdrantservice
node_retriever -->|"reranks results"| node_ranking
node_qdrantservice -->|"embeds query"| node_embeddings
node_qdrantservice -->|"queries vectors"| node_qdrant
node_graph -->|"uses state"| node_state
node_api -->|"mounts routes"| node_evalroutes
node_evalui -->|"displays reports"| node_reports
node_evalroutes -->|"starts evaluation"| node_hostedeval
node_hostedeval -->|"queries samples"| node_pipeline
node_pipeline -->|"posts samples"| node_api
node_hostedeval -->|"runs safety cases"| node_guardseval
node_hostedeval -->|"scores answers"| node_llm
node_evalroutes -->|"serves report"| node_reports
node_chat -->|"shows answer"| node_user
node_ingestion -.->|"creates vectors"| node_embeddings
node_hostedeval -.->|"computes metrics"| node_metrics

click node_chat "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/ui/app.py"
click node_evalui "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/dashboard.py"
click node_api "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/main.py"
click node_safety "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/guardrails/rails.py"
click node_safetyrules "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/guardrails/colang_rules.py"
click node_graph "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/graph.py"
click node_planner "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/nodes/planner.py"
click node_retriever "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/nodes/retriever.py"
click node_responder "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/nodes/responder.py"
click node_state "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/state.py"
click node_ingestion "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/ingestion/processor.py"
click node_qdrantservice "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/services/retrieval/qdrant_service.py"
click node_embeddings "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/services/retrieval/embeddings.py"
click node_ranking "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/services/retrieval/ranking_service.py"
click node_evalroutes "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/routes.py"
click node_hostedeval "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/hosted.py"
click node_pipeline "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/pipeline.py"
click node_guardseval "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/guardrails_eval.py"
click node_metrics "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/metrics.py"
click node_reports "https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/dashboard.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_chat,node_evalui toneBlue
class node_api,node_safety,node_safetyrules,node_graph,node_planner,node_responder,node_state,node_qdrant toneAmber
class node_retriever,node_ingestion,node_qdrantservice,node_embeddings,node_ranking toneMint
class node_evalroutes,node_hostedeval,node_pipeline,node_guardseval,node_metrics,node_reports toneRose
class node_user,node_llm toneIndigo
```

## Components

### User interfaces

- [Chat UI](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/ui/app.py): `Interprise Grade Rag/ui/app.py`
- [Evaluation UI](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/dashboard.py): `Interprise Grade Rag/evals/dashboard.py`

### Query runtime

- [FastAPI service](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/main.py): `Interprise Grade Rag/app/main.py`
- [Safety gate](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/guardrails/rails.py): `Interprise Grade Rag/app/guardrails/rails.py`
- [Safety rules](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/guardrails/colang_rules.py): `Interprise Grade Rag/app/guardrails/colang_rules.py`
- [LangGraph router](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/graph.py): `Interprise Grade Rag/app/agents/graph.py`
- [Request planner](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/nodes/planner.py): `Interprise Grade Rag/app/agents/nodes/planner.py`
- [Answer responder](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/nodes/responder.py): `Interprise Grade Rag/app/agents/nodes/responder.py`
- [Agent state](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/state.py): `Interprise Grade Rag/app/agents/state.py`

### Knowledge and retrieval

- [Context retriever](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/agents/nodes/retriever.py): `Interprise Grade Rag/app/agents/nodes/retriever.py`
- [Document ingestion](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/ingestion/processor.py): `Interprise Grade Rag/app/ingestion/processor.py`
- [Vector search](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/services/retrieval/qdrant_service.py): `Interprise Grade Rag/app/services/retrieval/qdrant_service.py`
- [Embedding service](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/services/retrieval/embeddings.py): `Interprise Grade Rag/app/services/retrieval/embeddings.py`
- [Context ranking](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/app/services/retrieval/ranking_service.py): `Interprise Grade Rag/app/services/retrieval/ranking_service.py`

### Evaluation

- [Evaluation routes](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/routes.py): `Interprise Grade Rag/evals/routes.py`
- [Hosted evaluation](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/hosted.py): `Interprise Grade Rag/evals/hosted.py`
- [Query pipeline](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/pipeline.py): `Interprise Grade Rag/evals/pipeline.py`
- [Safety cases](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/guardrails_eval.py): `Interprise Grade Rag/evals/guardrails_eval.py`
- [Evaluation metrics](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/metrics.py): `Interprise Grade Rag/evals/metrics.py`
- [Evaluation reports](https://github.com/rs6739171-hash/enterprise_agentic_rag/blob/main/Interprise%20Grade%20Rag/evals/dashboard.py): `Interprise Grade Rag/evals/dashboard.py`

### Other components

- **Questioner**
- **Qdrant**
- **LLM provider**

## Connections

- Questioner → Chat UI: asks (evidence: `Interprise Grade Rag/ui/app.py`)
- Chat UI → FastAPI service: posts query (evidence: `Interprise Grade Rag/ui/app.py`)
- FastAPI service → Safety gate: checks request (evidence: `Interprise Grade Rag/app/main.py`)
- Safety gate → Safety rules: uses rules (evidence: `Interprise Grade Rag/app/guardrails/rails.py`)
- FastAPI service → LangGraph router: invokes graph (evidence: `Interprise Grade Rag/app/main.py`)
- LangGraph router → Request planner: routes requests (evidence: `Interprise Grade Rag/app/agents/graph.py`)
- LangGraph router → Context retriever: routes technical (evidence: `Interprise Grade Rag/app/agents/graph.py`)
- LangGraph router → Answer responder: routes answers (evidence: `Interprise Grade Rag/app/agents/graph.py`)
- Request planner → LLM provider: plans with (evidence: `Interprise Grade Rag/app/agents/nodes/planner.py`)
- Answer responder → LLM provider: generates with (evidence: `Interprise Grade Rag/app/agents/nodes/responder.py`)
- Context retriever → Vector search: searches (evidence: `Interprise Grade Rag/app/agents/nodes/retriever.py`)
- Context retriever → Context ranking: reranks results (evidence: `Interprise Grade Rag/app/agents/nodes/retriever.py`)
- Vector search → Embedding service: embeds query (evidence: `Interprise Grade Rag/app/services/retrieval/qdrant_service.py`)
- Vector search → Qdrant: queries vectors (evidence: `Interprise Grade Rag/app/services/retrieval/qdrant_service.py`)
- LangGraph router → Agent state: uses state (evidence: `Interprise Grade Rag/app/agents/graph.py`)
- FastAPI service → Evaluation routes: mounts routes (evidence: `Interprise Grade Rag/app/main.py`)
- Evaluation UI → Evaluation reports: displays reports (evidence: `Interprise Grade Rag/ui/app.py`)
- Evaluation routes → Hosted evaluation: starts evaluation (evidence: `Interprise Grade Rag/evals/routes.py`)
- Hosted evaluation → Query pipeline: queries samples (evidence: `Interprise Grade Rag/evals/hosted.py`)
- Query pipeline → FastAPI service: posts samples (evidence: `Interprise Grade Rag/evals/pipeline.py`)
- Hosted evaluation → Safety cases: runs safety cases (evidence: `Interprise Grade Rag/evals/hosted.py`)
- Hosted evaluation → LLM provider: scores answers (evidence: `Interprise Grade Rag/evals/hosted.py`)
- Evaluation routes → Evaluation reports: serves report (evidence: `Interprise Grade Rag/evals/routes.py`)
- Chat UI → Questioner: shows answer (evidence: `Interprise Grade Rag/ui/app.py`)
- Document ingestion → Embedding service: creates vectors (evidence: `Interprise Grade Rag/app/ingestion/processor.py`)
- Hosted evaluation → Evaluation metrics: computes metrics
