# gayatri-n-gaikwad/industrial-knowledge-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/gayatri-n-gaikwad/industrial-knowledge-assistant
- Repository: https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant

## Overview

OpsBrain is a Streamlit application that turns industrial PDFs into searchable, AI-assisted operational knowledge. Engineers upload and categorize documents; ingestion extracts and chunks text, stores embeddings in ChromaDB, and extracts entities for the knowledge graph. From the UI, users can ask grounded questions, audit a document for compliance and download a report, review incident patterns, explore shared entities, and view library metrics. The README documents major capabilities; sampled source excerpts establish several implementation links, while unsampled UI and feature details rely on documented relationships.

Main entry points: [`app.py`](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/app.py) (Application UI), [`ingestion.py`](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/ingestion.py) (PDF ingestion), [`rag.py`](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/rag.py) (Knowledge copilot), [`compliance.py`](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/compliance.py) (Compliance audit)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Streamlit experience"]
  node_app["Application UI<br/>[app.py]"]
  node_dashboard["Operations dashboard<br/>[dashboard.py]"]
end

subgraph group_knowledge["Knowledge ingestion"]
  node_ingestion["PDF ingestion<br/>[ingestion.py]"]
  node_entities["Entity extraction<br/>[ingestion.py]"]
  node_vectorstore[("Vector store")]
  node_entityfile[("Entity store")]
end

subgraph group_analysis["Operational analysis"]
  node_copilot["Knowledge copilot<br/>[rag.py]"]
  node_compliance["Compliance audit<br/>[compliance.py]"]
  node_lessons["Incident patterns<br/>[lessons.py]"]
  node_report["Audit report PDF"]
end

subgraph group_insights["Knowledge insights"]
  node_graph["Knowledge graph<br/>[graph.py]"]
end

node_engineer(("Plant engineer"))
node_gemini{{"Gemini API"}}

node_engineer -->|"uses"| node_app
node_app -->|"uploads PDFs"| node_ingestion
node_ingestion -->|"stores chunks"| node_vectorstore
node_ingestion -->|"extracts entities"| node_entities
node_entities -->|"updates"| node_entityfile
node_ingestion -->|"embeds text"| node_gemini
node_entities -->|"extracts with"| node_gemini
node_app -->|"asks questions"| node_copilot
node_copilot -->|"retrieves chunks"| node_vectorstore
node_copilot -->|"generates answers"| node_gemini
node_app -->|"runs audits"| node_compliance
node_compliance -->|"reads document text"| node_vectorstore
node_compliance -->|"evaluates checklist"| node_gemini
node_app -->|"creates audit PDF"| node_report
node_app -->|"analyzes incidents"| node_lessons
node_lessons -->|"fetches incidents"| node_vectorstore
node_lessons -->|"synthesizes patterns"| node_gemini
node_app -->|"renders metrics"| node_dashboard
node_app -->|"renders graph view"| node_graph
node_graph -->|"uses entity data"| node_entityfile

click node_app "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/app.py"
click node_dashboard "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/dashboard.py"
click node_ingestion "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/ingestion.py"
click node_entities "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/ingestion.py"
click node_entityfile "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/entities_store.json"
click node_copilot "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/rag.py"
click node_compliance "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/compliance.py"
click node_lessons "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/lessons.py"
click node_report "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/report_generator.py"
click node_graph "https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/graph.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_app,node_dashboard toneBlue
class node_ingestion,node_entities,node_vectorstore,node_entityfile toneAmber
class node_copilot,node_compliance,node_lessons,node_report,node_gemini toneMint
class node_graph toneRose
class node_engineer toneIndigo
```

## Components

### Streamlit experience

- [Application UI](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/app.py): `app.py`
- [Operations dashboard](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/dashboard.py): `dashboard.py`

### Knowledge ingestion

- [PDF ingestion](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/ingestion.py): `ingestion.py`
- [Entity extraction](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/ingestion.py): `ingestion.py`
- **Vector store**
- [Entity store](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/entities_store.json): `entities_store.json`

### Operational analysis

- [Knowledge copilot](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/rag.py): `rag.py`
- [Compliance audit](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/compliance.py): `compliance.py`
- [Incident patterns](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/lessons.py): `lessons.py`
- [Audit report PDF](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/report_generator.py): `report_generator.py`

### Knowledge insights

- [Knowledge graph](https://github.com/gayatri-n-gaikwad/industrial-knowledge-assistant/blob/main/graph.py): `graph.py`

### Other components

- **Plant engineer**
- **Gemini API**

## Connections

- Plant engineer → Application UI: uses (evidence: `README.md`)
- Application UI → PDF ingestion: uploads PDFs (evidence: `app.py`)
- PDF ingestion → Vector store: stores chunks (evidence: `ingestion.py`)
- PDF ingestion → Entity extraction: extracts entities (evidence: `ingestion.py`)
- Entity extraction → Entity store: updates (evidence: `ingestion.py`)
- PDF ingestion → Gemini API: embeds text (evidence: `README.md`)
- Entity extraction → Gemini API: extracts with (evidence: `ingestion.py`)
- Application UI → Knowledge copilot: asks questions (evidence: `app.py`)
- Knowledge copilot → Vector store: retrieves chunks (evidence: `rag.py`)
- Knowledge copilot → Gemini API: generates answers (evidence: `rag.py`)
- Application UI → Compliance audit: runs audits (evidence: `app.py`)
- Compliance audit → Vector store: reads document text (evidence: `compliance.py`)
- Compliance audit → Gemini API: evaluates checklist (evidence: `README.md`)
- Application UI → Audit report PDF: creates audit PDF (evidence: `README.md`)
- Application UI → Incident patterns: analyzes incidents (evidence: `app.py`)
- Incident patterns → Vector store: fetches incidents (evidence: `lessons.py`)
- Incident patterns → Gemini API: synthesizes patterns (evidence: `lessons.py`)
- Application UI → Operations dashboard: renders metrics (evidence: `app.py`)
- Application UI → Knowledge graph: renders graph view (evidence: `app.py`)
- Knowledge graph → Entity store: uses entity data (evidence: `graph.py`)
