# intel/predictive-maintenance-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/intel/predictive-maintenance-pipeline
- Repository: https://github.com/intel/predictive-maintenance-pipeline

## Overview

PACE is a proof-of-concept predictive-maintenance system for pipeline defects. Its main workflow runs image, video, or sensor inference, stores results in SQLite, then supports agent-assisted analysis and chat. The README also documents visualization, policy filtering, evidence, ticketing, and optional text-to-SQL/LLM modes. Some links below rely on README statements or the source index; unsampled implementations and their internal call paths are not inferred.

Main entry points: [`src/inference/inference_runner.py`](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/inference_runner.py) (Inference runner), [`src/agents/meta_agent.py`](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/meta_agent.py) (Meta-agent), [`web_app/app.py`](https://github.com/intel/predictive-maintenance-pipeline/blob/main/web_app/app.py) (Web application), [`src/utility/sqlite_client.py`](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/utility/sqlite_client.py) (SQLite detections)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference &amp; ingestion"]
  node_pipeline["Pipeline runner"]
  node_runner["Inference runner"]
  node_dispatch["Handler dispatch<br/>[dispatcher.py]"]
  node_handlers["Inference handlers"]
  node_visualization["Visualization<br/>[visualization.py]"]
  node_output["Output writer<br/>[output_writer.py]"]
  node_cleanup["Database cleanup<br/>[clean_slate.py]"]
end

subgraph group_data["Storage &amp; query"]
  node_sqlite[("SQLite detections<br/>[sqlite_client.py]")]
  node_sql_executor["Text-to-SQL executor"]
  node_backend["Agent database backend"]
end

subgraph group_agents["Agent analysis"]
  node_graph["Agent graph builder<br/>[graph_builder.py]"]
  node_meta["Meta-agent<br/>[meta_agent.py]"]
  node_policy["Policy agent<br/>[policy_agent.py]"]
  node_filter["Policy filtering<br/>[policy_filter.py]"]
  node_analysis["Analysis agent<br/>[analysis_agent.py]"]
  node_evidence["Evidence agent<br/>[evidence_agent.py]"]
  node_corrosion["Corrosion agent<br/>[corrosion_agent.py]"]
  node_ticketing["Ticketing agent<br/>[ticketing_agent.py]"]
  node_llm["LLM client<br/>[openvino_llm.py]"]
  node_cache["Response cache<br/>[response_cache.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_web["Web application<br/>[app.py]"]
  node_chat["Interactive chat"]
  node_intent["Chat intent routing<br/>[chat_intent.py]"]
end

node_operator(("Operator"))

node_operator -->|"starts pipeline"| node_pipeline
node_pipeline -->|"runs inference"| node_runner
node_runner -->|"dispatches handlers"| node_dispatch
node_dispatch -.->|"selects handler"| node_handlers
node_runner -->|"writes outputs"| node_output
node_runner -->|"generates visualizations"| node_visualization
node_runner -->|"cleans database"| node_cleanup
node_runner -->|"stores detections"| node_sqlite
node_output -.->|"writes detections"| node_sqlite
node_sqlite -->|"serves SQL queries"| node_sql_executor
node_backend -->|"uses client"| node_sqlite
node_operator -->|"uses interface"| node_web
node_web -->|"launches pipeline"| node_pipeline
node_web -->|"routes questions"| node_intent
node_web -->|"creates tickets"| node_ticketing
node_operator -->|"asks questions"| node_chat
node_chat -->|"classifies questions"| node_intent
node_graph -->|"includes coordinator"| node_meta
node_meta -->|"coordinates agents"| node_policy
node_meta -->|"coordinates agents"| node_analysis
node_meta -->|"coordinates agents"| node_evidence
node_meta -.->|"coordinates agents"| node_corrosion
node_analysis -->|"filters detections"| node_filter
node_evidence -->|"filters detections"| node_filter
node_llm -->|"checks and stores"| node_cache
node_sql_executor -->|"generates SQL"| node_llm

click node_pipeline "https://github.com/intel/predictive-maintenance-pipeline/blob/main/run_complete_pipeline.py"
click node_runner "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/inference_runner.py"
click node_dispatch "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/dispatcher.py"
click node_handlers "https://github.com/intel/predictive-maintenance-pipeline/tree/main/src/inference/handlers"
click node_visualization "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/visualization.py"
click node_output "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/output_writer.py"
click node_cleanup "https://github.com/intel/predictive-maintenance-pipeline/blob/main/scripts/clean_slate.py"
click node_sqlite "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/utility/sqlite_client.py"
click node_sql_executor "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/sql_query_executor.py"
click node_backend "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/database_backend.py"
click node_graph "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/graph_builder.py"
click node_meta "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/meta_agent.py"
click node_policy "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/policy_agent.py"
click node_filter "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/policy_filter.py"
click node_analysis "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/analysis_agent.py"
click node_evidence "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/evidence_agent.py"
click node_corrosion "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/corrosion_agent.py"
click node_ticketing "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/ticketing_agent.py"
click node_llm "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/openvino_llm.py"
click node_cache "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/response_cache.py"
click node_web "https://github.com/intel/predictive-maintenance-pipeline/blob/main/web_app/app.py"
click node_chat "https://github.com/intel/predictive-maintenance-pipeline/blob/main/interactive_chat.py"
click node_intent "https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/utility/chat_intent.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_pipeline,node_runner,node_dispatch,node_handlers,node_visualization,node_output,node_cleanup toneBlue
class node_sqlite,node_sql_executor,node_backend toneAmber
class node_graph,node_meta,node_policy,node_filter,node_analysis,node_evidence,node_corrosion,node_ticketing,node_llm,node_cache toneMint
class node_web,node_chat,node_intent toneRose
class node_operator toneIndigo
```

## Components

### Inference & ingestion

- [Pipeline runner](https://github.com/intel/predictive-maintenance-pipeline/blob/main/run_complete_pipeline.py): `run_complete_pipeline.py`
- [Inference runner](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/inference_runner.py): `src/inference/inference_runner.py`
- [Handler dispatch](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/dispatcher.py): `src/inference/dispatcher.py`
- [Inference handlers](https://github.com/intel/predictive-maintenance-pipeline/tree/main/src/inference/handlers): `src/inference/handlers`
- [Visualization](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/visualization.py): `src/inference/visualization.py`
- [Output writer](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/inference/output_writer.py): `src/inference/output_writer.py`
- [Database cleanup](https://github.com/intel/predictive-maintenance-pipeline/blob/main/scripts/clean_slate.py): `scripts/clean_slate.py`

### Storage & query

- [SQLite detections](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/utility/sqlite_client.py): `src/utility/sqlite_client.py`
- [Text-to-SQL executor](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/sql_query_executor.py): `src/agents/utility/sql_query_executor.py`
- [Agent database backend](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/database_backend.py): `src/agents/utility/database_backend.py`

### Agent analysis

- [Agent graph builder](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/graph_builder.py): `src/agents/graph_builder.py`
- [Meta-agent](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/meta_agent.py): `src/agents/meta_agent.py`
- [Policy agent](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/policy_agent.py): `src/agents/policy_agent.py`
- [Policy filtering](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/policy_filter.py): `src/agents/utility/policy_filter.py`
- [Analysis agent](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/analysis_agent.py): `src/agents/analysis_agent.py`
- [Evidence agent](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/evidence_agent.py): `src/agents/evidence_agent.py`
- [Corrosion agent](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/corrosion_agent.py): `src/agents/corrosion_agent.py`
- [Ticketing agent](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/ticketing_agent.py): `src/agents/ticketing_agent.py`
- [LLM client](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/openvino_llm.py): `src/agents/utility/openvino_llm.py`
- [Response cache](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/agents/utility/response_cache.py): `src/agents/utility/response_cache.py`

### User interfaces

- [Web application](https://github.com/intel/predictive-maintenance-pipeline/blob/main/web_app/app.py): `web_app/app.py`
- [Interactive chat](https://github.com/intel/predictive-maintenance-pipeline/blob/main/interactive_chat.py): `interactive_chat.py`
- [Chat intent routing](https://github.com/intel/predictive-maintenance-pipeline/blob/main/src/utility/chat_intent.py): `src/utility/chat_intent.py`

### Other components

- **Operator**

## Connections

- Operator → Pipeline runner: starts pipeline (evidence: `README.md`)
- Pipeline runner → Inference runner: runs inference (evidence: `run_complete_pipeline.py`)
- Inference runner → Handler dispatch: dispatches handlers (evidence: `src/inference/inference_runner.py`)
- Handler dispatch → Inference handlers: selects handler
- Inference runner → Output writer: writes outputs (evidence: `src/inference/inference_runner.py`)
- Inference runner → Visualization: generates visualizations (evidence: `src/inference/inference_runner.py`)
- Inference runner → Database cleanup: cleans database (evidence: `src/inference/inference_runner.py`)
- Inference runner → SQLite detections: stores detections (evidence: `src/inference/inference_runner.py`)
- Output writer → SQLite detections: writes detections
- SQLite detections → Text-to-SQL executor: serves SQL queries (evidence: `src/agents/utility/sql_query_executor.py`)
- Agent database backend → SQLite detections: uses client (evidence: `src/agents/utility/database_backend.py`)
- Operator → Web application: uses interface (evidence: `README.md`)
- Web application → Pipeline runner: launches pipeline (evidence: `web_app/app.py`)
- Web application → Chat intent routing: routes questions (evidence: `web_app/app.py`)
- Web application → Ticketing agent: creates tickets (evidence: `web_app/app.py`)
- Operator → Interactive chat: asks questions (evidence: `interactive_chat.py`)
- Interactive chat → Chat intent routing: classifies questions (evidence: `interactive_chat.py`)
- Agent graph builder → Meta-agent: includes coordinator (evidence: `src/agents/graph_builder.py`)
- Meta-agent → Policy agent: coordinates agents (evidence: `README.md`)
- Meta-agent → Analysis agent: coordinates agents (evidence: `README.md`)
- Meta-agent → Evidence agent: coordinates agents (evidence: `README.md`)
- Meta-agent → Corrosion agent: coordinates agents
- Analysis agent → Policy filtering: filters detections (evidence: `src/agents/analysis_agent.py`)
- Evidence agent → Policy filtering: filters detections (evidence: `src/agents/evidence_agent.py`)
- LLM client → Response cache: checks and stores (evidence: `src/agents/utility/openvino_llm.py`)
- Text-to-SQL executor → LLM client: generates SQL (evidence: `src/agents/utility/sql_query_executor.py`)
