# harshada-javeri/multiagent-ops-orchestrator architecture

> Architecture diagram of the GitHub repository harshada-javeri/multiagent-ops-orchestrator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshada-javeri/multiagent-ops-orchestrator
- Repository: https://github.com/harshada-javeri/multiagent-ops-orchestrator

## Overview

#### Purpose and Entry Points
Python 3.10+ multi-agent QAOps system for CI/CD failure triage, remediation planning, ticket creation, and optionally approved execution. Primary programmatic pipeline is `main_orchestrator.py`; alternate interfaces are CLI (`predict.py`), Flask API (`serve.py`), and observability-integrated execution (`integrated_orchestrator.py`). Training artifacts are produced/used through `train.py`, `models/agent_config.json`, and `models/agents.pkl`.

#### Event Intake and Routing
The event boundary normalizes CI failure inputs before analysis. `events/event_ingestion.py` accepts supplied logs or fetch-oriented source events; `events/event_schema.py` defines event representation; `events/event_router.py` dispatches the event into the workflow. GitHub Actions is the fallback/demo source, while Jenkins is the primary CI integration.
Paths: `events/event_ingestion.py`, `events/event_router.py`, `tools/github_tool.py`.

#### Workflow Orchestration and State
Two orchestration styles coexist: direct sequential orchestration and a graph/state-driven workflow. The graph runner coordinates stages and state transitions; persisted state supports workflow continuity. This is the main control boundary between ingress and agent execution.
Paths: `main_orchestrator.py`, `orchestration/workflow_graph.py`, `orchestration/workflow_runner.py`, `orchestration/state_manager.py`.

#### Diagnostic and Reasoning Agents
Agents communicate through a shared base abstraction and structured message-like outputs. Diagnostics extracts failed tests, error patterns, and metadata from raw logs. Root-cause analysis combines diagnostic output, persisted historical memory, and an LLM to form hypotheses and confidence. Model/provider selection is centralized rather than embedded in individual integrations.
Paths: `agents/base_agent.py`, `agents/test_diagnostics_agent.py`, `agents/root_cause_agent.py`, `utils/llm_factory.py`, `utils/memory_handler.py`.

#### Planning, Ticketing, and Execution Gate
The planner turns root-cause output into prioritized remediation actions and creates an issue. Execution is explicitly downstream of planning: high-confidence approved actions may execute, while lower-confidence actions remain `pending_approval`. Ticket backend selection favors Jira and falls back to GitHub Issues when Jira is unavailable.
Paths: `agents/action_planner_agent.py`, `agents/execution_agent.py`, `tools/jira_tool.py`, `tools/github_tool.py`.

#### External Systems and Tool Boundary
Tool adapters isolate external API access from agents: Jenkins supplies CI logs, Grafana can contribute metrics, Jira manages tickets, and GitHub supports Actions log retrieval and issue fallback. Credentials and endpoint configuration are environment-driven. LLM support includes Google Gemini and OpenAI models according to the documented deployment/runtime configuration.
Paths: `tools/tool_registry.py`, `tools/jenkins_tool.py`, `tools/grafana_tool.py`, `.env.example`.

#### Observability and Deployment
Tracing spans orchestration, agent calls, LLM calls, and tool invocations, using Monocle telemetry with traces sent to Okahu. The service can run directly, in Docker/Compose, or through AWS AgentCore-oriented infrastructure provisioning.
Paths: `observability.py`, `integrations/okahu_integration.py`, `DockerFile`, `docker-compose.yml`, `deployment/agentcore.tf`.

Main entry points: [`agents/action_planner_agent.py`](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/action_planner_agent.py) (Action planner), [`tools/tool_registry.py`](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/tool_registry.py) (Tool registry), [`agents/root_cause_agent.py`](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/root_cause_agent.py) (Root-cause analysis), [`agents/base_agent.py`](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/base_agent.py) (Shared agent base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; Intake"]
  node_interfaces["Pipeline &amp; interfaces<br/>entrypoints"]
  node_ingestion["Event ingestion<br/>event boundary<br/>[event_ingestion.py]"]
  node_router["Event router<br/>workflow dispatch<br/>[event_router.py]"]
end

subgraph group_workflow["Workflow Control"]
  node_workflow_graph["Workflow graph<br/>state graph<br/>[workflow_graph.py]"]
  node_workflow_runner["Workflow runner<br/>orchestrator<br/>[workflow_runner.py]"]
  node_state[("Persisted workflow state<br/>state manager<br/>[state_manager.py]")]
end

subgraph group_agents["Agent Reasoning"]
  node_base_agent["Shared agent base<br/>agent abstraction<br/>[base_agent.py]"]
  node_diagnostics["Test diagnostics<br/>diagnostic agent"]
  node_root_cause["Root-cause analysis<br/>reasoning agent"]
  node_memory[("Historical memory<br/>memory store<br/>[memory_handler.py]")]
  node_llm_factory{{"LLM provider factory<br/>model gateway<br/>[llm_factory.py]"}}
  node_planner["Action planner<br/>planning agent"]
  node_execution["Approved execution<br/>execution agent<br/>[execution_agent.py]"]
end

subgraph group_tools["Tool Adapters"]
  node_tool_registry{{"Tool registry<br/>tool boundary<br/>[tool_registry.py]"}}
  node_jenkins["Jenkins<br/>primary CI<br/>[jenkins_tool.py]"]
  node_github["GitHub Actions &amp; Issues<br/>CI and ticket fallback<br/>[github_tool.py]"]
  node_grafana["Grafana<br/>metrics source<br/>[grafana_tool.py]"]
  node_jira["Jira<br/>ticket backend<br/>[jira_tool.py]"]
end

subgraph group_ops["Observability &amp; Deployment"]
  node_telemetry["Monocle to Okahu<br/>telemetry pipeline<br/>[observability.py]"]
  node_deployment["Runtime deployment<br/>Docker &amp; AWS AgentCore<br/>[agentcore.tf]"]
end

node_interfaces -->|"submits CI failure"| node_ingestion
node_ingestion -->|"normalized event"| node_router
node_jenkins -->|"primary logs"| node_ingestion
node_github -.->|"fallback/demo logs"| node_ingestion
node_router -->|"dispatches"| node_workflow_graph
node_workflow_graph -->|"defines stages"| node_workflow_runner
node_workflow_runner -->|"reads and persists"| node_state
node_workflow_runner -->|"runs diagnostic stage"| node_diagnostics
node_base_agent -.->|"base abstraction"| node_diagnostics
node_base_agent -.->|"base abstraction"| node_root_cause
node_base_agent -.->|"base abstraction"| node_planner
node_diagnostics -->|"findings"| node_root_cause
node_memory -->|"historical context"| node_root_cause
node_llm_factory -->|"LLM access"| node_root_cause
node_root_cause -->|"hypotheses and confidence"| node_planner
node_planner -->|"creates preferred ticket"| node_jira
node_planner -.->|"issue fallback"| node_github
node_planner -->|"approved high-confidence actions"| node_execution
node_planner -->|"pending approval status"| node_state
node_tool_registry -->|"adapter"| node_jenkins
node_tool_registry -->|"adapter"| node_github
node_tool_registry -->|"adapter"| node_grafana
node_tool_registry -->|"adapter"| node_jira
node_workflow_runner -.->|"workflow spans"| node_telemetry
node_base_agent -.->|"agent spans"| node_telemetry
node_tool_registry -.->|"tool spans"| node_telemetry
node_deployment -.->|"hosts runtime"| node_interfaces

click node_interfaces "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/main_orchestrator.py"
click node_ingestion "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/events/event_ingestion.py"
click node_router "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/events/event_router.py"
click node_workflow_graph "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/orchestration/workflow_graph.py"
click node_workflow_runner "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/orchestration/workflow_runner.py"
click node_state "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/orchestration/state_manager.py"
click node_base_agent "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/base_agent.py"
click node_diagnostics "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/test_diagnostics_agent.py"
click node_root_cause "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/root_cause_agent.py"
click node_memory "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/utils/memory_handler.py"
click node_llm_factory "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/utils/llm_factory.py"
click node_planner "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/action_planner_agent.py"
click node_execution "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/execution_agent.py"
click node_tool_registry "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/tool_registry.py"
click node_jenkins "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/jenkins_tool.py"
click node_github "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/github_tool.py"
click node_grafana "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/grafana_tool.py"
click node_jira "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/jira_tool.py"
click node_telemetry "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/observability.py"
click node_deployment "https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/deployment/agentcore.tf"

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_interfaces,node_ingestion,node_router toneBlue
class node_workflow_graph,node_workflow_runner,node_state toneAmber
class node_base_agent,node_diagnostics,node_root_cause,node_memory,node_llm_factory,node_planner,node_execution toneMint
class node_tool_registry,node_jenkins,node_github,node_grafana,node_jira toneRose
class node_telemetry,node_deployment toneIndigo
```

## Components

### Entry & Intake

- [Pipeline & interfaces](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/main_orchestrator.py): entrypoints · Programmatic orchestrator plus CLI, API, and integrated execution. · `main_orchestrator.py`
- [Event ingestion](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/events/event_ingestion.py): event boundary · Normalizes supplied logs and source events. · `events/event_ingestion.py`
- [Event router](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/events/event_router.py): workflow dispatch · `events/event_router.py`

### Workflow Control

- [Workflow graph](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/orchestration/workflow_graph.py): state graph · Defines graph-driven stages and transitions. · `orchestration/workflow_graph.py`
- [Workflow runner](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/orchestration/workflow_runner.py): orchestrator · Runs the state-driven workflow. · `orchestration/workflow_runner.py`
- [Persisted workflow state](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/orchestration/state_manager.py): state manager · Maintains continuity across workflow stages. · `orchestration/state_manager.py`

### Agent Reasoning

- [Shared agent base](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/base_agent.py): agent abstraction · Provides common structured agent communication. · `agents/base_agent.py`
- [Test diagnostics](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/test_diagnostics_agent.py): diagnostic agent · Extracts failed tests, error patterns, and metadata. · `agents/test_diagnostics_agent.py`
- [Root-cause analysis](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/root_cause_agent.py): reasoning agent · Builds hypotheses and confidence from diagnostics and history. · `agents/root_cause_agent.py`
- [Historical memory](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/utils/memory_handler.py): memory store · `utils/memory_handler.py`
- [LLM provider factory](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/utils/llm_factory.py): model gateway · Centralizes Gemini and OpenAI selection. · `utils/llm_factory.py`
- [Action planner](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/action_planner_agent.py): planning agent · Prioritizes remediation actions and initiates ticket creation. · `agents/action_planner_agent.py`
- [Approved execution](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/agents/execution_agent.py): execution agent · Executes only high-confidence approved actions; others await approval. · `agents/execution_agent.py`

### Tool Adapters

- [Tool registry](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/tool_registry.py): tool boundary · Isolates external API adapters from agents. · `tools/tool_registry.py`
- [Jenkins](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/jenkins_tool.py): primary CI · Primary source of CI logs. · `tools/jenkins_tool.py`
- [GitHub Actions & Issues](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/github_tool.py): CI and ticket fallback · Demo log source and fallback issue backend. · `tools/github_tool.py`
- [Grafana](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/grafana_tool.py): metrics source · `tools/grafana_tool.py`
- [Jira](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/tools/jira_tool.py): ticket backend · Preferred issue backend. · `tools/jira_tool.py`

### Observability & Deployment

- [Monocle to Okahu](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/observability.py): telemetry pipeline · Captures orchestration, agent, LLM, and tool spans. · `observability.py`
- [Runtime deployment](https://github.com/harshada-javeri/multiagent-ops-orchestrator/blob/main/deployment/agentcore.tf): Docker & AWS AgentCore · Supports direct, Compose, and AgentCore-oriented deployment. · `deployment/agentcore.tf`

## Connections

- Pipeline & interfaces → Event ingestion: submits CI failure
- Event ingestion → Event router: normalized event
- Jenkins → Event ingestion: primary logs
- GitHub Actions & Issues → Event ingestion: fallback/demo logs
- Event router → Workflow graph: dispatches
- Workflow graph → Workflow runner: defines stages
- Workflow runner → Persisted workflow state: reads and persists
- Workflow runner → Test diagnostics: runs diagnostic stage
- Shared agent base → Test diagnostics: base abstraction
- Shared agent base → Root-cause analysis: base abstraction
- Shared agent base → Action planner: base abstraction
- Test diagnostics → Root-cause analysis: findings
- Historical memory → Root-cause analysis: historical context
- LLM provider factory → Root-cause analysis: LLM access
- Root-cause analysis → Action planner: hypotheses and confidence
- Action planner → Jira: creates preferred ticket
- Action planner → GitHub Actions & Issues: issue fallback
- Action planner → Approved execution: approved high-confidence actions
- Action planner → Persisted workflow state: pending approval status
- Tool registry → Jenkins: adapter
- Tool registry → GitHub Actions & Issues: adapter
- Tool registry → Grafana: adapter
- Tool registry → Jira: adapter
- Workflow runner → Monocle to Okahu: workflow spans
- Shared agent base → Monocle to Okahu: agent spans
- Tool registry → Monocle to Okahu: tool spans
- Runtime deployment → Pipeline & interfaces: hosts runtime
