effect-uai-auto-compaction

Summarize older conversation turns to stay within token budgets.

30|4|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/betalyra/effect-uai --skill effect-uai-auto-compaction
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-uai-auto-compaction
Source: https://github.com/betalyra/effect-uai/tree/main/skills/effect-uai-auto-compaction
Command: npx skills add https://github.com/betalyra/effect-uai --skill effect-uai-auto-compaction

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Keep conversations within context by summarizing earlier history into compact items when thresholds are crossed, while preserving the most recent utterances for continuity.

Core Features & Use Cases

  • Automatic history compaction: When a turn budget or token budget is exceeded, the history is summarized and replaced with a compact representation.
  • Last-Items preservation: The most recent items stay verbatim to maintain coherence.
  • State-driven workflow: The compaction is integrated as a regular streamTurn step and works alongside normal turns.

Quick Start

Start your agent loop with auto-compaction enabled; when the history grows past configured limits, older turns are summarized and replaced, and the loop continues.

Frequently Asked Questions about effect-uai-auto-compaction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I compress conversation history to stay within token budgets during long-running agent sessions?

To compress conversation history within token budgets, you can use an auto-compaction step that summarizes older turns while preserving the most recent utterances verbatim for continuity. This state-driven workflow triggers automatically when configured thresholds are crossed.

What is auto-compaction for multi-turn chats and how does it preserve context?

Auto-compaction for multi-turn chats is a process that summarizes older conversation history into compact representations when turn or token budgets are exceeded. It preserves the most recent items verbatim, ensuring the AI agent maintains contextual coherence without losing critical recent state.

When should I implement history summarization in my AI agent state management?

You should implement history summarization in AI agent state management when long-running sessions or multi-turn chats exceed context limits. It replaces older turns with compact summaries, retaining recent utterances to maintain continuity while staying within token budgets.

Does conversation history compaction keep the most recent messages intact?

Yes, conversation history compaction keeps the most recent messages intact. While older turns are summarized and replaced with a compact representation to save tokens, the last items are preserved verbatim to maintain conversational coherence and state continuity.

What is the best way to manage context limits in long-running agent sessions?

The best way to manage context limits in long-running agent sessions is integrating an automatic compaction step into the streamTurn workflow. This summarizes older history when token or turn thresholds are exceeded, replacing it with a compact representation while keeping recent items verbatim.

Why does my multi-turn chat lose earlier context after hitting token limits?

Multi-turn chats lose earlier context after hitting token limits if auto-compaction is not configured. Implementing a compaction step summarizes older history into compact items and updates the state, preserving recent utterances while preventing context loss from hard truncation.