AgentWorks

AgentWorks documentation

Workflow self-improvement & reporting — system overview

Start here. This is the map of how a workflow keeps itself healthy and moving toward its goals, and how that work is made visible and steerable for the user. It ties together five parts that are otherwise documented separately: Pulse, Auto-improve, the scheduled step messages, notifications, and the Org dashboard. Each section links to the detailed doc.

Why this is the critical layer — managing at scale

This is the most important subsystem in the product: it's what makes 100+ agents and automations manageable by a small team. Without it, every workflow needs a human watching it — which caps you at a handful. With it:

Span of control is the whole point: the system handles the routine fixing and improving and surfaces only the exceptions + decisions, so human effort scales with the number of exceptions, not the number of workflows. That is the difference between running 5 automations and running 100+.

1. Purpose — two jobs

  1. Fix/improve workflows toward their goals. Keep them working, and move them toward winning.
  2. Make that legible and steerable. Report what's happening so the user can see, get alerted, and decide — because the system proposes big changes rather than applying them silently.

Everything below is one of those two jobs, or the substrate that connects them.

2. The two loops

Two loops run per workflow. They answer different questions and own different halves of a workflow's state.

Pulse Auto-improve
Job FIX — keep it working IMPROVE — make it win
Axis 🩺 operational + 💵 spend/time ("does it run right, and did it spend sanely?") 🎯 goal ("is it achieving its goal?")
Trigger after every run (reactive) scheduled (proactive)
Autonomy applies low-risk fixes itself (harden_workflow) proposal-only for big changes (replan); user/builder approve
Statuses healthy / bug / critical; normal / elevated / missing cost on-track / at-risk / off-goal
Code runPostRunMonitor / postRunMonitorSteps (scheduler.go) optimizerScheduleMessages (scheduler.go)
Guidance post-run-monitor.md, optimize-playbook.md optimize-playbook.md + get_workflow_command_guidance(kind="improve-workflow")
Detailed doc pulse_consolidation.md auto_improvement_framework.md

Pulse step sequence (one focused turn per step): triage → fix/harden → artifact review → LLM/cost report → backup → publish → notify.

Auto-improve step sequence: pre-backup → improve → final backup → publish → notify. The improve turn can also adjust its own cadence (run more often while actively improving, back off when stable) via update_workflow_schedule — see workflow_scheduling.md.

"Working but off-goal" is a normal, important state: Pulse says it runs fine, Auto-improve says it isn't moving the goal yet.

3. The shared substrate (the loops' memory)

Both loops read and write builder/improve.html — the per-workflow Pulse/improve log, newest-first. It is the loop's memory:

See review-improve-log.md for the log's structure and the confirm-Decision rules.

Each loop also writes a compact dashboard card in the workflow's own workspace, every run (overwrite), via current workspace write paths such as diff_patch_workspace_file:

These are served to the UI by getBuilderDoc(workspace, "card-health"|"card-progress"|"card-cost") (auto_improvement_endpoints.go).

4. The reporting / steering surfaces

The same verdicts/Decisions/cards the loops produce while fixing are what surface here — #2 is #1 seen again, never a separate analysis.

Oversight is part of reporting: because big changes are proposal-only, these surfaces are also where the user decides (approve a replan, act on a recommendation), not just a window.

5. How it fits together

6. Code + docs map

Concern Code Doc
Pulse loop scheduler.go (runPostRunMonitor, postRunMonitorSteps) pulse_consolidation.md, guidance post-run-monitor.md
Auto-improve loop scheduler.go (optimizerScheduleMessages, wrapOptimizerImproveMessage) auto_improvement_framework.md, guidance optimize-playbook.md
Self-schedule cadence workflow_schedule_tools.go (update_workflow_schedule) workflow_scheduling.md
improve.html log served via auto_improvement_endpoints.go guidance review-improve-log.md
Dashboard cards card writes in loop prompts (scheduler.go); getBuilderDoc card kinds (auto_improvement_endpoints.go) org_dashboard_design.md
Notifications virtual-tools/human_tools.go (notify_user), services/gmail_service.go (this doc)
Org dashboard UI frontend/.../org/OrgDashboard.tsx, EmployeeDashboard.tsx, OrgHtmlPanels.tsx org_dashboard_design.md
Org Pulse (CoS) builtin_schedules.go guidance org-pulse.md, org-html.md
Monitoring overview workflow_monitoring.md

Open / evolving