Skip to main content

Module compaction

Module compaction 

Source
Expand description

Conversation compaction — turn a long message history into a structured summary.

Constants§

COMPACTION_SYSTEM_PROMPT
System prompt used for the compaction API call. Instructs the model to summarize, not continue the conversation.

Functions§

compact_conversation
Serialize the in-memory API message history into a readable transcript and ask the LLM to produce a structured summary. Called by /compact.