The platform uses PostgreSQL with Liquibase for schema migrations. Migration files are in src/main/resources/db/changelog/.
Core Entities
Users & Organizations
| Entity | Table | Description |
|---|
| Organization | organization | Top-level grouping, one per user |
| Workspace | workspace | Project grouping within an org |
| Project | project | Working unit — agents, tasks, files |
| ProjectInvite | project_invite | Pending project invitations |
Agents
| Entity | Table | Description |
|---|
| Agent | agent | Agent record with name, type, project, status |
| AgentProfile | agent_profile | Display name, avatar, voice, role, bio |
| AgentTemplate | agent_template | Template definitions (slug, category, tools) |
| AgentEmailRule | agent_email_rule | Inbound/outbound email routing rules |
| AgentConversation | agent_conversation | Maps (agent, conversation_key) to external conversation ID |
Tasks & Jobs
| Entity | Table | Description |
|---|
| Task | task | Tasks with summary, details, steps, status, agent assignment |
| JobSchedule | job_schedule | Quartz cron schedules |
| Job | job | Xircuits/command execution with logs and exit codes |
| ComputerUseTask | computer_use_task | Desktop automation tasks |
Conversations
| Entity | Table | Description |
|---|
| Conversation | conversation | Chat channels and DMs |
| ConversationMessage | conversation_message | Messages with sender type (USER/AGENT/SYSTEM) |
Infrastructure
| Entity | Table | Description |
|---|
| DesktopConfig | desktop_configs | VM configuration (formerly WorkspaceConfig) |
| DesktopVirtualMachine | desktop_virtual_machine | VM instances |
| DesktopConnection | desktop_connection | Active WebSocket connections from robot clients |
| RobotMacro | robot_macro | Desktop automation macros |
| RobotMacroExecution | robot_macro_execution | Macro execution history |
Auth & Billing
| Entity | Table | Description |
|---|
| PlatformToken | platform_token | API tokens with scopes |
| TokenAuditLog | token_audit_log | Token usage auditing |
| UserTrial | user_trial | Trial subscription tracking |
| DeviceToken | device_token | FCM push notification tokens |
| NotificationPreference | notification_preference | Per-user notification settings |
Communication
| Entity | Table | Description |
|---|
| VideoCall | video_call | Voice/video session data |
| Service | service | Custom user-defined Knative services |
Key Relationships
Migration Files
Located in src/main/resources/db/changelog/. The following are selected highlights, not an exhaustive list of all migrations:
| File | Content |
|---|
001-initial.sql | Core tables (project, agent, task, conversation) |
014-scheduled-jobs.sql | Job scheduling schema |
017-email-gateway.sql | Agent email rules and profiles |
030-org-workspace.sql | Organization and workspace hierarchy |