Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

M2 — AFlow workflow topology search

Paper: Zhang, Xiang, Yu, Teng, Chen, Chen, Zhuge et al. — AFlow: Automating Agentic Workflow Generation (ICLR 2025 Oral)

Linear: AGE-7 · Crates: chatty-flow (runtime IR + interpreter), chatty-optimize (MCTS search) · Promotion: pending

Mechanism

Search over workflow topology before optimizing prompt text:

  • Nodes = LLM calls (model, prompt, temperature, format); edges = control flow
  • Operators: Generate, Format, Review & Revise, Ensemble, Test, Programmer, Custom
  • MCTS: each tree node is a complete workflow; soft-mixed selection (λ=0.2, α=0.4); LLM expansion with experience log; 5× validation evaluation; backpropagate diffs

Kill criterion: if IrRepr cannot express the search space by week 6, wait for Monty code mode or narrow the search — no third scripting language.

Chatty mapping

Paper conceptChatty locationStatus
Workflow representationWorkflowRepr traitReserved (WfNode)
IR interpreterchatty-flow → sub-agent / tool registryTo build
MCTS searchchatty-optimize (offline only)To build
Composition substratesub_agent_tool, invoke_agent_tool, list_agents_toolShips
Monty code mode (future)sandbox/monty.rs, sandbox/monty_bridge.rsMontySandbox runs stdlib Python via a python3 subprocess under rlimits (tried before Docker); ToolBridge is interface only — the pause/resume tool-call loop is not wired
Saved workflowFuture FlowSettingsModelGate: product integration
flowchart LR
  Search[chatty-optimize MCTS] --> IR[WorkflowRepr JSON]
  IR --> Interpreter[chatty-flow interpreter]
  Interpreter --> Tools[Existing tool registry]
  Tools --> Core[chatty-core agents]

Split is intentional: search never ships in the app binary; interpreter does.

Eval protocol

Stage A:

  • All 7 operators as composable Ops
  • Selection matches closed form for λ=0.2, α=0.4; blank template retains mass every round
  • Experience log stores parent diff, not just score
  • Discovered workflow serializes, reloads, re-executes to same score under warm cache

Stage B: HotpotQA / DROP / HumanEval / MBPP / GSM8K / MATH — target ordering (+5.7% over best manual design reported in paper; do not treat as binding until the human reviewer posts numbers).

Production landing

MechanismLikely promotion
MCTS searchOffline / CI only — reject from request path
IrRepr interpreterSetting (workflow_enabled, active_workflow_id)
Winning workflow JSONUser-selected artifact via apply policy (AGE-45)

Reserved symbols

WorkflowRepr, WfNode, soft_mixed_select, SelectionStrategy — see RESERVED.md.

Depends on

Further reading