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 Experiential Learning

From Leeroopedia
Knowledge Sources
Domains Experiential_Learning, Knowledge_Retrieval, Relevance_Scoring
Last Updated 2026-10-29 00:00 GMT

Overview

A learning pattern that stores experiential lessons after each task (what worked, what failed, what to do differently) and retrieves relevant lessons before starting new tasks using a multi-factor relevance score.

Description

Experiential Learning creates a persistent knowledge base of lessons learned from completed tasks. Each lesson records: the task, the model/tool used, a quality score (1-10), what worked, what failed, what to do differently, and tags.

Before starting a new task, the agent queries past lessons using a relevance score that combines:

  1. Keyword overlap: How many task description words appear in the lesson's text fields, normalized by query length (weight: ×10).
  2. Model/tool match: If the planned model/tool matches the lesson's model/tool (bonus: +5).
  3. Recency: Newer lessons are more relevant (<1 day: +3, <7 days: +2, <30 days: +1).
  4. Quality extremes: Very good (≥9) or very bad (≤2) results are more informative than mediocre ones (+2 or +1).

The agent receives matched lessons with an advice field (drawn from do_differently, what_failed, or what_worked) and an advice_summary suitable for prompt injection.

Usage

Use this principle when an agent performs recurring task types and should avoid repeating mistakes or replicate successful strategies. The JSONL storage is simple and append-only. The relevance scoring is fast (no embeddings needed). Suitable for agents with moderate lesson volumes (hundreds, not millions).

Theoretical Basis

The relevance scoring formula:

relevance(l,q)=|matches||q|×10+Smodel+Srecency+Squality

# Abstract algorithm (NOT real implementation)
def relevance_score(learning, query_words, model_or_tool):
    score = 0
    # Keyword overlap (×10 weight)
    search_text = concatenate(learning.task, what_worked, what_failed, tags)
    matches = sum(1 for w in query_words if w in search_text.lower())
    score += (matches / len(query_words)) * 10
    # Model/tool match (+5)
    if model_or_tool and model_or_tool in learning.model_or_tool:
        score += 5
    # Recency bonus (+3/+2/+1)
    age_days = (now() - learning.timestamp) / 86400
    if age_days < 1: score += 3
    elif age_days < 7: score += 2
    elif age_days < 30: score += 1
    # Quality extremes (+2/+1)
    q = learning.quality_score
    if q >= 9 or q <= 2: score += 2
    elif q >= 8 or q <= 3: score += 1
    return score

The lesson store is pruned to a maximum (500 entries), keeping the most recent. The search window (200 recent lessons) balances relevance (recent) with coverage.

Related Pages

Implemented By

Page Connections

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