Skip to content

Commit 0ffdf54

Browse files
authored
feat(context): improve default LLM compression prompt for better continuity (#8424)
1 parent 8353fe1 commit 0ffdf54

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

astrbot/core/agent/context/compressor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ def __init__(
169169

170170
self.instruction_text = instruction_text or (
171171
"Based on our full conversation history, produce a concise summary of key takeaways and/or project progress.\n"
172+
"The primary goal of this summary is to enable seamless continuation of the work that follows.\n"
172173
"1. Systematically cover all core topics discussed and the final conclusion/outcome for each; clearly highlight the latest primary focus.\n"
173174
"2. If any tools were used, summarize tool usage (total call count) and extract the most valuable insights from tool outputs.\n"
174-
"3. If there was an initial user goal, state it first and describe the current progress/status.\n"
175-
"4. Write the summary in the user's language.\n"
175+
"3. If any materials (files, documents, code, references) were read during the conversation that may be helpful for subsequent work, list each one with its scope and path.\n"
176+
"4. If there was an initial user goal, state it first and describe the current progress/status.\n"
177+
"5. Write the summary in the user's language.\n"
176178
)
177179

178180
def should_compress(

astrbot/core/config/default.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,12 @@
123123
"context_limit_reached_strategy": "truncate_by_turns", # or llm_compress
124124
"llm_compress_instruction": (
125125
"Based on our full conversation history, produce a concise summary of key takeaways and/or project progress.\n"
126+
"The primary goal of this summary is to enable seamless continuation of the work that follows.\n"
126127
"1. Systematically cover all core topics discussed and the final conclusion/outcome for each; clearly highlight the latest primary focus.\n"
127128
"2. If any tools were used, summarize tool usage (total call count) and extract the most valuable insights from tool outputs.\n"
128-
"3. If there was an initial user goal, state it first and describe the current progress/status.\n"
129-
"4. Write the summary in the user's language.\n"
129+
"3. If any materials (files, documents, code, references) were read during the conversation that may be helpful for subsequent work, list each one with its scope and path.\n"
130+
"4. If there was an initial user goal, state it first and describe the current progress/status.\n"
131+
"5. Write the summary in the user's language.\n"
130132
),
131133
"llm_compress_keep_recent": 6,
132134
"llm_compress_provider_id": "",

0 commit comments

Comments
 (0)