Skip to main content

Database Schema Overview

The platform uses PostgreSQL with Liquibase for schema migrations. Migration files are in src/main/resources/db/changelog/.

Core Entities

Users & Organizations

EntityTableDescription
OrganizationorganizationTop-level grouping, one per user
WorkspaceworkspaceProject grouping within an org
ProjectprojectWorking unit — agents, tasks, files
ProjectInviteproject_invitePending project invitations

Agents

EntityTableDescription
AgentagentAgent record with name, type, project, status
AgentProfileagent_profileDisplay name, avatar, voice, role, bio
AgentTemplateagent_templateTemplate definitions (slug, category, tools)
AgentEmailRuleagent_email_ruleInbound/outbound email routing rules
AgentConversationagent_conversationMaps (agent, conversation_key) to external conversation ID

Tasks & Jobs

EntityTableDescription
TasktaskTasks with summary, details, steps, status, agent assignment
JobSchedulejob_scheduleQuartz cron schedules
JobjobXircuits/command execution with logs and exit codes
ComputerUseTaskcomputer_use_taskDesktop automation tasks

Conversations

EntityTableDescription
ConversationconversationChat channels and DMs
ConversationMessageconversation_messageMessages with sender type (USER/AGENT/SYSTEM)

Infrastructure

EntityTableDescription
DesktopConfigdesktop_configsVM configuration (formerly WorkspaceConfig)
DesktopVirtualMachinedesktop_virtual_machineVM instances
DesktopConnectiondesktop_connectionActive WebSocket connections from robot clients
RobotMacrorobot_macroDesktop automation macros
RobotMacroExecutionrobot_macro_executionMacro execution history

Auth & Billing

EntityTableDescription
PlatformTokenplatform_tokenAPI tokens with scopes
TokenAuditLogtoken_audit_logToken usage auditing
UserTrialuser_trialTrial subscription tracking
DeviceTokendevice_tokenFCM push notification tokens
NotificationPreferencenotification_preferencePer-user notification settings

Communication

EntityTableDescription
VideoCallvideo_callVoice/video session data
ServiceserviceCustom 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:

FileContent
001-initial.sqlCore tables (project, agent, task, conversation)
014-scheduled-jobs.sqlJob scheduling schema
017-email-gateway.sqlAgent email rules and profiles
030-org-workspace.sqlOrganization and workspace hierarchy