How eooo-io/orkestr works
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: AgentExecutionService.php Agent execution engine · RunAgentJob.php Async job workers · api.php Laravel API · AgentComposeService.php Agent & skill composition
Components 20
Clients
- React SPA · Authoring and execution-monitoring client.
ui/src/App.tsx
Control Plane
- Laravel API · REST and streaming entry point.
routes/api.php - Tenant & access boundary · Resolves organization and enforces access boundaries.
app/Http/Middleware/ResolveOrganization.php - Project component domain · Organization-scoped projects, agents, skills, and configuration.
app/Models/Project.php - Agent & skill composition · Builds reusable skill and agent configurations.
app/Services/AgentComposeService.php - Provider asset sync · Imports and exports external agent assets.
app/Services/ProviderSyncService.php
Execution Runtime
- Schedules & triggers · Initiates scheduled, webhook, and queued work.
app/Services/ScheduleTriggerService.php - Agent execution engine · Runs agent loops and persists execution state.
app/Services/Execution/AgentExecutionService.php - Workflow orchestration · Executes DAG steps, edges, conditions, and context.
app/Services/Execution/WorkflowExecutionService.php - Workflow & run records · Durable workflow graphs, runs, and replay data.
app/Models/ExecutionRun.php - Async job workers · Isolates long-running runs, scans, and evaluations.
app/Jobs/RunAgentJob.php - Safety & budget guards · Applies approval, policy, sanitation, and budget controls.
app/Services/Execution/ExecutionGuardrailService.php - Memory & knowledge · Indexes knowledge and retrieves execution context.
app/Services/Memory/AgentMemoryService.php - Observability & alerts · Records traces, costs, artifacts, and alerts.
app/Services/Observability/AlertEngine.php
External Boundaries
- Tool dispatcher & MCP · Dispatches tool calls over stdio or SSE MCP transports.
app/Services/Mcp/McpClientService.php - LLM model router · Selects cloud, compatible, or local model providers.
app/Services/LLM/ModelRouter.php - A2A & federation · Discovers and delegates work to external agents.
app/Services/Federation/FederatedDelegationService.php - External services · LLMs, MCP servers, A2A peers, and connected providers.
Platform
- MariaDB · Durable Laravel control-plane and run state.
config/database.php - Queue & private storage · Async delivery, cache, and artifact storage.
config/queue.php
Connections 27
- 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