Compacting a conversation

Compact a long conversation in Cloudera Agent Studio to summarize the older history and free context, while you keep working in the same conversation.

The /compact command folds the older history of the conversation into a summary and keeps a recent part in its original form. Agent Studio does not delete the original messages, and you can undo the compaction with /restore. See Context, compaction, and token usage.

Compaction asks the model to summarize the history. It can use model resources, and it can fail if the model or the runtime is not available.

  • Open a chat with an available agent, and wait until the chat is ready. See Slash commands in chat.
  • Make sure that the conversation has enough history for Agent Studio to compact. A conversation that is not empty does not always have enough.
  • Make sure that no run is active or paused. The runtime refuses a compaction while a run is active, including a run that waits for your input. Resolve the pause, wait for the run to finish, or stop the run.
  1. Optional: In the message box, enter /context, and then press Enter to check the occupancy of the context window.
  2. In the message box, enter /compact, and then press Enter.
    Do not add text after the command. Agent Studio ignores it, and you cannot use it to give an instruction for the summary.
  3. Review the command card.
    The card shows the number of messages that Agent Studio compacted and the summary when one is supplied. The context meter updates.
  4. Continue the conversation with an ordinary message.

The conversation continues with a summary of the earlier history and the recent messages in their original form. If the conversation has no history that Agent Studio can compact, the card shows Nothing to compact yet.