Heuristic:AMAP ML SkillClaw Multi Round Agent Evolution
| Knowledge Sources | |
|---|---|
| Domains | Optimization, LLMs |
| Last Updated | 2026-10-22 00:00 GMT |
Overview
Multi-round agent evolution with persistent session IDs that let the OpenClaw agent continue from previous context across evolution cycles, improving skill quality iteratively.
Description
When `fresh=False` in `AgentEvolveServer` / `OpenClawRunner`, the OpenClaw agent's `OPENCLAW_HOME` is not wiped between runs. The agent session ID is fixed as `evolve-{group_id}` (rather than a fresh UUID per run). This means the agent retains its conversation history and accumulated context from previous rounds. The workspace is re-prepared with fresh session data each round, but the agent can reference its previous reasoning and decisions. When `fresh=True` (default), each run starts from a clean slate with a new UUID session ID.
Usage
Use this heuristic when running multiple evolution rounds and wanting the agent to build on its previous analysis. Set `fresh=False` and use a consistent `openclaw_home` path. Applied by `AgentEvolveServer` when `config.fresh = False`.
The Insight (Rule of Thumb)
- Action: Set `fresh=False` and use a persistent `openclaw_home`; reuse session ID `evolve-{group_id}` across rounds.
- Value: Default: `fresh=True` (clean slate). Set `fresh=False` for multi-round evolution.
- Trade-off: Persistent mode accumulates context (better continuity) but may also accumulate confusion or stale references across many rounds; fresh mode is more predictable but loses cross-round learning.
- Compatibility: Requires OpenClaw CLI to support `--session-id` for session continuity.
Reasoning
Skill evolution is iterative — the agent reviews session evidence, makes targeted changes, then reviews the results in the next round. Starting fresh each round means the agent must re-learn the skill library structure, re-read the methodology, and re-establish context — wasting tokens and time. With persistent sessions, the agent remembers its previous analysis ("I improved skill X last round; let me check if the new sessions show improvement"). The fixed session ID `evolve-{group_id}` ensures all rounds within the same group share a conversation thread. Fresh mode is still the default because it's more predictable and avoids context bloat for one-off evolution runs.
Code Evidence
Persistent session ID from `evolve_server/engines/agent.py:177-178`:
# Persistent session ID for multi-round evolution (when fresh=False)
self._agent_session_id = f"evolve-{config.group_id}"
Fresh mode wipe from `evolve_server/engines/openclaw_runner.py:56-64`:
def _prepare_home(self) -> None:
if self.fresh:
if self.openclaw_home.exists():
shutil.rmtree(self.openclaw_home, ignore_errors=True)
logger.info("[OpenClawRunner] fresh mode: wiped %s", self.openclaw_home)
self.openclaw_home.mkdir(parents=True, exist_ok=True)
Session ID docstring from `evolve_server/engines/openclaw_runner.py:130-143`:
def run(self, workspace_path, message, session_id=None):
"""Run an OpenClaw agent with the given message.
session_id: Optional session ID. If None, a UUID is generated.
When fresh=False, reusing the same session_id across
rounds lets the agent continue from previous context.
"""