# ankitprakash12c/kubernetes-prometheus-grafana architecture

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

- Interactive diagram: https://gitdiagram.com/ankitprakash12c/kubernetes-prometheus-grafana
- Repository: https://github.com/ankitprakash12c/kubernetes-prometheus-grafana

## Overview

PDF_Chat_Bot is a Streamlit medical-report assistant: a user uploads a PDF, then asks questions answered from its contents. The visible implementation uses PDF processing, sentence-based chunking, sentence-transformer embeddings, a FAISS similarity index, and Gemini answer generation. The UI calls the assistant constructor and query method; excerpts show indexing and model calls, but omit parts of the processing and retrieval implementation. The README documents no additional capabilities, so the graph focuses on the visible workflow.

Main entry points: [`BackendLogic.py`](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py) (PDF assistant), [`app.py`](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/app.py) (Streamlit interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit["Streamlit interface<br/>[app.py]"]
end

subgraph group_processing["Report processing"]
  node_pdf["PDF report"]
  node_pdf_processing["PDF processing<br/>[BackendLogic.py]"]
  node_chunking["Text chunking<br/>[BackendLogic.py]"]
  node_embeddings["Text embeddings<br/>[BackendLogic.py]"]
  node_faiss[("FAISS index<br/>[BackendLogic.py]")]
end

subgraph group_qa["Question answering"]
  node_assistant["PDF assistant<br/>[BackendLogic.py]"]
  node_retrieval["Similarity search<br/>[BackendLogic.py]"]
  node_gemini["Gemini API"]
end

node_user(("Report user"))

node_user -->|"uploads PDF"| node_streamlit
node_streamlit -->|"creates assistant"| node_assistant
node_assistant -.->|"processes report"| node_pdf_processing
node_pdf -.->|"supplies file"| node_pdf_processing
node_pdf_processing -.->|"extracts text"| node_chunking
node_chunking -->|"encodes chunks"| node_embeddings
node_embeddings -->|"adds vectors"| node_faiss
node_user -->|"asks question"| node_streamlit
node_streamlit -->|"calls query"| node_assistant
node_assistant -.->|"searches report"| node_retrieval
node_retrieval -.->|"queries index"| node_faiss
node_assistant -->|"generates answer"| node_gemini
node_assistant -->|"returns answer"| node_streamlit

click node_streamlit "https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/app.py"
click node_assistant "https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py"
click node_pdf_processing "https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py"
click node_chunking "https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py"
click node_embeddings "https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py"
click node_faiss "https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py"
click node_retrieval "https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.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_streamlit,node_user toneBlue
class node_pdf,node_pdf_processing,node_chunking,node_embeddings,node_faiss toneAmber
class node_assistant,node_retrieval,node_gemini toneMint
```

## Components

### User interface

- [Streamlit interface](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/app.py): `app.py`

### Report processing

- **PDF report**
- [PDF processing](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py): `BackendLogic.py`
- [Text chunking](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py): `BackendLogic.py`
- [Text embeddings](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py): `BackendLogic.py`
- [FAISS index](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py): `BackendLogic.py`

### Question answering

- [PDF assistant](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py): `BackendLogic.py`
- [Similarity search](https://github.com/ankitprakash12c/kubernetes-prometheus-grafana/blob/main/BackendLogic.py): `BackendLogic.py`
- **Gemini API**

### Other components

- **Report user**

## Connections

- Report user → Streamlit interface: uploads PDF (evidence: `app.py`)
- Streamlit interface → PDF assistant: creates assistant (evidence: `app.py`)
- PDF assistant → PDF processing: processes report (evidence: `BackendLogic.py`)
- PDF report → PDF processing: supplies file
- PDF processing → Text chunking: extracts text (evidence: `BackendLogic.py`)
- Text chunking → Text embeddings: encodes chunks (evidence: `BackendLogic.py`)
- Text embeddings → FAISS index: adds vectors (evidence: `BackendLogic.py`)
- Report user → Streamlit interface: asks question (evidence: `app.py`)
- Streamlit interface → PDF assistant: calls query (evidence: `app.py`)
- PDF assistant → Similarity search: searches report (evidence: `BackendLogic.py`)
- Similarity search → FAISS index: queries index (evidence: `BackendLogic.py`)
- PDF assistant → Gemini API: generates answer (evidence: `BackendLogic.py`)
- PDF assistant → Streamlit interface: returns answer (evidence: `app.py`)
