Skip to main content

Overview

The Agent SOUL System lets you define agent personality, capabilities, and behavioral guidelines through markdown files. Changes sync bidirectionally between the UI database and workspace soul.md files—edit in either location and both stay in sync.
SOUL files use a simple markdown format with frontmatter-style metadata. The system automatically parses identity information and maintains consistency across your agent fleet.

Workspace Sync Architecture

Mission Control reads agent configurations from openclaw.json and enriches them with workspace files:

SOUL File Format

SOUL files follow a simple markdown structure:

Bidirectional Sync

Changes sync automatically in both directions:
1

Workspace → Database

When syncAgentsFromConfig() runs (startup, manual sync), it reads soul.md from each agent’s workspace and writes to the database:
2

Database → Workspace

When you edit SOUL content in the UI via PUT /api/agents/[id]/soul, it writes to both locations:
3

Conflict Resolution

When syncing from openclaw.json, the system only overwrites database content if:
  • The workspace file has newer content
  • The existing database value is null

Identity Parsing

The system extracts structured metadata from markdown:

API Reference

Get Agent SOUL

The API returns database content by default. To read directly from workspace, the system checks if the file exists and is readable.

Update Agent SOUL

Sync from Config

Tools Configuration

The system also syncs TOOLS.md from workspaces:

Best Practices

Security Note: SOUL files may contain sensitive behavioral guidelines. Store them in version control with appropriate access controls.
  • Use clear heading hierarchy (#, ##, ###)
  • Place metadata fields (theme:, emoji:) near the top
  • Keep SOUL content under 4KB for optimal performance
  • Use consistent formatting across your agent fleet

Troubleshooting

1

SOUL not syncing from workspace

Check that:
  • OPENCLAW_HOME environment variable is set correctly
  • Agent’s workspace field in openclaw.json is valid
  • File path resolves correctly: $OPENCLAW_HOME/[workspace]/soul.md
  • File has read permissions
2

UI changes not writing to workspace

Verify:
  • Agent has workspace field in database config
  • Workspace directory exists and is writable
  • No file system errors in Mission Control logs
3

Identity fields not parsing

Ensure:
  • Fields use exact format: theme: value (lowercase, space after colon)
  • Name comes from first markdown heading (# Name)
  • No extra whitespace or special characters