amazon-q-developer-cli icon indicating copy to clipboard operation
amazon-q-developer-cli copied to clipboard

Initial implementation of `/compact` command for conversation summarization

Open aseemxs opened this issue 1 year ago • 2 comments

Create the core functionality for the /compact command that allows users to explicitly request conversation summarization. This includes command parsing, summary generation logic, and conversation state management. The implementation will focus on a straightforward approach where the history is cleared and replaced with an AI-generated summary of the previous conversation.

aseemxs avatar Apr 03 '25 21:04 aseemxs

Ideally, we should auto-compact as we progress, including in the background whilst waiting for the next human prompt.

Compaction should include both LLM and robotic reduction of context size.

Reductions could include:

  • Deduplication of read/write/read loops to have one latest copy of an object in context (perhaps with an LLM summarized history?) - files, profile contexts, other object types.
  • Latest version only of directory tree information
  • Summarization of Debug Loops, at the end of any debug cycle, or when output from a tool is more than X big, always summarize it early, once the first action has been performed on the output.
  • Summarization of a series of human prompts into an intent and history of tasks / Journal . <"Hey Q, what have I done so far?" could use the journal information>

jsamuel1 avatar Apr 03 '25 22:04 jsamuel1

Manual use of /compact could be the equivalent of "Remember all this and give me a summary". Most of the time, manual use of this command should be treated as an indicator of a bug.

jsamuel1 avatar Apr 03 '25 22:04 jsamuel1