Workflows
Self-Optimization
Analyze telemetry data, detect patterns, and adjust agent behavior for continuous improvement.
Self-Optimization Workflow
The Self-Optimization workflow is HeyCMO's procedural memory loop — it analyzes telemetry data from all workflows, detects performance patterns, and proposes weight adjustments to scoring criteria for continuous improvement.
How It Works
- Gather Telemetry — Collects execution data: eval scores, user decisions (approved/rejected/revised), engagement metrics, execution durations, error rates
- Detect Patterns — Identifies trends across the data (declining quality, improving engagement, recurring errors)
- Propose Changes — Generates weighted adjustment proposals with rationale and confidence scores
- Apply & Record — Applies approved changes and records lessons learned with rollback data
Pattern Detection
Patterns are classified by severity and trend:
| Severity | Trend | Example |
|---|---|---|
| Critical | Declining | Brand voice scores dropping below 0.6 |
| High | Declining | Content rejection rate increasing |
| Medium | Stable | Engagement plateauing for 3+ weeks |
| Low | Improving | Email open rates trending up |
Proposal Categories
| Category | What It Adjusts |
|---|---|
format_weights | Prioritization of content formats (blog vs. social vs. email) |
posting_times | Optimal posting schedule per channel |
topic_focus | Content pillar weighting based on performance |
voice_refinement | Brand voice parameter adjustments |
channel_strategy | Channel allocation and resource distribution |
Each proposal includes:
- Current value and proposed value
- Rationale backed by data points
- Expected impact estimate
- Confidence score (0–1)
Lessons Learned
The workflow maintains a lesson log with types:
- Observation — Neutral pattern detected
- Correction — Agent behavior adjusted
- Success — Proven tactic documented
- Failure — Failed approach with root cause
Safety
- All changes include rollback data (previous weights + timestamp)
- A trigger threshold defines when rollback should activate
- Changes are proposed, not forced — human review is supported
MCP Tool
Invoke via run_optimization in your MCP client.
Scheduling
Runs automatically via Inngest cron job for periodic optimization cycles.