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

Implementation:AMAP ML SkillClaw EvolveServer

From Leeroopedia
Knowledge Sources
Domains Skill_Evolution, LLM_Pipeline
Last Updated 2026-10-22 00:00 GMT

Overview

Concrete tool for evolving AI agent skills from session data using a fixed multi-stage LLM pipeline (drain, summarize, judge, aggregate, evolve, verify, publish), provided by the SkillClaw evolve server package.

Description

The EvolveServer class orchestrates the full workflow-engine evolution cycle. On each `run_once()` call, it drains session recordings from shared storage, summarizes them in parallel, judges session quality, aggregates by referenced skill, evolves or creates skills via LLM, verifies candidates, and publishes accepted skills back to shared storage. It also manages validation job lifecycle (`_queue_validation_job`, `_finalize_validation_jobs`).

Usage

Import and use when you need to:

  • Run the skill evolution pipeline via `skillclaw-evolve-server` CLI
  • Understand the full evolution cycle from sessions to published skills
  • Manage validation job staging and finalization
  • Trace the `_resolve_and_upload` publishing logic

Code Reference

Source Location

  • Repository: SkillClaw
  • File: `evolve_server/engines/workflow.py:L55-990`

Signature

class EvolveServer(EvolveEngineMixin):
    """Session-level evolve server backed by shared object storage."""

    def __init__(
        self,
        config: EvolveServerConfig,
        *,
        mock: bool = False,
        mock_root: str | None = None,
    ) -> None:

    async def run_once(self) -> dict:
        """Execute one full evolution cycle: drain -> summarize -> judge
        -> aggregate -> evolve/create -> verify -> publish."""

    async def _drain_sessions(self) -> tuple[list[dict], list[str]]:
        """Read all queued session JSON objects from shared storage."""

    def _upload_skill(self, skill: dict, action: str) -> str:
        """Upload a verified skill to shared storage and update manifest."""

    async def _resolve_and_upload(
        self, skill: dict, action_type: str
    ) -> tuple[str, bool]:
        """Verify a candidate skill and upload if accepted."""

    async def _queue_validation_job(
        self, skill: dict, action_type: str, sessions: list[dict],
        rationale: str, source: str, current_skill: Optional[dict],
    ) -> dict:
        """Stage a candidate skill for distributed validation."""

    async def _finalize_validation_jobs(self) -> tuple[list[dict], dict]:
        """Check validation results and publish/reject candidates."""

Import

from evolve_server.engines.workflow import EvolveServer

I/O Contract

Inputs

Name Type Required Description
config EvolveServerConfig Yes Storage, LLM, group_id, thresholds config
mock bool No Use local mock storage (default False)
mock_root None No Custom root for mock storage

Outputs

Name Type Description
run_once() returns dict Summary of evolution cycle results
_drain_sessions() returns tuple[list[dict], list[str]] Session payloads and consumed keys
_upload_skill() returns str Object key of uploaded SKILL.md
_resolve_and_upload() returns tuple[str, bool] (object key, accepted flag)
_queue_validation_job() returns dict Job record with action="queued_for_validation"

Usage Examples

Run Evolution Cycle

import asyncio
from evolve_server.engines.workflow import EvolveServer
from evolve_server.core.config import EvolveServerConfig

config = EvolveServerConfig(
    group_id="my-team",
    storage_backend="s3",
    storage_bucket="skillclaw-shared",
    llm_api_key="sk-...",
    llm_base_url="https://api.openai.com/v1",
    llm_model="gpt-4o",
)

server = EvolveServer(config)
result = asyncio.run(server.run_once())
print(f"Evolved skills: {result}")

Mock Mode for Testing

server = EvolveServer(config, mock=True, mock_root="/tmp/mock_storage")
result = asyncio.run(server.run_once())

Related Pages

Implements Principle

Requires Environment

Uses Heuristic

Page Connections

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