# rajaraman079k/mechguard architecture

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

- Interactive diagram: https://gitdiagram.com/rajaraman079k/mechguard
- Repository: https://github.com/rajaraman079k/mechguard

## Overview

MechGuard AI is a local Streamlit maintenance decision-support app. A user signs in, enters machine readings in the workspace, and receives a deterministic assessment with diagnostic evidence, severity, and actions. The documented workflow retrieves historical context, selects and executes diagnostic tools, evaluates combined signals, may replan, then generates and persists a report. Separate capabilities provide SQLite-backed machine memory, CSV validation and trend visualization, and local authentication. The implementation is a single file; relationships are based on the README, since the excerpts do not show most function calls or page wiring.

Main entry points: [`app.py`](https://github.com/rajaraman079k/mechguard/blob/main/app.py) (Signal Evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["User Workspace"]
  node_streamlit_ui["Streamlit Workspace<br/>[app.py]"]
  node_local_auth["Local Authentication<br/>[app.py]"]
  node_system_guide["System Guide<br/>[app.py]"]
end

subgraph group_diagnostics["Assessment Workflow"]
  node_readings["Machine Readings<br/>[app.py]"]
  node_tool_planner["Tool Selection<br/>[app.py]"]
  node_diagnostic_tools["Diagnostic Tools<br/>[app.py]"]
  node_signal_evaluation["Signal Evaluation<br/>[app.py]"]
  node_replanning["Severity Replanning<br/>[app.py]"]
  node_maintenance_report["Maintenance Report<br/>[app.py]"]
end

subgraph group_memory["Machine Memory"]
  node_history_lookup["Historical Context<br/>[app.py]"]
  node_sqlite_memory[("SQLite History<br/>[app.py]")]
end

subgraph group_data_tools["Data Tools"]
  node_csv_ingestion["CSV Ingestion<br/>[app.py]"]
  node_trend_visualization["Trend Views<br/>[app.py]"]
end

node_user(("Maintenance User"))

node_user -->|"uses"| node_streamlit_ui
node_user -->|"registers or signs in"| node_local_auth
node_streamlit_ui -->|"submits"| node_readings
node_readings -->|"retrieves context"| node_history_lookup
node_history_lookup -->|"informs selection"| node_tool_planner
node_tool_planner -->|"selects tools"| node_diagnostic_tools
node_diagnostic_tools -->|"supplies signals"| node_signal_evaluation
node_signal_evaluation -->|"may trigger"| node_replanning
node_signal_evaluation -->|"generates report"| node_maintenance_report
node_replanning -->|"adjusts assessment"| node_maintenance_report
node_history_lookup -->|"reads history"| node_sqlite_memory
node_maintenance_report -->|"persists assessment"| node_sqlite_memory
node_user -->|"uploads dataset"| node_csv_ingestion
node_csv_ingestion -->|"feeds trends"| node_trend_visualization
node_user -->|"views guide"| node_system_guide

click node_streamlit_ui "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_local_auth "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_readings "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_history_lookup "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_tool_planner "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_diagnostic_tools "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_signal_evaluation "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_replanning "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_maintenance_report "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_sqlite_memory "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_csv_ingestion "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_trend_visualization "https://github.com/rajaraman079k/mechguard/blob/main/app.py"
click node_system_guide "https://github.com/rajaraman079k/mechguard/blob/main/app.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_ui,node_local_auth,node_system_guide,node_user toneBlue
class node_readings,node_tool_planner,node_diagnostic_tools,node_signal_evaluation,node_replanning,node_maintenance_report toneAmber
class node_history_lookup,node_sqlite_memory toneMint
class node_csv_ingestion,node_trend_visualization toneRose
```

## Components

### User Workspace

- [Streamlit Workspace](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [Local Authentication](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [System Guide](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`

### Assessment Workflow

- [Machine Readings](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [Tool Selection](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [Diagnostic Tools](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [Signal Evaluation](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [Severity Replanning](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [Maintenance Report](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`

### Machine Memory

- [Historical Context](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [SQLite History](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`

### Data Tools

- [CSV Ingestion](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`
- [Trend Views](https://github.com/rajaraman079k/mechguard/blob/main/app.py): `app.py`

### Other components

- **Maintenance User**

## Connections

- Maintenance User → Streamlit Workspace: uses (evidence: `README.md`)
- Maintenance User → Local Authentication: registers or signs in (evidence: `README.md`)
- Streamlit Workspace → Machine Readings: submits (evidence: `README.md`)
- Machine Readings → Historical Context: retrieves context (evidence: `README.md`)
- Historical Context → Tool Selection: informs selection (evidence: `README.md`)
- Tool Selection → Diagnostic Tools: selects tools (evidence: `README.md`)
- Diagnostic Tools → Signal Evaluation: supplies signals (evidence: `README.md`)
- Signal Evaluation → Severity Replanning: may trigger (evidence: `README.md`)
- Signal Evaluation → Maintenance Report: generates report (evidence: `README.md`)
- Severity Replanning → Maintenance Report: adjusts assessment (evidence: `README.md`)
- Historical Context → SQLite History: reads history (evidence: `README.md`)
- Maintenance Report → SQLite History: persists assessment (evidence: `README.md`)
- Maintenance User → CSV Ingestion: uploads dataset (evidence: `README.md`)
- CSV Ingestion → Trend Views: feeds trends (evidence: `README.md`)
- Maintenance User → System Guide: views guide (evidence: `README.md`)
