Skip to content

Commit 7735582

Browse files
author
alcholiclg
committed
Merge branch 'main' of https://github.com/modelscope/ms-agent into release/1.6
2 parents 347cc96 + 30d4fc1 commit 7735582

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

docs/en/Components/Config.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ tools:
106106
107107
For the complete list of supported tools and custom tools, please refer to [here](./Tools.md)
108108
109+
<<<<<<< HEAD
109110
## Skills Configuration
110111
111112
> Optional, used when enabling Agent Skills
@@ -123,6 +124,42 @@ skills:
123124
```
124125
125126
For the complete skill module documentation (including architecture, directory structure, API reference, and security mechanisms), see [Agent Skills](./AgentSkills).
127+
=======
128+
## Memory Compression Configuration
129+
130+
> Optional, for context management in long conversations
131+
132+
```yaml
133+
memory:
134+
# Context Compressor: token detection + tool output pruning + LLM summary
135+
context_compressor:
136+
context_limit: 128000 # Model context window size
137+
prune_protect: 40000 # Token threshold to protect recent tool outputs
138+
prune_minimum: 20000 # Minimum pruning amount
139+
reserved_buffer: 20000 # Reserved buffer
140+
enable_summary: true # Enable LLM summary
141+
summary_prompt: | # Custom summary prompt (optional)
142+
Summarize this conversation...
143+
144+
# Refine Condenser: structured compression preserving execution trace
145+
refine_condenser:
146+
threshold: 60000 # Character threshold to trigger compression
147+
system: ... # Custom compression prompt (optional)
148+
149+
# Code Condenser: generate code index files
150+
code_condenser:
151+
system: ... # Custom index generation prompt (optional)
152+
code_wrapper: ['```', '```'] # Code block markers
153+
```
154+
155+
Supported compressor types:
156+
157+
| Type | Use Case | Compression Method |
158+
|------|----------|-------------------|
159+
| `context_compressor` | General long conversations | Token detection + Tool pruning + LLM summary |
160+
| `refine_condenser` | Preserve execution trace | Structured message compression (1:6 ratio) |
161+
| `code_condenser` | Code generation tasks | Generate code index JSON |
162+
>>>>>>> 30d4fc1fbcc786416b07df8e3940cbf46ac59dc2
126163

127164
## Others
128165

docs/zh/Components/config.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ tools:
106106
107107
支持的完整工具列表,以及自定义工具请参考 [这里](./tools)
108108
109+
<<<<<<< HEAD
109110
## 技能配置
110111
111112
> 可选,启用 Agent Skills 时使用
@@ -123,6 +124,42 @@ skills:
123124
```
124125
125126
完整的技能模块说明(包括架构、目录结构、API 参考和安全机制等),请参考 [智能体技能](./agent-skills)。
127+
=======
128+
## 内存压缩配置
129+
130+
> 可选,用于长对话场景的上下文管理
131+
132+
```yaml
133+
memory:
134+
# 上下文压缩器:基于token检测 + 工具输出裁剪 + LLM摘要
135+
context_compressor:
136+
context_limit: 128000 # 模型上下文窗口大小
137+
prune_protect: 40000 # 保护最近工具输出的token阈值
138+
prune_minimum: 20000 # 最小裁剪数量
139+
reserved_buffer: 20000 # 预留缓冲区
140+
enable_summary: true # 是否启用LLM摘要
141+
summary_prompt: | # 自定义摘要提示词(可选)
142+
Summarize this conversation...
143+
144+
# 精炼压缩器:保留执行轨迹的结构化压缩
145+
refine_condenser:
146+
threshold: 60000 # 触发压缩的字符阈值
147+
system: ... # 自定义压缩提示词(可选)
148+
149+
# 代码压缩器:生成代码索引文件
150+
code_condenser:
151+
system: ... # 自定义索引生成提示词(可选)
152+
code_wrapper: ['```', '```'] # 代码块标记
153+
```
154+
155+
支持的压缩器类型:
156+
157+
| 类型 | 适用场景 | 压缩方式 |
158+
|------|---------|---------|
159+
| `context_compressor` | 通用长对话 | Token检测 + 工具裁剪 + LLM摘要 |
160+
| `refine_condenser` | 需保留执行轨迹 | 结构化消息压缩(1:6压缩比) |
161+
| `code_condenser` | 代码生成任务 | 生成代码索引JSON |
162+
>>>>>>> 30d4fc1fbcc786416b07df8e3940cbf46ac59dc2
126163

127164
## 其他
128165

0 commit comments

Comments
 (0)