多Agent协作的智能会话上下文管理系统。
| 层级 | 触发 | 方法 | 成本 |
|---|---|---|---|
| ------ | ------ | ------ | ------ |
| L1 | 75% | 截断最后N条工具结果 | $0 |
| L2 | 90% | 摘要前半段 | $0 |
| L3 | 95% | AI智能摘要 | Agent's AI |
Persistent (365天) → Normal (30天) → Ephemeral (7天)
node skills/tiered-context-manager/scripts/tiered_standalone.js scan
node skills/tiered-context-manager/scripts/tiered_standalone.js stats
node skills/tiered-context-manager/scripts/tiered_standalone.js report
const { TieredContextEngine } = require('./tiered-engine.js');
const engine = new TieredContextEngine({
openclawVersion: '1.0.0'
});
const result = await engine.compact({
sessionFile: '/path/to/session.jsonl',
tokenBudget: 100000,
currentTokenCount: 85000
});
| 模块 | 文件 | 功能 |
|---|---|---|
| ------ | ------ | ------ |
| 主引擎 | tiered-engine.js | L1/L2/L3压缩入口 |
| L3压缩 | l3_ai_compressor.js | AI摘要任务队列 |
| 记忆分层 | memory_tiering.js | 三层记忆管理 |
| 跨Agent | cross_agent_context.js | 知识共享 |
| 实时监控 | realtime_monitor.js | 阈值监控 |
| 统计分析 | compression_stats.js | 效果统计 |
编辑 config/default.json:
{
"compression": {
"L1_threshold": 0.75,
"L2_threshold": 0.90,
"L3_threshold": 0.95,
"min_messages": 6
}
}
node skills/tiered-context-manager/scripts/run_tests.js
详见 references/architecture.md - 完整架构文档
共 1 个版本