Gnoll Docs Back to Dashboard
Quick Start
Getting Started

Issue Compaction

AI-powered summarization of old closed issues to reduce database bloat while preserving essential context.

Overview

Over time, closed issues accumulate lengthy descriptions, debug logs, and conversation threads that are rarely revisited. Compaction uses AI to summarize these into concise descriptions, reducing storage while keeping the important context.

How It Works

  1. Candidates are identified — Closed issues older than a configurable threshold
  2. AI summarizes — The description is sent to Claude (Haiku) for summarization
  3. Original is preserved — The original description is saved in originalDescription so it can be restored
  4. Metadata is recordedcompactedAt timestamp and compactionTier are set on the issue

Compaction Tiers

TierCriteriaDescription
Tier 1Closed 30+ days agoLight summarization — key points preserved
Tier 2Closed 90+ days agoAggressive summarization — essential context only

Exclusions

Issues are excluded from compaction if:

Restoring Compacted Issues

Compaction is reversible. The original description is stored and can be restored at any time:

POST /api/v1/compaction/{id}/restore

This restores the original description and clears the compaction metadata.

Background Service

A background service runs weekly and automatically compacts up to 50 candidates per run. This requires an Anthropic API key configured in your application settings:

// appsettings.json
{
  "Anthropic": {
    "ApiKey": "sk-ant-..."
  }
}
Fallback: If the AI summarization fails (e.g., API unavailable), the service falls back to simple truncation (first 500 characters + "...").

API Endpoints

GET /api/v1/compaction/preview

Preview compaction candidates grouped by tier. Returns issue IDs, titles, and description lengths.

POST /api/v1/compaction/apply

Compact specific issues by ID.

{
  "issueIds": ["abc123", "def456"],
  "tier": 1
}
POST /api/v1/compaction/{id}/restore

Restore a compacted issue's original description.

MCP Tools

ToolDescription
analyze_compactionFind compaction candidates and preview what would be compacted
compact_issuesCompact specific issues
restore_compacted_issueRestore original description of a compacted issue