# eooo-io/orkestr architecture

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

- Interactive diagram: https://gitdiagram.com/eooo-io/orkestr
- Repository: https://github.com/eooo-io/orkestr

## Overview

#### Purpose and Entry Points
Orkestr is a self-hosted Agent OS for defining reusable skills, configuring agents, composing DAG workflows, and executing agent/tool loops with safety and observability. The main runtime is Laravel/PHP, exposed as REST API plus streaming endpoints; the primary client is a separate React SPA.
- Backend HTTP entry: `public/index.php`, `routes/api.php`, `bootstrap/app.php`
- SPA entry and API boundary: `ui/src/main.tsx`, `ui/src/App.tsx`, `ui/src/api/client.ts`
- Operational entry points: `artisan`, `bin/orkestr`, `routes/console.php`

#### Tenant, Project, and Component Domain
Organization-scoped Eloquent entities form the durable control-plane state: users/roles own projects; projects contain repositories, agents, providers, skills, workflow definitions, and related policy/configuration. API middleware resolves organization context and applies auth, licensing, plan, role, setup, and budget boundaries before controllers invoke services.
- Scope/auth boundaries: `app/Models/Concerns/BelongsToOrganization.php`, `app/Http/Middleware/ResolveOrganization.php`, `app/Http/Middleware/CheckOrganizationRole.php`
- Core definitions: `app/Models/Project.php`, `app/Models/Agent.php`, `app/Models/Skill.php`
- Schema evolution: `database/migrations/2026_03_10_000001_create_projects_table.php`, `database/migrations/2026_03_13_100001_create_workflows_table.php`

#### Skills, Providers, and Agent Composition
Skills are versioned, reusable prompt/config components with variables, inheritance, evaluation, review, and propagation workflows. Provider drivers import/export skill assets and configurations for external coding-agent ecosystems. Agent composition assembles these components into goal/persona/tool/model configurations.
- Composition and lifecycle: `app/Services/AgentComposeService.php`, `app/Services/SkillCompositionService.php`, `app/Services/SkillFileParser.php`
- Provider boundary: `app/Services/Providers/ProviderDriverInterface.php`, `app/Services/ProviderSyncService.php`, `app/Services/ManifestService.php`
- UI authoring surfaces: `ui/src/pages/SkillEditor.tsx`, `ui/src/pages/AgentBuilder.tsx`

#### Execution and Workflow Orchestration
Execution requests create persisted runs and steps, then pass through agent or workflow execution services. Workflows are graph definitions of steps and edges, with conditions/context handling; scheduled, webhook, and queue-driven paths can initiate work. Asynchronous jobs isolate long-running execution, scans, evaluations, and scheduled agents from API request handling.
- Execution core: `app/Services/Execution/AgentExecutionService.php`, `app/Services/Execution/WorkflowExecutionService.php`, `app/Services/Execution/ToolDispatcher.php`
- Graph/run persistence: `app/Models/Workflow.php`, `app/Models/WorkflowEdge.php`, `app/Models/ExecutionRun.php`
- Async/trigger paths: `app/Jobs/RunAgentJob.php`, `app/Jobs/DaemonExecutionJob.php`, `app/Services/ScheduleTriggerService.php`

#### Model, Tool, and Delegation Boundaries
The execution engine selects an LLM through a provider factory/router, supporting cloud providers, OpenAI-compatible endpoints, and local Ollama/air-gapped operation. Tool calls cross the MCP client boundary via stdio or SSE. A2A and federation services provide external-agent discovery, identity, and delegated execution; routing/negotiation services select suitable internal agents.
- LLM abstraction: `app/Services/LLM/LLMProviderInterface.php`, `app/Services/LLM/ModelRouter.php`, `app/Services/LLM/OllamaProvider.php`
- MCP transport boundary: `app/Services/Mcp/McpClientService.php`, `app/Services/Mcp/StdioTransport.php`, `app/Services/Mcp/SseTransport.php`
- Delegation: `app/Services/A2a/A2aClientService.php`, `app/Services/Federation/FederatedDelegationService.php`, `app/Services/Routing/SmartTaskRouter.php`

#### Safety, Memory, and Operational Feedback
Before and during execution, guards enforce approval, budgets, data/network/tool access, input/output sanitation, and guardrail policy. Runs record traces, artifacts, costs, audit data, notifications, replays, and observability metrics. Memory services persist agent and shared knowledge, index documents/embeddings, and construct a knowledge graph for later context retrieval.
- Runtime safety: `app/Services/Execution/ExecutionGuardrailService.php`, `app/Services/Execution/Guards/GuardrailPolicyEngine.php`, `app/Services/Execution/BudgetEnforcer.php`
- Memory/knowledge: `app/Services/Memory/AgentMemoryService.php`, `app/Services/Memory/DocumentIndexer.php`, `app/Services/Memory/KnowledgeGraphService.php`
- Feedback records and UI: `app/Models/ExecutionReplay.php`, `app/Services/Observability/AlertEngine.php`, `ui/src/pages/ExecutionDashboard.tsx`

#### Runtime and Infrastructure
Laravel 12 on PHP 8.4 runs against MariaDB, Laravel queue/cache/storage configuration, and local private/public storage. Docker Compose supports local/production deployment; Helm deploys the app with MariaDB, persistent volumes, ingress, migrations, and optional horizontal scaling. External dependencies include LLM APIs, MCP servers, A2A peers, GitHub, Stripe, SSO/social auth, and notification channels.
- Runtime configuration: `config/database.php`, `config/queue.php`, `config/filesystems.php`
- Containers/deployment: `docker-compose.yml`, `docker/php/Dockerfile`, `helm/orkestr/templates/deployment.yaml`

Main entry points: [`app/Services/Execution/AgentExecutionService.php`](https://github.com/eooo-io/orkestr/blob/main/app/Services/Execution/AgentExecutionService.php) (Agent execution engine), [`app/Jobs/RunAgentJob.php`](https://github.com/eooo-io/orkestr/blob/main/app/Jobs/RunAgentJob.php) (Async job workers), [`routes/api.php`](https://github.com/eooo-io/orkestr/blob/main/routes/api.php) (Laravel API), [`app/Services/AgentComposeService.php`](https://github.com/eooo-io/orkestr/blob/main/app/Services/AgentComposeService.php) (Agent & skill composition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Clients"]
  node_spa["React SPA<br/>frontend<br/>[App.tsx]"]
end

subgraph group_control["Control Plane"]
  node_api["Laravel API<br/>http-api<br/>[api.php]"]
  node_tenant_guard["Tenant &amp; access boundary<br/>middleware"]
  node_domain[("Project component domain<br/>eloquent-models<br/>[Project.php]")]
  node_composition["Agent &amp; skill composition<br/>application-service"]
  node_provider_sync["Provider asset sync<br/>provider-service"]
end

subgraph group_runtime["Execution Runtime"]
  node_triggers["Schedules &amp; triggers<br/>trigger-service"]
  node_execution["Agent execution engine<br/>execution-service"]
  node_workflow["Workflow orchestration<br/>workflow-service"]
  node_runs[("Workflow &amp; run records<br/>eloquent-models<br/>[ExecutionRun.php]")]
  node_jobs["Async job workers<br/>queue-jobs<br/>[RunAgentJob.php]"]
  node_guardrails["Safety &amp; budget guards<br/>execution-service"]
  node_memory["Memory &amp; knowledge<br/>knowledge-service"]
  node_observability["Observability &amp; alerts<br/>operations-service<br/>[AlertEngine.php]"]
end

subgraph group_integrations["External Boundaries"]
  node_tools["Tool dispatcher &amp; MCP<br/>tool-boundary"]
  node_models["LLM model router<br/>llm-abstraction<br/>[ModelRouter.php]"]
  node_delegation["A2A &amp; federation<br/>delegation-service"]
  node_external{{"External services<br/>external-systems"}}
end

subgraph group_platform["Platform"]
  node_mariadb[("MariaDB<br/>relational-database<br/>[database.php]")]
  node_queue_storage["Queue &amp; private storage<br/>runtime-services<br/>[queue.php]"]
end

node_spa -->|"REST / streaming"| node_api
node_api -->|"applies"| node_tenant_guard
node_tenant_guard -->|"scopes access"| node_domain
node_api -->|"authors"| node_composition
node_composition -->|"stores definitions"| node_domain
node_composition -->|"syncs assets"| node_provider_sync
node_provider_sync -->|"provider APIs"| node_external
node_api -->|"queues execution"| node_jobs
node_triggers -->|"enqueues"| node_jobs
node_jobs -->|"runs agent"| node_execution
node_jobs -->|"runs workflow"| node_workflow
node_workflow -->|"executes agent steps"| node_execution
node_execution -->|"checks"| node_guardrails
node_execution -->|"selects model"| node_models
node_execution -->|"dispatches calls"| node_tools
node_execution -.->|"delegates tasks"| node_delegation
node_execution -->|"retrieves context"| node_memory
node_execution -->|"persists state"| node_runs
node_workflow -->|"reads graph state"| node_runs
node_execution -->|"emits telemetry"| node_observability
node_domain -->|"persists"| node_mariadb
node_runs -->|"persists"| node_mariadb
node_jobs -->|"consumes"| node_queue_storage
node_observability -->|"stores artifacts"| node_queue_storage
node_models -->|"LLM endpoints"| node_external
node_tools -->|"MCP servers"| node_external
node_delegation -->|"A2A peers"| node_external

click node_spa "https://github.com/eooo-io/orkestr/blob/main/ui/src/App.tsx"
click node_api "https://github.com/eooo-io/orkestr/blob/main/routes/api.php"
click node_tenant_guard "https://github.com/eooo-io/orkestr/blob/main/app/Http/Middleware/ResolveOrganization.php"
click node_domain "https://github.com/eooo-io/orkestr/blob/main/app/Models/Project.php"
click node_composition "https://github.com/eooo-io/orkestr/blob/main/app/Services/AgentComposeService.php"
click node_provider_sync "https://github.com/eooo-io/orkestr/blob/main/app/Services/ProviderSyncService.php"
click node_triggers "https://github.com/eooo-io/orkestr/blob/main/app/Services/ScheduleTriggerService.php"
click node_execution "https://github.com/eooo-io/orkestr/blob/main/app/Services/Execution/AgentExecutionService.php"
click node_workflow "https://github.com/eooo-io/orkestr/blob/main/app/Services/Execution/WorkflowExecutionService.php"
click node_runs "https://github.com/eooo-io/orkestr/blob/main/app/Models/ExecutionRun.php"
click node_jobs "https://github.com/eooo-io/orkestr/blob/main/app/Jobs/RunAgentJob.php"
click node_guardrails "https://github.com/eooo-io/orkestr/blob/main/app/Services/Execution/ExecutionGuardrailService.php"
click node_tools "https://github.com/eooo-io/orkestr/blob/main/app/Services/Mcp/McpClientService.php"
click node_models "https://github.com/eooo-io/orkestr/blob/main/app/Services/LLM/ModelRouter.php"
click node_delegation "https://github.com/eooo-io/orkestr/blob/main/app/Services/Federation/FederatedDelegationService.php"
click node_memory "https://github.com/eooo-io/orkestr/blob/main/app/Services/Memory/AgentMemoryService.php"
click node_observability "https://github.com/eooo-io/orkestr/blob/main/app/Services/Observability/AlertEngine.php"
click node_mariadb "https://github.com/eooo-io/orkestr/blob/main/config/database.php"
click node_queue_storage "https://github.com/eooo-io/orkestr/blob/main/config/queue.php"

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_spa toneBlue
class node_api,node_tenant_guard,node_domain,node_composition,node_provider_sync toneAmber
class node_triggers,node_execution,node_workflow,node_runs,node_jobs,node_guardrails,node_memory,node_observability toneMint
class node_tools,node_models,node_delegation,node_external toneRose
class node_mariadb,node_queue_storage toneIndigo
```

## Components

### Clients

- [React SPA](https://github.com/eooo-io/orkestr/blob/main/ui/src/App.tsx): frontend · Authoring and execution-monitoring client. · `ui/src/App.tsx`

### Control Plane

- [Laravel API](https://github.com/eooo-io/orkestr/blob/main/routes/api.php): http-api · REST and streaming entry point. · `routes/api.php`
- [Tenant & access boundary](https://github.com/eooo-io/orkestr/blob/main/app/Http/Middleware/ResolveOrganization.php): middleware · Resolves organization and enforces access boundaries. · `app/Http/Middleware/ResolveOrganization.php`
- [Project component domain](https://github.com/eooo-io/orkestr/blob/main/app/Models/Project.php): eloquent-models · Organization-scoped projects, agents, skills, and configuration. · `app/Models/Project.php`
- [Agent & skill composition](https://github.com/eooo-io/orkestr/blob/main/app/Services/AgentComposeService.php): application-service · Builds reusable skill and agent configurations. · `app/Services/AgentComposeService.php`
- [Provider asset sync](https://github.com/eooo-io/orkestr/blob/main/app/Services/ProviderSyncService.php): provider-service · Imports and exports external agent assets. · `app/Services/ProviderSyncService.php`

### Execution Runtime

- [Schedules & triggers](https://github.com/eooo-io/orkestr/blob/main/app/Services/ScheduleTriggerService.php): trigger-service · Initiates scheduled, webhook, and queued work. · `app/Services/ScheduleTriggerService.php`
- [Agent execution engine](https://github.com/eooo-io/orkestr/blob/main/app/Services/Execution/AgentExecutionService.php): execution-service · Runs agent loops and persists execution state. · `app/Services/Execution/AgentExecutionService.php`
- [Workflow orchestration](https://github.com/eooo-io/orkestr/blob/main/app/Services/Execution/WorkflowExecutionService.php): workflow-service · Executes DAG steps, edges, conditions, and context. · `app/Services/Execution/WorkflowExecutionService.php`
- [Workflow & run records](https://github.com/eooo-io/orkestr/blob/main/app/Models/ExecutionRun.php): eloquent-models · Durable workflow graphs, runs, and replay data. · `app/Models/ExecutionRun.php`
- [Async job workers](https://github.com/eooo-io/orkestr/blob/main/app/Jobs/RunAgentJob.php): queue-jobs · Isolates long-running runs, scans, and evaluations. · `app/Jobs/RunAgentJob.php`
- [Safety & budget guards](https://github.com/eooo-io/orkestr/blob/main/app/Services/Execution/ExecutionGuardrailService.php): execution-service · Applies approval, policy, sanitation, and budget controls. · `app/Services/Execution/ExecutionGuardrailService.php`
- [Memory & knowledge](https://github.com/eooo-io/orkestr/blob/main/app/Services/Memory/AgentMemoryService.php): knowledge-service · Indexes knowledge and retrieves execution context. · `app/Services/Memory/AgentMemoryService.php`
- [Observability & alerts](https://github.com/eooo-io/orkestr/blob/main/app/Services/Observability/AlertEngine.php): operations-service · Records traces, costs, artifacts, and alerts. · `app/Services/Observability/AlertEngine.php`

### External Boundaries

- [Tool dispatcher & MCP](https://github.com/eooo-io/orkestr/blob/main/app/Services/Mcp/McpClientService.php): tool-boundary · Dispatches tool calls over stdio or SSE MCP transports. · `app/Services/Mcp/McpClientService.php`
- [LLM model router](https://github.com/eooo-io/orkestr/blob/main/app/Services/LLM/ModelRouter.php): llm-abstraction · Selects cloud, compatible, or local model providers. · `app/Services/LLM/ModelRouter.php`
- [A2A & federation](https://github.com/eooo-io/orkestr/blob/main/app/Services/Federation/FederatedDelegationService.php): delegation-service · Discovers and delegates work to external agents. · `app/Services/Federation/FederatedDelegationService.php`
- **External services**: external-systems · LLMs, MCP servers, A2A peers, and connected providers.

### Platform

- [MariaDB](https://github.com/eooo-io/orkestr/blob/main/config/database.php): relational-database · Durable Laravel control-plane and run state. · `config/database.php`
- [Queue & private storage](https://github.com/eooo-io/orkestr/blob/main/config/queue.php): runtime-services · Async delivery, cache, and artifact storage. · `config/queue.php`

## Connections

- React SPA → Laravel API: REST / streaming
- Laravel API → Tenant & access boundary: applies
- Tenant & access boundary → Project component domain: scopes access
- Laravel API → Agent & skill composition: authors
- Agent & skill composition → Project component domain: stores definitions
- Agent & skill composition → Provider asset sync: syncs assets
- Provider asset sync → External services: provider APIs
- Laravel API → Async job workers: queues execution
- Schedules & triggers → Async job workers: enqueues
- Async job workers → Agent execution engine: runs agent
- Async job workers → Workflow orchestration: runs workflow
- Workflow orchestration → Agent execution engine: executes agent steps
- Agent execution engine → Safety & budget guards: checks
- Agent execution engine → LLM model router: selects model
- Agent execution engine → Tool dispatcher & MCP: dispatches calls
- Agent execution engine → A2A & federation: delegates tasks
- Agent execution engine → Memory & knowledge: retrieves context
- Agent execution engine → Workflow & run records: persists state
- Workflow orchestration → Workflow & run records: reads graph state
- Agent execution engine → Observability & alerts: emits telemetry
- Project component domain → MariaDB: persists
- Workflow & run records → MariaDB: persists
- Async job workers → Queue & private storage: consumes
- Observability & alerts → Queue & private storage: stores artifacts
- LLM model router → External services: LLM endpoints
- Tool dispatcher & MCP → External services: MCP servers
- A2A & federation → External services: A2A peers
