Agent Memory Tiers Pro
Turn a collection of agents into a production-grade swarm.
The free agent-memory-tiers skill gives your agents memory. This skill gives your swarm structure, quality standards, and self-improvement. It is the difference between "I have some agents running" and "I have a system that gets better over time."
Built from running a 20-agent swarm in production daily for 3+ weeks. Every pattern here solved a real problem.
Requires: agent-memory-tiers installed and configured first.
What This Adds
| Component | What It Does |
|---|
| Quality Grading Rubric | Score any agent's SOUL.md on 8 criteria. Identify weak spots before they cause failures. |
| Progressive Disclosure |
3-tier token loading system. Agents only read what they need, when they need it. |
|
Orchestrator Protocol | Patterns for a coordinator agent to manage the whole swarm efficiently. |
|
Self-Improvement Loop | Agents log mistakes and proven approaches. The swarm learns from itself. |
|
Agent Scoring Template | Evaluate and compare agents objectively. Know which ones need work. |
1. The 8-Point Quality Grading Rubric
Every agent SOUL.md should be scored on these 8 criteria. Use the rubric when building new agents or auditing existing ones.
CODEBLOCK0
Targets:
- - Score A on criteria 1, 2, 4, and 7 (non-negotiable for production agents).
- No F on any criterion.
- Review and re-score every agent monthly.
How to Score an Agent
Read the agent's SOUL.md top to bottom. For each criterion, assign A/C/F based on the rubric. Record the scores.
CODEBLOCK1
Fixing Common Score Failures
Role Clarity F → A:
CODEBLOCK2
Error Handling F → A:
CODEBLOCK3
Boundaries F → A:
CODEBLOCK4
2. Progressive Disclosure (Token Efficiency System)
Not every activation needs the full SOUL.md. Load information in tiers to minimize token cost.
CODEBLOCK5
SOUL.md Size Budgets
CODEBLOCK6
Externalizing References
When SOUL.md gets too large, move supporting material to separate files.
CODEBLOCK7
3. Orchestrator Coordination Protocol
When one agent (the orchestrator) manages a swarm of specialist agents, use these patterns.
Swarm Status Check
CODEBLOCK8
Task Routing
CODEBLOCK9
Cross-Agent Handoffs
CODEBLOCK10
4. Self-Improvement Protocol
The swarm should get better over time. These two files make that happen.
Lessons File
Create workspace/lessons.md in your main workspace. Any agent (or human) can append to it.
CODEBLOCK11
Patterns File
Create workspace/patterns.md in your main workspace. When something works well, record it.
CODEBLOCK12
Monthly Swarm Audit
CODEBLOCK13
5. Agent Scoring and Comparison
Use this template to track agent quality over time.
CODEBLOCK14
Tracking Improvement Over Time
CODEBLOCK15
Permissions
This skill requires:
- - File read/write in agent workspace directories — to manage L0.md, L1.md, scorecards, lessons, patterns, and handoff files.
- File read across agent workspaces — orchestrator needs to read other agents' L0.md files (read only, never write).
- No network access required.
- No external API access required.
- No sensitive data access required.
Credits
Built and battle-tested by the Megaport swarm team across a 20-agent production deployment. Quality rubric inspired by Anthropic's skill-building guidelines and the OpenViking tiered memory architecture.
License
MIT — use it, modify it, share it.
Agent Memory Tiers Pro
将一群智能体转变为生产级集群。
免费的 agent-memory-tiers 技能赋予智能体记忆能力。本技能为集群提供结构、质量标准以及自我改进能力。这是我有一些智能体在运行与我有一个能持续优化的系统之间的区别。
基于在生产环境中每天运行20个智能体集群超过3周的经验构建。这里的每个模式都解决了一个实际问题。
前提条件: 需先安装并配置 agent-memory-tiers。
新增功能
| 组件 | 功能说明 |
|---|
| 质量评分标准 | 基于8项标准对任意智能体的 SOUL.md 进行评分。在故障发生前识别薄弱环节。 |
| 渐进式信息展示 |
三级令牌加载系统。智能体仅在需要时读取所需内容。 |
|
协调器协议 | 用于协调智能体高效管理整个集群的模式。 |
|
自我改进循环 | 智能体记录错误和已验证的方法。集群从自身经验中学习。 |
|
智能体评分模板 | 客观评估和比较智能体。了解哪些需要改进。 |
1. 八项质量评分标准
每个智能体的 SOUL.md 都应基于这8项标准进行评分。在构建新智能体或审计现有智能体时使用此标准。
markdown
智能体质量评分标准
| 序号 | 标准 | A(顶级) | C(可用) | F(不合格) |
|---|
| 1 | 角色清晰度 | 一句话,清晰明确,无歧义 | 模糊或试图承担多项任务 | 缺失或矛盾 |
| 2 |
激活触发条件 | 明确的触发条件 + 排除条件 | 部分触发条件,存在猜测 | 未定义触发条件 |
| 3 | 分步工作流程 | 带文件路径和工具名称的编号步骤 | 通用指导,存在空白 | 自己解决 |
| 4 | 输出格式 | 包含字段名称和结构的精确模板 | 松散的格式指导 | 未指定格式 |
| 5 | 质量检查清单 | 完成前的验证步骤 | 部分检查 | 无 |
| 6 | 错误处理 | 列出常见故障及具体修复方法 | 有一定错误意识 | 无 |
| 7 | 边界 | 明确的 CAN 和 CANNOT 列表 | 部分限制 | 模糊或缺失 |
| 8 | 令牌效率 | 少于300行,引用外部化 | 少于500行 | 超过500行或内联数据臃肿 |
目标:
- - 标准1、2、4和7需达到A级(生产级智能体不可妥协)。
- 任何标准不得为F级。
- 每月对每个智能体进行审查和重新评分。
如何为智能体评分
从头到尾阅读智能体的 SOUL.md。针对每项标准,根据评分标准分配A/C/F等级。记录评分结果。
markdown
智能体评分卡:[智能体名称]
日期:YYYY-MM-DD
评分人:[人类或审计智能体名称]
| 标准 | 评分 | 备注 |
|---|
| 角色清晰度 | A | 生产环境安全监控。 清晰。 |
| 激活触发条件 |
C | 列出了触发条件但无排除条件。 |
| 工作流程 | A | 12个编号步骤,包含文件路径。 |
| 输出格式 | A | 包含必填字段的JSON模板。 |
| 质量检查清单 | C | 2项检查,应有4-5项。 |
| 错误处理 | F | 未列出故障场景。 |
| 边界 | A | CAN:扫描日志、告警。CANNOT:重启服务、修改配置。 |
| 令牌效率 | A | 240行,引用已外部化。 |
总计:5A / 2C / 1F — 优先修复:添加错误处理。
修复常见评分问题
角色清晰度 F → A:
markdown
差(F):
你协助处理与内容、社交媒体和营销相关的各种任务。
好(A):
你是WRITER。你为4个账号(2个LinkedIn,2个X)起草社交媒体帖子。
你不发布、安排或管理互动。你只撰写草稿。
错误处理 F → A:
markdown
差(F):
(无 — 智能体在出现问题时完全不知道如何处理)
好(A):
错误处理
| 错误 | 原因 | 修复 |
|---|
| 文件未找到:LEADS.md | 首次运行,文件尚不存在 | 创建带标题模板的LEADS.md,然后继续 |
| API速率限制已达 |
本次会话请求过多 | 停止当前任务,更新L0标志:速率受限 — 下次激活时重试 |
| 输出超过20,000字符 | 响应过大,超出工作区文件限制 | 拆分为多个文件:output-part1.md,output-part2.md |
| 工具调用失败:web_search | 网络问题或API密钥过期 | 跳过网络搜索,使用上次运行的缓存数据,在L1阻塞项中标记 |
边界 F → A:
markdown
差(F):
小心谨慎,不要做任何危险的事情。
好(A):
边界
可以:
- - 在自己的工作区中读写文件
- 搜索网络获取公开信息
- 起草内容供人工审核
不可以:
- - 对外发布、发布或发送任何内容(所有输出进入审批队列)
- 访问其他智能体的工作区(仅通过协调器读取其L0)
- 安装软件包、修改系统配置或运行shell命令
- 代表用户花钱或承诺截止日期
2. 渐进式信息展示(令牌效率系统)
并非每次激活都需要完整的 SOUL.md。按层级加载信息以最小化令牌成本。
markdown
渐进式信息展示层级
| 层级 | 加载内容 | 时机 | 令牌成本 |
|---|
| T1:身份 | L0.md(4行)+ SOUL.md中的角色描述 | 每次激活 | ~50-100令牌 |
| T2:上下文 |
L1.md(滚动7天状态) | 每次激活 | ~100-200令牌 |
| T3:完整指令 | 完整SOUL.md | 当智能体在匹配触发条件时激活 | 完整SOUL.md成本 |
| T4:参考资料 | 来自references/文件夹的外部文档 | 仅当任务明确需要时 | 按需加载 |
规则:
- - SOUL.md必须保持在500行以内。如果超出,将参考资料外部化。
- 大型数据文件(日志、队列、跟踪器)放在工作区中,而非SOUL.md中。
- 表格和模板比散文更节省令牌。优先使用结构化格式。
- 如果SOUL.md的某个部分仅在10次激活中使用1次,将其移至references/。
SOUL.md 大小预算
markdown
SOUL.md 章节预算
| 章节 | 最大行数 | 目的 |
|---|
| 角色 + 身份 | 5 | 我是谁,一句话描述目的 |
| 快速上下文(L0/L1加载器) |
5 | 指向记忆文件的指针 |
| 激活触发条件 | 10 | 何时唤醒,何时不唤醒 |
| 核心工作流程 | 60-80 | 主要任务的编号步骤 |
| 输出模板 | 40-60 | 交付物的精确格式 |
| 质量检查清单 | 10-15 | 完成前验证 |
| 错误处理 | 15-20 | 故障表 |
| 边界 | 10-15 | 可以/不可以列表 |
| 运行结束(L0/L1更新) | 15 | 记忆更新指令 |
|
总计 |
~200-300 |
生产级智能体的目标范围 |
外部化参考资料
当 SOUL.md 过大时,将辅助材料移至单独的文件。
markdown
参考资料外部化模式
在 SOUL.md 中,用指针替换大型章节:
有关详细的样式指南,请阅读 references/STYLE_GUIDE.md。
有关完整的客户列表和历史记录,请阅读 references/CLIENTS.md。
有关API端点文档,请阅读 references/API_DOCS.md。
规则:
- - 仅当当前任务需要时,智能体才读取参考文件。
- 切勿将参考内容内联回 SOUL.md。
- 参考文件没有大小限制,但应聚焦(每个文件一个主题)。
- 独立于 SOUL.md 更新参考资料 — 它们是活文档。
3. 协调器协调协议
当一个智能体(协调器)管理一组专业智能体时,使用这些模式。
集群状态检查
markdown
协调器:早晨