# pava-max/ai-enterprise-automation architecture

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

- Interactive diagram: https://gitdiagram.com/pava-max/ai-enterprise-automation
- Repository: https://github.com/pava-max/ai-enterprise-automation

## Overview

The repository implements an API gateway that accepts user requests, resolves intent, and dispatches supported work to agents. The visible end-to-end branches cover HR leave requests and employee onboarding, plus report requests sent to a Data Agent. The HR agent validates requests and handles leave calculations or delegates onboarding to an HRMS adapter. The README also describes workflow automation and customer support, but their implementations are not present in the supplied tree. Evidence is limited to the README, source index, and sampled files.

Main entry points: [`gateway_orchestrator/app/services/router_service.py`](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/services/router_service.py) (Intent router), [`gateway_orchestrator/app/routes/orchestration.py`](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/routes/orchestration.py) (Request handler), [`gateway_orchestrator/app/clients/hr_agent_client.py`](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/clients/hr_agent_client.py) (HR client), [`gateway_orchestrator/app/clients/data_agent_client.py`](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/clients/data_agent_client.py) (Data client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gateway["Gateway orchestration"]
  node_gateway_app["Gateway API<br/>[main.py]"]
  node_gateway_health["Gateway health<br/>[health.py]"]
  node_orchestration["Request handler<br/>[orchestration.py]"]
  node_request_schema["Request schema<br/>[request_schemas.py]"]
  node_response_schema["Response schema"]
  node_router["Intent router<br/>[router_service.py]"]
  node_intent["Intent resolver<br/>[intent_service.py]"]
  node_hr_client["HR client<br/>[hr_agent_client.py]"]
  node_data_client["Data client"]
end

subgraph group_hr["HR agent"]
  node_hr_app["HR API<br/>[main.py]"]
  node_hr_health["HR health<br/>[health.py]"]
  node_hr_routes["HR operations<br/>[hr_ops.py]"]
  node_hr_models["HR models<br/>[hr_models.py]"]
  node_leave["Leave service<br/>[leave_service.py]"]
  node_onboarding["Onboarding service"]
  node_hrms_adapter["HRMS adapter<br/>[hrms_adapter.py]"]
end

subgraph group_shared["Shared runtime"]
  node_config["Runtime settings<br/>[config.py]"]
  node_logging["Logging utility<br/>[logging_utils.py]"]
  node_security["API key security<br/>[security.py]"]
  node_messaging["Messaging utility<br/>[messaging.py]"]
end

subgraph group_integrations["Agent integrations"]
  node_hrms["HRMS service"]
  node_data_agent["Data Analysis Agent"]
  node_workflow_agent["Workflow Automation Agent"]
  node_support_agent["Customer Support Agent"]
end

node_user(("Requesting user"))

node_user -->|"submits request"| node_orchestration
node_gateway_app -->|"mounts routes"| node_gateway_health
node_gateway_app -->|"mounts routes"| node_orchestration
node_orchestration -->|"accepts request"| node_request_schema
node_orchestration -->|"checks API key"| node_security
node_orchestration -->|"dispatches request"| node_router
node_orchestration -->|"returns response"| node_response_schema
node_router -->|"resolves intent"| node_intent
node_router -->|"calls HR"| node_hr_client
node_router -->|"calls reports"| node_data_client
node_hr_client -->|"posts HR request"| node_hr_app
node_data_client -->|"posts report request"| node_data_agent
node_hr_app -->|"mounts routes"| node_hr_health
node_hr_app -->|"mounts routes"| node_hr_routes
node_hr_routes -->|"uses request models"| node_hr_models
node_hr_routes -->|"calls leave service"| node_leave
node_hr_routes -->|"calls onboarding"| node_onboarding
node_leave -->|"uses request and response"| node_hr_models
node_onboarding -->|"uses request and response"| node_hr_models
node_onboarding -->|"creates employee"| node_hrms_adapter
node_hrms_adapter -.->|"writes employee data"| node_hrms
node_hr_client -->|"reads HR URL"| node_config
node_data_client -->|"reads Data URL"| node_config
node_gateway_app -->|"sets up logging"| node_logging
node_hr_app -->|"sets up logging"| node_logging
node_hr_client -->|"sets up logging"| node_logging
node_data_client -->|"sets up logging"| node_logging
node_router -.->|"planned routing"| node_workflow_agent
node_router -.->|"planned routing"| node_support_agent

click node_gateway_app "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/main.py"
click node_gateway_health "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/routes/health.py"
click node_orchestration "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/routes/orchestration.py"
click node_request_schema "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/schemas/request_schemas.py"
click node_response_schema "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/schemas/response_schemas.py"
click node_router "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/services/router_service.py"
click node_intent "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/services/intent_service.py"
click node_hr_client "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/clients/hr_agent_client.py"
click node_data_client "https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/clients/data_agent_client.py"
click node_hr_app "https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/main.py"
click node_hr_health "https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/routes/health.py"
click node_hr_routes "https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/routes/hr_ops.py"
click node_hr_models "https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/schemas/hr_models.py"
click node_leave "https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/services/leave_service.py"
click node_onboarding "https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/services/onboarding_service.py"
click node_hrms_adapter "https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/integrators/hrms_adapter.py"
click node_config "https://github.com/pava-max/ai-enterprise-automation/blob/main/common/config.py"
click node_logging "https://github.com/pava-max/ai-enterprise-automation/blob/main/common/logging_utils.py"
click node_security "https://github.com/pava-max/ai-enterprise-automation/blob/main/common/security.py"
click node_messaging "https://github.com/pava-max/ai-enterprise-automation/blob/main/common/messaging.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_gateway_app,node_gateway_health,node_orchestration,node_request_schema,node_response_schema,node_router,node_intent,node_hr_client,node_data_client,node_user toneBlue
class node_hr_app,node_hr_health,node_hr_routes,node_hr_models,node_leave,node_onboarding,node_hrms_adapter toneAmber
class node_config,node_logging,node_security,node_messaging toneMint
class node_hrms,node_data_agent,node_workflow_agent,node_support_agent toneRose
```

## Components

### Gateway orchestration

- [Gateway API](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/main.py): `gateway_orchestrator/app/main.py`
- [Gateway health](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/routes/health.py): `gateway_orchestrator/app/routes/health.py`
- [Request handler](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/routes/orchestration.py): `gateway_orchestrator/app/routes/orchestration.py`
- [Request schema](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/schemas/request_schemas.py): `gateway_orchestrator/app/schemas/request_schemas.py`
- [Response schema](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/schemas/response_schemas.py): `gateway_orchestrator/app/schemas/response_schemas.py`
- [Intent router](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/services/router_service.py): `gateway_orchestrator/app/services/router_service.py`
- [Intent resolver](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/services/intent_service.py): `gateway_orchestrator/app/services/intent_service.py`
- [HR client](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/clients/hr_agent_client.py): `gateway_orchestrator/app/clients/hr_agent_client.py`
- [Data client](https://github.com/pava-max/ai-enterprise-automation/blob/main/gateway_orchestrator/app/clients/data_agent_client.py): `gateway_orchestrator/app/clients/data_agent_client.py`

### HR agent

- [HR API](https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/main.py): `agents/hr_agent/app/main.py`
- [HR health](https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/routes/health.py): `agents/hr_agent/app/routes/health.py`
- [HR operations](https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/routes/hr_ops.py): `agents/hr_agent/app/routes/hr_ops.py`
- [HR models](https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/schemas/hr_models.py): `agents/hr_agent/app/schemas/hr_models.py`
- [Leave service](https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/services/leave_service.py): `agents/hr_agent/app/services/leave_service.py`
- [Onboarding service](https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/services/onboarding_service.py): `agents/hr_agent/app/services/onboarding_service.py`
- [HRMS adapter](https://github.com/pava-max/ai-enterprise-automation/blob/main/agents/hr_agent/app/integrators/hrms_adapter.py): `agents/hr_agent/app/integrators/hrms_adapter.py`

### Shared runtime

- [Runtime settings](https://github.com/pava-max/ai-enterprise-automation/blob/main/common/config.py): `common/config.py`
- [Logging utility](https://github.com/pava-max/ai-enterprise-automation/blob/main/common/logging_utils.py): `common/logging_utils.py`
- [API key security](https://github.com/pava-max/ai-enterprise-automation/blob/main/common/security.py): `common/security.py`
- [Messaging utility](https://github.com/pava-max/ai-enterprise-automation/blob/main/common/messaging.py): `common/messaging.py`

### Agent integrations

- **HRMS service**
- **Data Analysis Agent**
- **Workflow Automation Agent**
- **Customer Support Agent**

### Other components

- **Requesting user**

## Connections

- Requesting user → Request handler: submits request (evidence: `gateway_orchestrator/app/routes/orchestration.py`)
- Gateway API → Gateway health: mounts routes (evidence: `gateway_orchestrator/app/main.py`)
- Gateway API → Request handler: mounts routes (evidence: `gateway_orchestrator/app/main.py`)
- Request handler → Request schema: accepts request (evidence: `gateway_orchestrator/app/routes/orchestration.py`)
- Request handler → API key security: checks API key (evidence: `gateway_orchestrator/app/routes/orchestration.py`)
- Request handler → Intent router: dispatches request (evidence: `gateway_orchestrator/app/routes/orchestration.py`)
- Request handler → Response schema: returns response (evidence: `gateway_orchestrator/app/routes/orchestration.py`)
- Intent router → Intent resolver: resolves intent (evidence: `gateway_orchestrator/app/services/router_service.py`)
- Intent router → HR client: calls HR (evidence: `gateway_orchestrator/app/services/router_service.py`)
- Intent router → Data client: calls reports (evidence: `gateway_orchestrator/app/services/router_service.py`)
- HR client → HR API: posts HR request (evidence: `gateway_orchestrator/app/clients/hr_agent_client.py`)
- Data client → Data Analysis Agent: posts report request (evidence: `gateway_orchestrator/app/clients/data_agent_client.py`)
- HR API → HR health: mounts routes (evidence: `agents/hr_agent/app/main.py`)
- HR API → HR operations: mounts routes (evidence: `agents/hr_agent/app/main.py`)
- HR operations → HR models: uses request models (evidence: `agents/hr_agent/app/routes/hr_ops.py`)
- HR operations → Leave service: calls leave service (evidence: `agents/hr_agent/app/routes/hr_ops.py`)
- HR operations → Onboarding service: calls onboarding (evidence: `agents/hr_agent/app/routes/hr_ops.py`)
- Leave service → HR models: uses request and response (evidence: `agents/hr_agent/app/services/leave_service.py`)
- Onboarding service → HR models: uses request and response (evidence: `agents/hr_agent/app/services/onboarding_service.py`)
- Onboarding service → HRMS adapter: creates employee (evidence: `agents/hr_agent/app/services/onboarding_service.py`)
- HRMS adapter → HRMS service: writes employee data
- HR client → Runtime settings: reads HR URL (evidence: `gateway_orchestrator/app/clients/hr_agent_client.py`)
- Data client → Runtime settings: reads Data URL (evidence: `gateway_orchestrator/app/clients/data_agent_client.py`)
- Gateway API → Logging utility: sets up logging (evidence: `gateway_orchestrator/app/main.py`)
- HR API → Logging utility: sets up logging (evidence: `agents/hr_agent/app/main.py`)
- HR client → Logging utility: sets up logging (evidence: `gateway_orchestrator/app/clients/hr_agent_client.py`)
- Data client → Logging utility: sets up logging (evidence: `gateway_orchestrator/app/clients/data_agent_client.py`)
- Intent router → Workflow Automation Agent: planned routing (evidence: `gateway_orchestrator/app/services/router_service.py`)
- Intent router → Customer Support Agent: planned routing (evidence: `gateway_orchestrator/app/services/router_service.py`)
