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:AMAP ML SkillClaw Session Summarization

From Leeroopedia
Knowledge Sources
Domains Session_Processing, LLM_Summarization
Last Updated 2026-10-22 00:00 GMT

Overview

A dual-layer session summarization technique that produces both a lossless programmatic trajectory and an LLM-generated analysis, reducing raw session data from megabytes to tens of kilobytes.

Description

Session summarization addresses the problem of condencing large raw session recordings (full conversation logs with tool calls, results, and reasoning) into compact representations suitable for LLM evolution prompts. The dual-layer approach preserves maximum information: the trajectory is a programmatic, lossless step-by-step text trace built without LLM (no information loss, deterministic), while the summary is an LLM-generated analysis that identifies patterns, problems, and skill relevance. Both are used by downstream evolution stages. Metadata extraction adds `_skills_referenced`, `_avg_prm`, and `_has_tool_errors` fields.

Usage

Use this principle when designing systems that need:

  • Compact session representations for LLM prompts
  • Lossless trajectory recording alongside LLM analysis
  • Metadata extraction from conversation sessions
  • Parallel processing of multiple sessions

Theoretical Basis

The dual-layer design ensures both fidelity and insight:

  1. Trajectory (lossless): Programmatic extraction of all turns, tool calls, and results into a structured text format. Zero information loss, fully deterministic.
  2. Summary (LLM analysis): The trajectory is fed to an LLM which produces a concise analysis. This is lossy but captures patterns the trajectory alone cannot express.
  3. Metadata: `_skills_referenced` (set of skill names from injected_skills and read_skills), `_avg_prm` (mean PRM score), `_has_tool_errors` (boolean).

sizeraw∼O(MB),sizecompact∼O(10KB)

# Abstract algorithm (NOT real implementation)
async def summarize_session(llm, session):
    extract_metadata(session)  # skills, prm, errors
    trajectory = build_trajectory(session)  # lossless, programmatic
    summary = await llm.analyze(trajectory)  # LLM-generated
    session._trajectory = trajectory
    session._summary = summary

Related Pages

Implemented By

Page Connections

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