# CompactionSettings

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/http-api/schemas/compactionsettings/
> Summary: OpenAPI request or response schema for CompactionSettings, including required fields, defaults, constraints, and linked nested types.

[← All HTTP schemas](/http-api/schemas/)

Determines how an agent compacts its conversation history.

**Shape:** `object`

| Property | Required | Type | Description | Rules |
|---|---|---|---|---|
| `strategy` | no | [`CompactionStrategyKind`](/http-api/schemas/compactionstrategykind/) | Gets the strategy to apply. | — |
| `triggerTokens` | no | `integer (int32)` | Gets the token count above which compaction is triggered. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `triggerMessages` | no | `integer (int32)` | Gets the message count above which compaction is triggered. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `triggerTurns` | no | `integer (int32)` | Gets the turn count above which compaction is triggered. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `minimumPreservedTurns` | no | `integer (int32)` | Gets the minimum number of turns kept for CompactionStrategyKind.SlidingWindow. 2 is used when it is not given. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `minimumPreservedGroups` | no | `integer (int32)` | Gets the minimum number of groups kept for CompactionStrategyKind.Truncation, CompactionStrategyKind.ToolResult and CompactionStrategyKind.Summarization. 4 is used when it is not given. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `maxContextWindowTokens` | no | `integer (int32)` | Gets the context window size. It is required for CompactionStrategyKind.ContextWindow and ignored by the other strategies. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `maxOutputTokens` | no | `integer (int32)` | Gets the upper output token limit for CompactionStrategyKind.ContextWindow. When it is not given, `ModelBinding.MaxOutputTokens` from the agent's own model binding is used, and 4096 when that is missing too. | pattern `^-?(?:0\\|[1-9]\d*)$` |
| `summarizationPrompt` | no | `string` | Gets the extra instruction added to the summarization prompt for CompactionStrategyKind.Summarization and CompactionStrategyKind.Pipeline. When `null` the default prompt of MAF is used. | — |
| `summarizationModel` | no | `null` oneOf [`ModelBinding`](/http-api/schemas/modelbinding/) | — | — |
