# abdullah00ashraf/managerai architecture

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

- Interactive diagram: https://gitdiagram.com/abdullah00ashraf/managerai
- Repository: https://github.com/abdullah00ashraf/managerai

## Overview

NexusOrch is a stateful multi-agent orchestration and governance platform. Its documented workflow turns a user goal into an execution plan, resolves conflicts, dispatches domain agents through MCP security checks, then applies risk-based approval or escalation. The graph also preserves the documented RAG, dataset-building, backup, and local observability capabilities. Some links reflect README architecture rather than sampled runtime calls; the implemented Phase-Zero graph in main.py currently wires only the orchestrator, arbitrator, finance, DevOps, and governance nodes.

Main entry points: [`main.py`](https://github.com/abdullah00ashraf/managerai/blob/main/main.py) (Graph Runtime), [`connector_engine/mcp_host.py`](https://github.com/abdullah00ashraf/managerai/blob/main/connector_engine/mcp_host.py) (MCP Tool Host), [`state.py`](https://github.com/abdullah00ashraf/managerai/blob/main/state.py) (Execution State), [`skills/orchestrator_agent.py`](https://github.com/abdullah00ashraf/managerai/blob/main/skills/orchestrator_agent.py) (Goal Planner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_runtime["Graph Runtime<br/>[main.py]"]
  node_state["Execution State<br/>[state.py]"]
  node_planner["Goal Planner"]
  node_arbitrator["Conflict Arbitrator<br/>[arbitrator_node.py]"]
end

subgraph group_execution["Agents and Tools"]
  node_finance["Finance Agent<br/>[finance_agent.py]"]
  node_devops["DevOps Agent<br/>[devops_agent.py]"]
  node_resource["Resource Agent<br/>[resource_agent.py]"]
  node_marketing["Marketing Agent<br/>[marketing_agent.py]"]
  node_comms["Communications Agent<br/>[comms_agent.py]"]
  node_mcp["MCP Tool Host<br/>[mcp_host.py]"]
end

subgraph group_governance["Security and Governance"]
  node_auth["Tool Authorization<br/>[auth_broker.py]"]
  node_semantic["Semantic Guard<br/>[semantic_guard.py]"]
  node_risk["Risk Engine<br/>[risk_matrix.py]"]
end

subgraph group_knowledge["Knowledge and Data"]
  node_rag["RAG Population<br/>[populate_rag.py]"]
  node_vectors[("Vector Store")]
  node_dataset["SFT Dataset Builder<br/>[pipeline.py]"]
end

subgraph group_operations["Operations and Telemetry"]
  node_backup["Backup Engine<br/>[core.py]"]
  node_vault["Key Vault<br/>[vault.py]"]
  node_telemetry[("Local Telemetry Sink")]
  node_dashboard["Dashboard API"]
  node_dashboard_ui["Telemetry Dashboard<br/>[App.jsx]"]
end

node_user(("User Goal"))
node_external_tools{{"External Tools"}}
node_approval(("Human Review"))

node_user -->|"submits goal"| node_runtime
node_runtime -->|"runs first"| node_planner
node_runtime -->|"initializes state"| node_state
node_planner -->|"writes plan"| node_state
node_runtime -->|"runs next"| node_arbitrator
node_arbitrator -->|"resolves conflicts"| node_state
node_runtime -->|"dispatches"| node_finance
node_runtime -->|"dispatches"| node_devops
node_runtime -->|"gates actions"| node_risk
node_finance -.->|"requests tools"| node_mcp
node_devops -.->|"requests tools"| node_mcp
node_resource -.->|"requests tools"| node_mcp
node_marketing -.->|"requests tools"| node_mcp
node_comms -.->|"requests tools"| node_mcp
node_mcp -.->|"authorizes calls"| node_auth
node_auth -.->|"checks intent"| node_semantic
node_semantic -.->|"permits execution"| node_external_tools
node_risk -.->|"pauses for review"| node_approval
node_rag -.->|"stores embeddings"| node_vectors
node_dataset -.->|"provides knowledge"| node_rag
node_backup -->|"gets cipher key"| node_vault
node_runtime -->|"logs spans"| node_telemetry
node_dashboard -->|"reads spans"| node_telemetry
node_dashboard_ui -->|"fetches traces"| node_dashboard

click node_runtime "https://github.com/abdullah00ashraf/managerai/blob/main/main.py"
click node_state "https://github.com/abdullah00ashraf/managerai/blob/main/state.py"
click node_planner "https://github.com/abdullah00ashraf/managerai/blob/main/skills/orchestrator_agent.py"
click node_arbitrator "https://github.com/abdullah00ashraf/managerai/blob/main/arbitration/arbitrator_node.py"
click node_finance "https://github.com/abdullah00ashraf/managerai/blob/main/skills/finance_agent.py"
click node_devops "https://github.com/abdullah00ashraf/managerai/blob/main/skills/devops_agent.py"
click node_resource "https://github.com/abdullah00ashraf/managerai/blob/main/skills/resource_agent.py"
click node_marketing "https://github.com/abdullah00ashraf/managerai/blob/main/skills/marketing_agent.py"
click node_comms "https://github.com/abdullah00ashraf/managerai/blob/main/skills/comms_agent.py"
click node_mcp "https://github.com/abdullah00ashraf/managerai/blob/main/connector_engine/mcp_host.py"
click node_auth "https://github.com/abdullah00ashraf/managerai/blob/main/connector_engine/auth_broker.py"
click node_semantic "https://github.com/abdullah00ashraf/managerai/blob/main/connector_engine/semantic_guard.py"
click node_risk "https://github.com/abdullah00ashraf/managerai/blob/main/governance/risk_matrix.py"
click node_rag "https://github.com/abdullah00ashraf/managerai/blob/main/data_pipeline/populate_rag.py"
click node_vectors "https://github.com/abdullah00ashraf/managerai/blob/main/data_pipeline/vector_store_manager.py"
click node_dataset "https://github.com/abdullah00ashraf/managerai/blob/main/data_pipeline/builder/pipeline.py"
click node_backup "https://github.com/abdullah00ashraf/managerai/blob/main/backup_engine/core.py"
click node_vault "https://github.com/abdullah00ashraf/managerai/blob/main/backup_engine/vault.py"
click node_telemetry "https://github.com/abdullah00ashraf/managerai/blob/main/telemetry/local_sqlite_sink.py"
click node_dashboard "https://github.com/abdullah00ashraf/managerai/blob/main/telemetry/dashboard_viewer.py"
click node_dashboard_ui "https://github.com/abdullah00ashraf/managerai/blob/main/telemetry/dashboard-ui/src/App.jsx"

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_runtime,node_state,node_planner,node_arbitrator,node_user,node_approval toneBlue
class node_finance,node_devops,node_resource,node_marketing,node_comms,node_mcp toneAmber
class node_auth,node_semantic,node_risk toneMint
class node_rag,node_vectors,node_dataset toneRose
class node_backup,node_vault,node_telemetry,node_dashboard,node_dashboard_ui,node_external_tools toneIndigo
```

## Components

### Orchestration

- [Graph Runtime](https://github.com/abdullah00ashraf/managerai/blob/main/main.py): `main.py`
- [Execution State](https://github.com/abdullah00ashraf/managerai/blob/main/state.py): `state.py`
- [Goal Planner](https://github.com/abdullah00ashraf/managerai/blob/main/skills/orchestrator_agent.py): `skills/orchestrator_agent.py`
- [Conflict Arbitrator](https://github.com/abdullah00ashraf/managerai/blob/main/arbitration/arbitrator_node.py): `arbitration/arbitrator_node.py`

### Agents and Tools

- [Finance Agent](https://github.com/abdullah00ashraf/managerai/blob/main/skills/finance_agent.py): `skills/finance_agent.py`
- [DevOps Agent](https://github.com/abdullah00ashraf/managerai/blob/main/skills/devops_agent.py): `skills/devops_agent.py`
- [Resource Agent](https://github.com/abdullah00ashraf/managerai/blob/main/skills/resource_agent.py): `skills/resource_agent.py`
- [Marketing Agent](https://github.com/abdullah00ashraf/managerai/blob/main/skills/marketing_agent.py): `skills/marketing_agent.py`
- [Communications Agent](https://github.com/abdullah00ashraf/managerai/blob/main/skills/comms_agent.py): `skills/comms_agent.py`
- [MCP Tool Host](https://github.com/abdullah00ashraf/managerai/blob/main/connector_engine/mcp_host.py): `connector_engine/mcp_host.py`

### Security and Governance

- [Tool Authorization](https://github.com/abdullah00ashraf/managerai/blob/main/connector_engine/auth_broker.py): `connector_engine/auth_broker.py`
- [Semantic Guard](https://github.com/abdullah00ashraf/managerai/blob/main/connector_engine/semantic_guard.py): `connector_engine/semantic_guard.py`
- [Risk Engine](https://github.com/abdullah00ashraf/managerai/blob/main/governance/risk_matrix.py): `governance/risk_matrix.py`

### Knowledge and Data

- [RAG Population](https://github.com/abdullah00ashraf/managerai/blob/main/data_pipeline/populate_rag.py): `data_pipeline/populate_rag.py`
- [Vector Store](https://github.com/abdullah00ashraf/managerai/blob/main/data_pipeline/vector_store_manager.py): `data_pipeline/vector_store_manager.py`
- [SFT Dataset Builder](https://github.com/abdullah00ashraf/managerai/blob/main/data_pipeline/builder/pipeline.py): `data_pipeline/builder/pipeline.py`

### Operations and Telemetry

- [Backup Engine](https://github.com/abdullah00ashraf/managerai/blob/main/backup_engine/core.py): `backup_engine/core.py`
- [Key Vault](https://github.com/abdullah00ashraf/managerai/blob/main/backup_engine/vault.py): `backup_engine/vault.py`
- [Local Telemetry Sink](https://github.com/abdullah00ashraf/managerai/blob/main/telemetry/local_sqlite_sink.py): `telemetry/local_sqlite_sink.py`
- [Dashboard API](https://github.com/abdullah00ashraf/managerai/blob/main/telemetry/dashboard_viewer.py): `telemetry/dashboard_viewer.py`
- [Telemetry Dashboard](https://github.com/abdullah00ashraf/managerai/blob/main/telemetry/dashboard-ui/src/App.jsx): `telemetry/dashboard-ui/src/App.jsx`

### Other components

- **User Goal**
- **External Tools**
- **Human Review**

## Connections

- User Goal → Graph Runtime: submits goal (evidence: `README.md`)
- Graph Runtime → Goal Planner: runs first (evidence: `main.py`)
- Graph Runtime → Execution State: initializes state (evidence: `main.py`)
- Goal Planner → Execution State: writes plan (evidence: `skills/orchestrator_agent.py`)
- Graph Runtime → Conflict Arbitrator: runs next (evidence: `main.py`)
- Conflict Arbitrator → Execution State: resolves conflicts (evidence: `arbitration/arbitrator_node.py`)
- Graph Runtime → Finance Agent: dispatches (evidence: `main.py`)
- Graph Runtime → DevOps Agent: dispatches (evidence: `main.py`)
- Graph Runtime → Risk Engine: gates actions (evidence: `main.py`)
- Finance Agent → MCP Tool Host: requests tools (evidence: `README.md`)
- DevOps Agent → MCP Tool Host: requests tools (evidence: `README.md`)
- Resource Agent → MCP Tool Host: requests tools (evidence: `README.md`)
- Marketing Agent → MCP Tool Host: requests tools (evidence: `README.md`)
- Communications Agent → MCP Tool Host: requests tools (evidence: `README.md`)
- MCP Tool Host → Tool Authorization: authorizes calls (evidence: `README.md`)
- Tool Authorization → Semantic Guard: checks intent (evidence: `README.md`)
- Semantic Guard → External Tools: permits execution (evidence: `README.md`)
- Risk Engine → Human Review: pauses for review (evidence: `README.md`)
- RAG Population → Vector Store: stores embeddings (evidence: `README.md`)
- SFT Dataset Builder → RAG Population: provides knowledge (evidence: `README.md`)
- Backup Engine → Key Vault: gets cipher key (evidence: `backup_engine/vault.py`)
- Graph Runtime → Local Telemetry Sink: logs spans (evidence: `main.py`)
- Dashboard API → Local Telemetry Sink: reads spans (evidence: `telemetry/dashboard_viewer.py`)
- Telemetry Dashboard → Dashboard API: fetches traces (evidence: `telemetry/dashboard-ui/src/App.jsx`)
