# shubhamkr07/opssentinel architecture

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

- Interactive diagram: https://gitdiagram.com/shubhamkr07/opssentinel
- Repository: https://github.com/shubhamkr07/opssentinel

## Overview

OpsSentinel is a logistics exception-orchestration system. The README-described workflow ingests events, processes and validates them, detects exceptions, decides and executes actions, and records resolution/state. The tree also contains a second, more feature-rich `opssentinel` runtime with agent orchestration, memory, logistics connectors, and geo/traffic/weather services; it is represented as a distinct branch. Some edges rely on the SOURCE INDEX or README rather than inspected implementation excerpts, so unsampled subsystem links are omitted where ownership is unclear.

Main entry points: [`opssentinel/runtime.py`](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/runtime.py) (Agent runtime), [`ops_sentinel/runtime.py`](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/runtime.py) (Workflow runtime), [`ops_sentinel/bus/event_bus.py`](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/bus/event_bus.py) (Topic event bus), [`opssentinel/agent/multi_agents.py`](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/agent/multi_agents.py) (Multi-agent system)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_event_flow["Event workflow"]
  node_entry["CLI entry<br/>[main.py]"]
  node_runtime["Workflow runtime<br/>[runtime.py]"]
  node_producer["Event producer<br/>[event_producer.py]"]
  node_processor["Event processor"]
  node_detector["Exception engine"]
  node_agent_service["Agent service<br/>[agent_service.py]"]
  node_action_service["Action service<br/>[action_service.py]"]
end

subgraph group_agent_runtime["Agent runtime"]
  node_advanced_runtime["Agent runtime<br/>[runtime.py]"]
  node_agent_team["Multi-agent system<br/>[multi_agents.py]"]
  node_agent_router["Agent router<br/>[agent_router.py]"]
  node_exception_engine["Exception analysis<br/>[engine.py]"]
  node_llm["LLM client<br/>[openai_client.py]"]
  node_mcp["Tool gateway<br/>[gateway.py]"]
  node_memory["Semantic memory<br/>[memory_service.py]"]
  node_memory_store[("Memory store<br/>[memory_store.py]")]
  node_processor2["Event processor<br/>[processor.py]"]
  node_producer2["Event simulator<br/>[simulator.py]"]
  node_actions["Action executor<br/>[executor.py]"]
  node_eval["Live evaluation"]
end

subgraph group_logistics_context["Logistics context"]
  node_connectors["TMS connector<br/>[tms.py]"]
  node_wms["WMS connector<br/>[wms.py]"]
  node_geo["Geo routing<br/>[route_service.py]"]
  node_traffic["Traffic risk"]
  node_weather["Weather service<br/>[weather_service.py]"]
end

subgraph group_shared_internals["Shared internals"]
  node_event_bus["Topic event bus<br/>[event_bus.py]"]
  node_contract["Event contract<br/>[event_contract.py]"]
  node_state_store[("Workflow state<br/>[state_store.py]")]
  node_state[("Runtime state<br/>[store.py]")]
  node_bus["Async event bus<br/>[bus.py]"]
  node_observability["Structured logging<br/>[logging.py]"]
end

node_operator(("Run operator"))

node_operator -->|"starts"| node_entry
node_entry -->|"runs"| node_runtime
node_runtime -->|"starts"| node_producer
node_runtime -->|"starts"| node_processor
node_runtime -->|"starts"| node_detector
node_runtime -->|"starts"| node_agent_service
node_runtime -->|"starts"| node_action_service
node_producer -->|"publishes events"| node_event_bus
node_processor -->|"consumes and publishes"| node_event_bus
node_detector -->|"consumes and publishes"| node_event_bus
node_agent_service -->|"consumes and publishes"| node_event_bus
node_action_service -->|"consumes and publishes"| node_event_bus
node_event_bus -->|"validates events"| node_contract
node_processor -->|"updates state"| node_state_store
node_detector -->|"records exceptions"| node_state_store
node_agent_service -->|"reads state"| node_state_store
node_action_service -->|"records actions"| node_state_store
node_advanced_runtime -->|"configures"| node_agent_team
node_advanced_runtime -->|"configures"| node_exception_engine
node_advanced_runtime -->|"configures"| node_processor2
node_advanced_runtime -.->|"configures"| node_producer2
node_agent_team -->|"requests proposals"| node_llm
node_agent_team -->|"uses tools"| node_mcp
node_agent_team -->|"reads and writes"| node_state
node_exception_engine -->|"uses memory"| node_memory
node_exception_engine -->|"updates exceptions"| node_state
node_memory -->|"persists records"| node_memory_store
node_memory -.->|"uses runtime state"| node_state
node_processor2 -->|"publishes events"| node_bus
node_producer2 -->|"publishes events"| node_bus
node_connectors -->|"publishes events"| node_bus
node_geo -.->|"uses route risk"| node_traffic
node_weather -->|"logs service activity"| node_observability
node_bus -->|"logs publishes"| node_observability
node_advanced_runtime -->|"configures"| node_actions
node_advanced_runtime -->|"configures"| node_eval

click node_entry "https://github.com/shubhamkr07/opssentinel/blob/main/main.py"
click node_runtime "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/runtime.py"
click node_producer "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/event_producer.py"
click node_processor "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/event_processor_service.py"
click node_detector "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/exception_engine.py"
click node_agent_service "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/agent_service.py"
click node_action_service "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/action_service.py"
click node_event_bus "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/bus/event_bus.py"
click node_contract "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/contracts/event_contract.py"
click node_state_store "https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/state_store/state_store.py"
click node_advanced_runtime "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/runtime.py"
click node_agent_team "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/agent/multi_agents.py"
click node_agent_router "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/orchestration/agent_router.py"
click node_exception_engine "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/exception/engine.py"
click node_llm "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/llm/openai_client.py"
click node_mcp "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/mcp/gateway.py"
click node_memory "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/memory/memory_service.py"
click node_memory_store "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/memory/memory_store.py"
click node_state "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/state/store.py"
click node_bus "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/event_bus/bus.py"
click node_processor2 "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/processor/processor.py"
click node_producer2 "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/producer/simulator.py"
click node_connectors "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/connectors/tms.py"
click node_wms "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/connectors/wms.py"
click node_geo "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/geo/route_service.py"
click node_traffic "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/traffic/route_risk_engine.py"
click node_weather "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/weather/weather_service.py"
click node_actions "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/actions/executor.py"
click node_eval "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/eval/live_eval_engine.py"
click node_observability "https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/observability/logging.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_entry,node_runtime,node_producer,node_processor,node_detector,node_agent_service,node_action_service toneBlue
class node_advanced_runtime,node_agent_team,node_agent_router,node_exception_engine,node_llm,node_mcp,node_memory,node_memory_store,node_processor2,node_producer2,node_actions,node_eval toneAmber
class node_connectors,node_wms,node_geo,node_traffic,node_weather toneMint
class node_event_bus,node_contract,node_state_store,node_state,node_bus,node_observability toneRose
class node_operator toneIndigo
```

## Components

### Event workflow

- [CLI entry](https://github.com/shubhamkr07/opssentinel/blob/main/main.py): `main.py`
- [Workflow runtime](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/runtime.py): `ops_sentinel/runtime.py`
- [Event producer](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/event_producer.py): `ops_sentinel/services/event_producer.py`
- [Event processor](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/event_processor_service.py): `ops_sentinel/services/event_processor_service.py`
- [Exception engine](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/exception_engine.py): `ops_sentinel/services/exception_engine.py`
- [Agent service](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/agent_service.py): `ops_sentinel/services/agent_service.py`
- [Action service](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/services/action_service.py): `ops_sentinel/services/action_service.py`

### Agent runtime

- [Agent runtime](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/runtime.py): `opssentinel/runtime.py`
- [Multi-agent system](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/agent/multi_agents.py): `opssentinel/agent/multi_agents.py`
- [Agent router](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/orchestration/agent_router.py): `opssentinel/services/orchestration/agent_router.py`
- [Exception analysis](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/exception/engine.py): `opssentinel/exception/engine.py`
- [LLM client](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/llm/openai_client.py): `opssentinel/llm/openai_client.py`
- [Tool gateway](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/mcp/gateway.py): `opssentinel/mcp/gateway.py`
- [Semantic memory](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/memory/memory_service.py): `opssentinel/services/memory/memory_service.py`
- [Memory store](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/memory/memory_store.py): `opssentinel/services/memory/memory_store.py`
- [Event processor](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/processor/processor.py): `opssentinel/processor/processor.py`
- [Event simulator](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/producer/simulator.py): `opssentinel/producer/simulator.py`
- [Action executor](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/actions/executor.py): `opssentinel/actions/executor.py`
- [Live evaluation](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/eval/live_eval_engine.py): `opssentinel/services/eval/live_eval_engine.py`

### Logistics context

- [TMS connector](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/connectors/tms.py): `opssentinel/connectors/tms.py`
- [WMS connector](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/connectors/wms.py): `opssentinel/connectors/wms.py`
- [Geo routing](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/geo/route_service.py): `opssentinel/services/geo/route_service.py`
- [Traffic risk](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/traffic/route_risk_engine.py): `opssentinel/services/traffic/route_risk_engine.py`
- [Weather service](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/services/weather/weather_service.py): `opssentinel/services/weather/weather_service.py`

### Shared internals

- [Topic event bus](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/bus/event_bus.py): `ops_sentinel/bus/event_bus.py`
- [Event contract](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/contracts/event_contract.py): `ops_sentinel/contracts/event_contract.py`
- [Workflow state](https://github.com/shubhamkr07/opssentinel/blob/main/ops_sentinel/state_store/state_store.py): `ops_sentinel/state_store/state_store.py`
- [Runtime state](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/state/store.py): `opssentinel/state/store.py`
- [Async event bus](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/event_bus/bus.py): `opssentinel/event_bus/bus.py`
- [Structured logging](https://github.com/shubhamkr07/opssentinel/blob/main/opssentinel/observability/logging.py): `opssentinel/observability/logging.py`

### Other components

- **Run operator**

## Connections

- Run operator → CLI entry: starts (evidence: `README.md`)
- CLI entry → Workflow runtime: runs (evidence: `main.py`)
- Workflow runtime → Event producer: starts (evidence: `ops_sentinel/runtime.py`)
- Workflow runtime → Event processor: starts (evidence: `ops_sentinel/runtime.py`)
- Workflow runtime → Exception engine: starts (evidence: `ops_sentinel/runtime.py`)
- Workflow runtime → Agent service: starts (evidence: `ops_sentinel/runtime.py`)
- Workflow runtime → Action service: starts (evidence: `ops_sentinel/runtime.py`)
- Event producer → Topic event bus: publishes events (evidence: `ops_sentinel/services/event_producer.py`)
- Event processor → Topic event bus: consumes and publishes (evidence: `ops_sentinel/services/event_processor_service.py`)
- Exception engine → Topic event bus: consumes and publishes (evidence: `ops_sentinel/services/exception_engine.py`)
- Agent service → Topic event bus: consumes and publishes (evidence: `ops_sentinel/services/agent_service.py`)
- Action service → Topic event bus: consumes and publishes (evidence: `ops_sentinel/services/action_service.py`)
- Topic event bus → Event contract: validates events (evidence: `ops_sentinel/bus/event_bus.py`)
- Event processor → Workflow state: updates state (evidence: `ops_sentinel/services/event_processor_service.py`)
- Exception engine → Workflow state: records exceptions (evidence: `ops_sentinel/services/exception_engine.py`)
- Agent service → Workflow state: reads state (evidence: `ops_sentinel/services/agent_service.py`)
- Action service → Workflow state: records actions (evidence: `ops_sentinel/services/action_service.py`)
- Agent runtime → Multi-agent system: configures (evidence: `opssentinel/runtime.py`)
- Agent runtime → Exception analysis: configures (evidence: `opssentinel/runtime.py`)
- Agent runtime → Event processor: configures (evidence: `opssentinel/runtime.py`)
- Agent runtime → Event simulator: configures
- Multi-agent system → LLM client: requests proposals (evidence: `opssentinel/agent/multi_agents.py`)
- Multi-agent system → Tool gateway: uses tools (evidence: `opssentinel/agent/multi_agents.py`)
- Multi-agent system → Runtime state: reads and writes (evidence: `opssentinel/agent/multi_agents.py`)
- Exception analysis → Semantic memory: uses memory (evidence: `opssentinel/exception/engine.py`)
- Exception analysis → Runtime state: updates exceptions (evidence: `opssentinel/exception/engine.py`)
- Semantic memory → Memory store: persists records (evidence: `opssentinel/services/memory/memory_service.py`)
- Semantic memory → Runtime state: uses runtime state
- Event processor → Async event bus: publishes events (evidence: `opssentinel/processor/processor.py`)
- Event simulator → Async event bus: publishes events (evidence: `opssentinel/producer/simulator.py`)
- TMS connector → Async event bus: publishes events (evidence: `opssentinel/connectors/tms.py`)
- Geo routing → Traffic risk: uses route risk
- Weather service → Structured logging: logs service activity (evidence: `opssentinel/services/weather/weather_service.py`)
- Async event bus → Structured logging: logs publishes (evidence: `opssentinel/event_bus/bus.py`)
- Agent runtime → Action executor: configures (evidence: `opssentinel/runtime.py`)
- Agent runtime → Live evaluation: configures (evidence: `opssentinel/runtime.py`)
