Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:ANative Lab EvoAgentX Evolutionary Workflow Optimization

From Leeroopedia
Knowledge Sources
Domains Optimization, Workflow, Evolution
Last Updated 2026-10-21 00:00 GMT

Overview

Technique for iteratively improving multi-agent workflow performance through LLM-guided evolution, experience accumulation, and convergence detection.

Description

Evolutionary Workflow Optimization treats a workflow graph as an evolvable artifact. An optimizer LLM generates modifications (new graph code, prompt changes) based on sampled high-performing previous rounds and accumulated experience. Each modified graph is evaluated against a benchmark, scored, and the results feed into the next optimization round. The process continues until convergence (top-k scores stabilize) or a maximum round count is reached. This approach enables workflows to self-improve without manual tuning.

Usage

Use this principle when you want to automatically optimize a workflow's performance against a benchmark. The `AFlowOptimizer` is the primary implementation:

  • Setup: Provide a graph directory (with `graph.py` and `prompt.py`), optimizer and executor LLMs, and a benchmark
  • Optimize: Call `optimize(benchmark)` to run the optimization loop
  • Test: Call `test(benchmark)` to evaluate the best optimized round on a test set
  • Convergence: The optimizer auto-detects convergence and stops early

Theoretical Basis

The optimization loop follows an evolutionary search:

# Abstract algorithm (not real implementation)
for round in range(max_rounds):
    sample = select_top_rounds(history, sample_size)
    experience = load_experience()
    modification = optimizer_llm.generate(sample, experience, operators)
    new_graph = apply_modification(sample.graph, modification)
    score = evaluate(new_graph, benchmark, validation_rounds)
    history.append({round, score, graph})
    save_experience(modification, score)
    if check_convergence(history, top_k=3):
        break

Key properties:

  • Experience accumulation: Previous modifications and their outcomes inform future rounds
  • Sampling: Top-scoring rounds are sampled (not just the best) to maintain diversity
  • Convergence detection: Stops when top-k scores stabilize
  • Multiple optimizers: AFlow, TextGrad, EvoPrompt, MIPRO, MAP-Elites, SEW available
  • Benchmark-driven: Optimization target is benchmark performance

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment