OpenBee
Developer Guide

Data Models

Core data structures in OpenBee

Worker

Represents an AI agent that executes tasks.

FieldTypeDescription
idstringUUID, auto-generated
namestringDisplay name
descriptionstringPurpose and capabilities
memorystringPersistent context (written to CLAUDE.md)
work_dirstringFilesystem path (~/.openbee/worker/{id})
statusstringidle, working, or error
created_atint64Unix timestamp in milliseconds
updated_atint64Unix timestamp in milliseconds

Task

A unit of work assigned to a worker.

FieldTypeDescription
idstringUUID, auto-generated
message_idstringReference to the originating platform message
worker_idstringAssigned worker
instructionstringWhat the worker should do
typestringimmediate, countdown, or scheduled
statusstringpending, running, completed, failed, or cancelled
scheduled_atint64?Unix ms — trigger time for countdown tasks
cron_exprstring5-field cron expression for scheduled tasks
next_run_atint64?Unix ms — next trigger time for scheduled tasks
execution_idstringAssociated execution record
created_atint64Unix timestamp in milliseconds
updated_atint64Unix timestamp in milliseconds

Execution

A record of a worker running a task.

FieldTypeDescription
idstringUUID, auto-generated
worker_idstring?Worker that ran this (null for bee executions)
session_idstringClaude Code session ID (for resumption)
trigger_inputstringThe original instruction/prompt
statusstringpending, running, completed, or failed
resultstringExecution output
log_pathstringFilesystem path to execution logs
ai_process_pidintPID of the Claude Code CLI process
started_atint64?Unix timestamp in milliseconds
completed_atint64?Unix timestamp in milliseconds

PlatformMessage

An inbound message received from a chat platform.

FieldTypeDescription
idstringUUID, auto-generated
session_keystringSession identifier for grouping messages
platformstringPlatform name (e.g. feishu, dingtalk, wecom, telegram)
contentstringMessage text content
statusstringreceived, feeding, bee_processed, merged, or failed
merged_intostringID of the message this was merged into (empty if not merged)
platform_msg_idstringOriginal platform message ID for deduplication
rawstringRaw message payload from platform
received_atint64Unix timestamp in milliseconds
created_atint64Unix timestamp in milliseconds
updated_atint64Unix timestamp in milliseconds
retry_countintNumber of retry attempts

Memory

A key-value memory entry scoped globally or per session.

FieldTypeDescription
idstringUUID, auto-generated
scopestringglobal or a session key
keystringMemory identifier
valuestringMemory content
created_atint64Unix timestamp in milliseconds
updated_atint64Unix timestamp in milliseconds

Unique constraint on (scope, key) — one value per scope+key pair.

Database Schema

All tables use the bee_ prefix and are stored in SQLite:

  • bee_workers — Worker definitions
  • bee_tasks — Task records
  • bee_executions — Execution history
  • bee_platform_messages — Inbound platform messages
  • bee_session_contexts — Agent session context tracking
  • bee_memories — Key-value memory store
  • bee_local_sessions — Local chat sessions
  • bee_local_replies — Local chat replies
  • bee_migrations — Schema migration tracking

Database path is configurable (default: ~/.openbee/openbee.db or ./data/openbee.db).

On this page