Letta · Schema

CompactionStats

Statistics about a memory compaction operation.

Artificial IntelligenceAgentsStateful AgentsMemoryMemGPTContinual LearningMCPMulti-AgentRAGOpen-Source

Properties

Name Type Description
trigger string What triggered the compaction (e.g., 'context_window_exceeded', 'post_step_context_check')
context_tokens_before object Token count before compaction (from LLM usage stats, includes full context sent to LLM)
context_tokens_after object Token count after compaction (message tokens only, does not include tool definitions)
context_window integer The model's context window size
messages_count_before integer Number of messages before compaction
messages_count_after integer Number of messages after compaction
View JSON Schema on GitHub

JSON Schema

letta-compactionstats-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/CompactionStats",
  "title": "CompactionStats",
  "properties": {
    "trigger": {
      "type": "string",
      "title": "Trigger",
      "description": "What triggered the compaction (e.g., 'context_window_exceeded', 'post_step_context_check')"
    },
    "context_tokens_before": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Context Tokens Before",
      "description": "Token count before compaction (from LLM usage stats, includes full context sent to LLM)"
    },
    "context_tokens_after": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Context Tokens After",
      "description": "Token count after compaction (message tokens only, does not include tool definitions)"
    },
    "context_window": {
      "type": "integer",
      "title": "Context Window",
      "description": "The model's context window size"
    },
    "messages_count_before": {
      "type": "integer",
      "title": "Messages Count Before",
      "description": "Number of messages before compaction"
    },
    "messages_count_after": {
      "type": "integer",
      "title": "Messages Count After",
      "description": "Number of messages after compaction"
    }
  },
  "type": "object",
  "required": [
    "trigger",
    "context_window",
    "messages_count_before",
    "messages_count_after"
  ],
  "description": "Statistics about a memory compaction operation."
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/letta-compactionstats"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.