compaction-prompts

Installation
SKILL.md

Compaction prompts

Use this skill to inspect, design, and update compaction_settings.prompt for a Letta agent.

Compaction runs when message history grows too large for the context window. Letta replaces older messages with a summary while keeping recent messages in context. The summary appears before the remaining recent messages, so the prompt should preserve enough background for the later messages to make sense. The goal is continuity, not just factual compression.

Official docs: https://docs.letta.com/guides/core-concepts/messages/compaction

Compaction lifecycle

Think of compaction as a lifecycle contract, not just a prompt string:

  1. Message history approaches the context window limit.
  2. Letta selects messages to compact according to the mode and sliding-window settings.
  3. A summarizer reads the selected messages. If an existing summary is being evicted, the new summary must incorporate it.
  4. Letta reinserts the summary before the retained recent messages.
  5. The next model turn relies on the summary plus recent raw messages as continuation context.

The summary is not a reply to the user. It is context for the next turn. It should be readable before the retained recent messages and should not require access to the evicted transcript.

Installs
36
Repository
letta-ai/skills
GitHub Stars
122
First Seen
May 24, 2026
compaction-prompts — letta-ai/skills