多Agent协作的智能会话上下文管理系统,适用于长会话压缩、多层记忆分层、跨Agent知识共享。支持L1/L2/L3分层压缩、实时监控与统计分析,优化OpenClaw agent的上下文管理。
多Agent协作的智能会话上下文管理系统。
层级触发方法成本L175%截断最后N条工具结果$0L290%摘要前半段$0L395%AI智能摘要Agent's AI
text
Persistent (365天) → Normal (30天) → Ephemeral (7天)
bash
node skills/tiered-context-manager/scripts/tiered_standalone.js scan
bash
node skills/tiered-context-manager/scripts/tiered_standalone.js stats
bash
node skills/tiered-context-manager/scripts/tiered_standalone.js report
javascript
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.jsL1/L2/L3压缩入口L3压缩l3_ai_compressor.jsAI摘要任务队列记忆分层memory_tiering.js三层记忆管理跨Agentcross_agent_context.js知识共享实时监控realtime_monitor.js阈值监控统计分析compression_stats.js效果统计
编辑 config/default.json:
json
{
"compression": {
"L1_threshold": 0.75,
"L2_threshold": 0.90,
"L3_threshold": 0.95,
"min_messages": 6
}
}
bash
node skills/tiered-context-manager/scripts/run_tests.js
详见 references/architecture.md - 完整架构文档