Database Schema

Overview of the 27 SQLite tables in AgentDesk.

AgentDesk uses SQLite with Drizzle ORM. The database lives at ~/.agent-desk/data.db.

Tables by Category

Authentication

TablePurpose
usersHuman accounts (email, password hash, role)
auth_sessionsLogin session tokens, scoped to user
invitesTime-limited invite tokens for registration

Access Control

TablePurpose
project_membersUser ↔ project membership with roles
agent_accessPer-user permissions for each agent

Projects

TablePurpose
projectsProject records (name, slug, mission, status)
app_configSingle-row-per-key global settings

Tasks

TablePurpose
tasksWork items (title, status, priority, assignee, paused flag)
subtasksChecklist items nested under tasks
tagsLabel taxonomy with colors, optionally project-scoped
task_tagsMany-to-many: tasks ↔ tags
commentsMarkdown comments with reply threads
mentionsExtracted @mention targets from comments
activitiesAudit log of all board actions
taskContextsContext files attached to tasks

Agents

TablePurpose
agentsAgent configs (id, role, model, provider, paused flag, session ID)
agentRunsDispatcher run history — one row per turn

Scheduling

TablePurpose
ccCronsScheduled jobs (cron/interval/one-shot)
ccCronRunsJob run history (status, duration, error)
cronLinksLinks jobs to projects for the Schedule page
cronContextsContext files attached to jobs
ccChatTabsSide chat sessions per agent

Providers

TablePurpose
providersLLM provider configs (type, URL, encrypted credential, model)

Integrations

TablePurpose
telegramConfigTelegram bot configuration
telegramLinkCodesOne-time Telegram account linking codes
telegramLinksUser ↔ Telegram chat mapping
notionConnectionsPer-user Notion tokens (AES-256-GCM encrypted)

Backup

To back up AgentDesk, copy the database file:

$ cp ~/.agent-desk/data.db ~/.agent-desk/data.db.backup

SQLite’s WAL mode ensures consistent reads even while the server is running.