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:42 evey Hermes plugins Identity Evolution

From Leeroopedia
Knowledge Sources
Domains Identity, Self_Improvement, Behavioral_Learning
Last Updated 2026-10-29 00:00 GMT

Overview

A self-improvement pattern where the agent extracts behavioral rules from its experiences and appends them to its identity file (SOUL.md), evolving its behavior over time through accumulated lessons.

Description

Identity Evolution enables an agent to learn from experience and modify its own behavioral guidelines. The pattern:

  1. Reflection input: The agent provides a reflection (what it learned) or an explicit behavior rule.
  2. Rule extraction: If no explicit rule is given, the LLM distills the reflection into a single concise behavioral rule (max 15 words, starting with a verb like "Always", "Never", "Prefer").
  3. Append to identity: The rule is added to a ## Learned Behaviors section in SOUL.md with a date annotation.
  4. Bounded growth: Only the most recent N rules (default 10) are kept, preventing unbounded growth while preserving recent learning.

This creates a feedback loop: the agent's experiences produce behavioral rules, which shape future behavior, producing new experiences. The bounded window (10 rules) ensures the identity stays current and doesn't accumulate contradictory or outdated rules.

Usage

Use this principle when an agent should adapt its behavior based on experience. Suitable for long-running autonomous agents that encounter recurring situations. The LLM-based rule extraction ensures rules are concise and actionable. Not suitable for systems where behavior must be fully deterministic and operator-controlled.

Theoretical Basis

The identity evolution loop:

experience→LLM extractrule→appendSOUL.md

# Abstract pattern (NOT real implementation)
REFLECT_PROMPT = """Extract ONE concise behavioral rule (max 15 words).
Start with a verb (Always, Never, Prefer, Check, Use).
Reflection: {reflection}
Behavioral rule:"""

rule = call_llm(REFLECT_PROMPT.format(reflection=reflection))
behaviors.append(f"- {rule} ({date})")
behaviors = behaviors[-MAX_LEARNED:]  # keep last 10
soul_md.update_learned_behaviors(behaviors)

The bounded growth window (last 10) acts as a sliding window of recent behavioral learning, ensuring the agent's identity reflects its most recent experiences rather than its entire history.

Related Pages

Implemented By

Page Connections

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