The AI Coordination Engine is a modular system designed to orchestrate complex interactions between multiple AI agents, tasks, and sessions. It provides a robust framework for managing the lifecycle of AI-driven workflows, from defining coordination strategies to executing and tracking individual agent actions.
The engine is built around the concept of Coordinations, which define the blueprint for how agents interact. Sessions are specific instances of these coordinations, where Tasks are executed. The system tracks the state of each agent within a session via SessionAgents and records every execution step in SessionRuns.
graph TD
subgraph "Configuration"
C[Coordination] -->|Defines| T[Task]
T -->|Scheduled via| TS[Task Schedule]
end
subgraph "Execution"
C -->|Instantiates| S[Session]
S -->|Tracks State| SA[Session Agent]
S -->|Records Execution| SR[Session Run]
SA -.->|Updates| SR
end
subgraph "Actors"
A[Agent]
U[User]
end
C -.->|Configures| A
S -.->|Interacts with| U
The core data models are designed to support scalable and traceable AI orchestration. The relationships between these models ensure that every action is linked back to its originating session and coordination context.
erDiagram
CoordinationModel ||--o{ TaskModel : "has"
CoordinationModel ||--o{ SessionModel : "instantiates"
TaskModel ||--o{ TaskScheduleModel : "scheduled by"
SessionModel ||--o{ SessionAgentModel : "tracks agent state"
SessionModel ||--o{ SessionRunModel : "executes"
SessionAgentModel }o--|| CoordinationModel : "references agent in"
SessionRunModel }o--|| SessionAgentModel : "associated with"
SessionRunModel }o--|| CoordinationModel : "references"
CoordinationModel {
string endpoint_id PK
string coordination_uuid PK
string coordination_name
string coordination_description
list agents
}
TaskModel {
string coordination_uuid PK
string task_uuid PK
string task_name
string task_description
string initial_task_query
list subtask_queries
map agent_actions
}
TaskScheduleModel {
string task_uuid PK
string schedule_uuid PK
string schedule
string status
}
SessionModel {
string coordination_uuid PK
string session_uuid PK
string task_uuid
string user_id
string status
list input_files
list subtask_queries
}
SessionAgentModel {
string session_uuid PK
string session_agent_uuid PK
string agent_uuid
map agent_action
string state
string in_degree
}
SessionRunModel {
string session_uuid PK
string run_uuid PK
string thread_uuid
# AI Coordination Engine
The **AI Coordination Engine** is a modular system designed to orchestrate complex interactions between multiple AI agents, tasks, and sessions. It provides a robust framework for managing the lifecycle of AI-driven workflows, from defining coordination strategies to executing and tracking individual agent actions.
## Architecture Overview
The engine is built around the concept of **Coordinations**, which define the blueprint for how agents interact. **Sessions** are specific instances of these coordinations, where **Tasks** are executed. The system tracks the state of each agent within a session via **SessionAgents** and records every execution step in **SessionRuns**.
### High-Level Architecture
```mermaid
graph TD
subgraph "Configuration"
C[Coordination] -->|Defines| T[Task]
T -->|Scheduled via| TS[Task Schedule]
end
subgraph "Execution"
C -->|Instantiates| S[Session]
S -->|Tracks State| SA[Session Agent]
S -->|Records Execution| SR[Session Run]
SA -.->|Updates| SR
end
subgraph "Actors"
A[Agent]
U[User]
end
C -.->|Configures| A
S -.->|Interacts with| U
The core data models are designed to support scalable and traceable AI orchestration. The relationships between these models ensure that every action is linked back to its originating session and coordination context.
erDiagram
CoordinationModel ||--o{ TaskModel : "has"
CoordinationModel ||--o{ SessionModel : "instantiates"
TaskModel ||--o{ TaskScheduleModel : "scheduled by"
SessionModel ||--o{ SessionAgentModel : "tracks agent state"
SessionModel ||--o{ SessionRunModel : "executes"
SessionAgentModel }o--|| CoordinationModel : "references agent in"
SessionRunModel }o--|| SessionAgentModel : "associated with"
SessionRunModel }o--|| CoordinationModel : "references"
CoordinationModel {
string endpoint_id PK
string coordination_uuid PK
string coordination_name
string coordination_description
list agents
}
TaskModel {
string coordination_uuid PK
string task_uuid PK
string task_name
string task_description
string initial_task_query
list subtask_queries
map agent_actions
}
TaskScheduleModel {
string task_uuid PK
string schedule_uuid PK
string schedule
string status
}
SessionModel {
string coordination_uuid PK
string session_uuid PK
string task_uuid
string user_id
string status
list input_files
list subtask_queries
}
SessionAgentModel {
string session_uuid PK
string session_agent_uuid PK
string agent_uuid
map agent_action
string state
string in_degree
}
SessionRunModel {
string session_uuid PK
string run_uuid PK
string thread_uuid
string agent_uuid
string async_task_uuid
string session_agent_uuid
}
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ORCHESTRATION HIERARCHY β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Coordination (Blueprint)
β
βββ> Task (1:N) ββ> TaskSchedule (1:N)
β
βββ> Session (1:N) βββ¬ββ> SessionAgent (1:N) ββ> Agent (Logical Reference)
β
βββ> SessionRun (1:N) ββ> Thread (Logical Reference)
Cascade Delete Protection:
- Cannot delete Coordination if Sessions or Tasks exist
- Cannot delete Session if SessionAgents or SessionRuns exist
- Cannot delete Task if TaskSchedules exist
Key Fields:
- Task references Coordination via:
coordination_uuid - Session references Coordination via:
coordination_uuid - SessionAgent references Session via:
session_uuid - SessionRun references Session via:
session_uuid
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β EXECUTION STATE TRACKING β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Session (Context Holder)
β
βββ> SessionAgent (1:N)
β β
β βββ> State (e.g., "initial", "in_progress")
β βββ> In-Degree (Dependency Tracking)
β
βββ> SessionRun (1:N)
β
βββ> Thread UUID (Conversation History)
βββ> Async Task UUID (Long-running Operations)
Reference Patterns:
- SessionAgent tracks the state of a specific
agent_uuidwithin the Session. - SessionRun records an immutable execution step, linking
run_uuidtothread_uuid. - Async operations are tracked via
async_task_uuidon the SessionRun.