> ## Documentation Index
> Fetch the complete documentation index at: https://docs.profy.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Darwin Self-Evolution

> Dual-ratchet quality assurance: how Expert skills evolve only in a better direction

Traditional AI applications are fixed after release — unless the developer manually updates them. Profy Experts are different: they self-evolve through real-world usage. Every quality conversation is a learning opportunity, and every skill improvement is backed by rigorous quality assurance.

> **Only gets better, never regresses.**

This isn't a slogan — it's a system-level guarantee. The dual-ratchet mechanism mathematically ensures that every evolution is a positive one.

## Evolution Triggers

Not every conversation triggers evolution. Only "quality interactions" are worth learning from:

* When tool calls in a conversation reach a certain threshold, evolution analysis is automatically triggered in the background
* Simple Q\&A ("What's the weather today?") won't trigger it — only conversations involving complex operations can expose the strengths and weaknesses of skills
* Evolution runs asynchronously in the background, with zero impact on the current conversation

<Tip>
  Evolution uses an independent background thread. Even if evolution analysis fails or times out, it will never affect an ongoing conversation.
</Tip>

## Evolution Analysis Process

<Steps>
  <Step title="Review conversation performance">
    Analyze where the Expert performed smoothly and where it hesitated or took detours.
  </Step>

  <Step title="Compare against existing skills">
    Compare behavioral patterns in the conversation against the Expert's current skill documentation — are there missing best practices? Are the scenarios actually encountered covered?
  </Step>

  <Step title="Generate improvement suggestions">
    Output specific improvement suggestions — not abstract "do better," but "add an error handling branch at step 3" or "simplify the template from 5 steps to 3."
  </Step>

  <Step title="Dual-ratchet scoring">
    Quantitatively score the skill before and after improvement across 10 dimensions, ensuring the improvement is genuinely "better" rather than just "different."
  </Step>
</Steps>

## Dual-Ratchet Quality Assurance

Darwin's core innovation is the **dual-ratchet mechanism** — like a ratchet that can only turn in one direction. The 10 scoring dimensions are divided into two groups, each with independent constraints:

### Quality Group (7 dimensions, no regression allowed)

| Dimension              | What it checks                                                  |
| ---------------------- | --------------------------------------------------------------- |
| Preamble quality       | Whether applicable scenarios and constraints are clearly stated |
| Process clarity        | Whether each step has clear execution criteria                  |
| Failure encoding       | Whether common failure scenarios are covered                    |
| Actionable specificity | Whether vague language is avoided, directly executable          |
| Architecture fit       | Whether the actual runtime environment is considered            |
| Anti-pattern coverage  | Whether "don't do this" items are explicitly listed             |
| Empirical grounding    | Whether it's based on real cases rather than imagination        |

### Efficiency Group (3 dimensions, must improve)

| Dimension             | What it checks                                            |
| --------------------- | --------------------------------------------------------- |
| Step economy          | Whether the same result is achieved with fewer steps      |
| Exploration reduction | Whether blind trial-and-error is reduced                  |
| Context footprint     | Whether the skill document itself is sufficiently concise |

<Note>
  "Context footprint" is automatically calculated by the system (character count of the skill document), not self-assessed by the AI. The skill document is injected into context with every conversation — the larger it is, the higher the fixed cost. This dimension ensures evolution doesn't produce "increasingly bloated" skills.
</Note>

### Passing Criteria

The only condition for an evolution suggestion to be accepted — **both must be met simultaneously**:

1. **Quality group total score does not decrease**: Post-improvement ≥ pre-improvement (minor fluctuations in individual dimensions are allowed, but no overall regression)
2. **Efficiency group strictly improves**: Post-improvement must be better than pre-improvement (ties are not allowed)

No "sacrificing quality for efficiency" or "sacrificing efficiency for quality" is allowed — **cross-group offsetting is prohibited**. This means most improvement suggestions are rejected by the system, but those that pass are guaranteed to be genuine progress.

## Creator Review

Even after passing dual-ratchet validation, evolution suggestions don't take effect automatically — they require the creator's final review:

<CardGroup cols={2}>
  <Card title="Accept" icon="check">
    The improvement is applied to the Expert's skills. The next time a conversation occurs, the Expert will use the improved behavioral patterns.
  </Card>

  <Card title="Ignore" icon="xmark">
    No changes are made. The suggestion is recorded but not applied.
  </Card>
</CardGroup>

You can view the complete evolution history in Studio's evolution log — suggestion time, triggering conversation, improvement content, before/after scores across all 10 dimensions, and review results. The full evolution trajectory is fully traceable.

## Differences from Traditional ML

| Dimension         | Traditional ML Training  | Darwin Self-Evolution         |
| ----------------- | ------------------------ | ----------------------------- |
| Data requirements | Large labeled datasets   | Real conversations as data    |
| Update method     | Batch retraining         | Incremental skill improvement |
| Quality assurance | Validation set metrics   | Dual-ratchet hard constraints |
| Transparency      | Black-box weight changes | Readable skill text           |
| Reversibility     | Requires model rollback  | Simply ignore the suggestion  |

Darwin doesn't modify model weights — it evolves by improving the "skill documents that guide AI behavior." The entire process is fully transparent, auditable, and reversible.
