Compress Session
Get compressed conversation context for a session.
Compress your conversation into hierarchical summaries with rich metadata,
perfect for reducing token usage in LLM context windows.
**Authentication Required**: Bearer token, API key, or session token
**What it returns**:
- **short_term**: Last 15 messages compressed
- **medium_term**: Last ~100 messages compressed
- **long_term**: Full session compressed
- **topics**: Key topics discussed
- **session_intent / current_state / next_steps**: Structured session context for agents
- **project_context / files_accessed / technical_details**: Project and file operation metadata
**Perfect for**:
- Reducing token usage in LLM prompts (96% savings)
- Providing conversation context without full history
- Quick conversation overview for AI agents
- Project documentation and status snapshots
**Input**: Just the session ID - all context is extracted automatically
Path parameters
Response
Session summary (compressed context)
Example response
{
"ai_agent_note": "To find more details about this conversation, search memories with metadata filter: sessionId='session_123'",
"from_cache": true,
"session_id": "session_123",
"summaries": {
"current_state": "Working: requirements gathered. Not working: none. Blockers: none.",
"last_updated": "2024-01-15T10:31:00Z",
"long_term": "Product planning and strategy conversation focused on Q4 roadmap development and execution.",
"medium_term": "Ongoing product planning discussion for Q4, covering objectives, timelines, and resource allocation.",
"next_steps": [
"Draft roadmap outline",
"Review with stakeholders"
],
"session_intent": "Plan the Q4 product roadmap with clear objectives and milestones.",
"short_term": "User requested help planning Q4 product roadmap. Assistant offered to help identify key objectives.",
"topics": [
"product planning",
"Q4 roadmap",
"objectives",
"strategy"
]
}
}Changes
Changed in 5 of the 37 revisions of this API.717
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
This revision also has 1 change that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
- ●
removed the optional property
/from the response with the statusresponse-optional-property-removed
This revision also has 8 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ●
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
added the optional property
/to the response with the statusresponse-optional-property-added
- ○
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
added the optional property
//to the response with the statusresponse-optional-property-added
- ○
- ○
endpoint added
endpoint-added
- ○