← 返回
未分类

Tiered Context Manager

多Agent协作的智能会话上下文管理系统。当需要管理AI agent的长会话压缩、多层记忆分层、跨Agent知识共享时激活。支持L1/L2/L3分层压缩、实时监控、统计分析。用于OpenClaw agent的上下文管理优化。
多Agent协作的智能会话上下文管理系统,适用于长会话压缩、多层记忆分层、跨Agent知识共享。支持L1/L2/L3分层压缩、实时监控与统计分析,优化OpenClaw agent的上下文管理。
scorpioxyb
未分类 clawhub v1.0.0 1 版本 99636.4 Key: 无需
★ 0
Stars
📥 274
下载
💾 0
安装
1
版本
#compression#context#latest#multi-agent#openclaw

概述

Tiered Context Manager

多Agent协作的智能会话上下文管理系统。

核心功能

1. 分层压缩 (Tiered Compression)

层级触发方法成本
------------------------
L175%截断最后N条工具结果$0
L290%摘要前半段$0
L395%AI智能摘要Agent's AI

2. 记忆分层 (Memory Tiering)

Persistent (365天) → Normal (30天) → Ephemeral (7天)

3. 跨Agent协作

  • 共享记忆
  • Inbox任务队列
  • 防冲突机制

使用方式

扫描压缩

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

API

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:

{
  "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 个版本

  • v1.0.0 当前
    2026-05-07 20:27 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,376 📥 320,230
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,079 📥 808,907
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 676 📥 325,283