Auto-Summarization Loop for Openclaw

A high-performance memory management framework that implements automated context compression and multi-tiered storage for long-form AI interactions.

zhoujj8009
v1.0.0
Mar 18, 2026
1
997
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install auto-summarization-loop

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install auto-summarization-loop using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Auto-Summarization Loop?

The Auto-Summarization Loop is a sophisticated solution designed for high-fidelity AI personas to manage conversation context automatically. By utilizing Openclaw Skills, this system establishes a multi-level memory architecture consisting of core memory, working memory, and long-term memory. This approach ensures that the AI maintains its core persona while efficiently processing massive amounts of dialogue data without hitting token limits or incurring unnecessary costs.

This skill is particularly effective for developers building persistent AI agents that need to remember user preferences, historical events, and established consensus over weeks or months of interaction. It utilizes a sliding window strategy and dual-watermark triggers to balance performance and memory integrity, making it a cornerstone for professional-grade Openclaw Skills implementations.

Auto-Summarization Loop Use Cases

  • Creating high-fidelity AI roleplay characters with persistent long-term memory.
  • Optimizing token consumption to reduce API operational costs in enterprise chatbots.
  • Managing complex multi-session dialogues where historical context is critical for task completion.
  • Building structured user profiles that evolve naturally through conversation analysis.

How Auto-Summarization Loop Works

  1. The system initializes a MemoryConfig defining context limits, watermark ratios, and the summarization logic.
  2. Every new message triggers a watermark check to monitor the current token usage of the working memory.
  3. If the soft limit (70%) is reached, the skill initiates an asynchronous background compression of older messages into a long-term summary.
  4. If the hard limit (90%) is breached, a synchronous interception occurs to force immediate summarization and prevent context overflow.
  5. The prompt builder assembles a consolidated input for the LLM, combining the system prompt, historical summaries, user facts, and the active sliding window of recent messages.

Auto-Summarization Loop Setup

To integrate this module into your project, follow these initialization steps in your Python environment:

from scripts.memory_manager import (
    AutoSummarizationLoop, 
    MemoryConfig, 
    MemoryBlock,
    TriggerType
)

# Configure limits for your specific model
config = MemoryConfig(
    max_tokens=200000,           # Maximum context limit
    soft_limit_ratio=0.7,        # Async compression at 70%
    hard_limit_ratio=0.9,        # Sync compression at 90%
    working_messages=20,         # Keep last 20 messages intact
    summary_max_tokens=2000,     # Max length for generated summary
    summarize_fn=your_summarize_func
)

# Initialize the loop
manager = AutoSummarizationLoop(config)

Auto-Summarization Loop Data Schema & Taxonomy

The skill organizes session data into a structured hierarchy to ensure rapid retrieval and persistence:

Data Component Type Description
core_memory String The immutable System Prompt and persona definition.
working_memory JSON Array The sliding window containing the most recent conversation turns.
long_term_summary String The compressed historical context generated by the LLM.
user_facts Object Structured data points about the user (preferences, name, occupation).
last_update Timestamp Records the last time the memory block was modified.

Auto-Summarization Loop Advanced Features

  • Dual-Watermark Strategy: Seamlessly transitions between background async processing and emergency sync compression.
  • Structured Persona Extraction: Automatically identifies and stores user facts, event timelines, and agreed-upon consensus during summarization.
  • Extensible Summarization: Hook into various LLM providers to handle the summarization loop independently of the main chat model.
  • Sliding Window Optimization: Maintains a precise number of recent messages to ensure immediate local context remains coherent while using Openclaw Skills.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*