Skill Retrieval Gate
Goal
Use this skill to decide whether the current task should query memory_search before following another skill or workflow.
This skill is for retrieval judgment, not mandatory retrieval.
Core rule
Do not make every skill query memory first.
Instead:
- 1. Judge whether the task depends on local knowledge or history
- Retrieve only when that dependency is real
- Load only a few high-signal results
- Fall back immediately if retrieval is weak, unavailable, or unnecessary
Example triggers
This skill is especially useful for requests like:
- - continue the previous work on this project
- check what we already documented before you proceed
- use project memory first if this depends on earlier decisions
- decide whether retrieval is worth it before following the skill
- base this on existing notes instead of asking me again
Workflow
1. Decide whether retrieval is needed
Use decision-flow when the request may depend on:
- - project history
- prior decisions
- local knowledge bases
- user-specific preferences
- previously organized notes
2. Judge the skill tier
Use skill-tiering to classify the current skill or task into:
- - retrieval-first
- retrieval-optional
- retrieval-usually-skip
3. Build the query
Use query-construction to build a compact query from:
- - task object
- task type
- key module, symptom, or entity
4. Keep the result set small
Use result-trimming to limit context expansion.
Default rule:
- - fetch top 1-3 results first
- only expand deeper when clearly needed
5. Fall back fast
Use fallback-rules if retrieval is empty, noisy, low-confidence, unavailable, or unnecessary.
Anti-patterns
Avoid these mistakes:
- - forcing retrieval for every task
- copying the entire user prompt into INLINECODE1
- expanding every hit just because it matched
- dragging weak or stale snippets into later reasoning
- treating retrieval failure as a blocker instead of falling back
Output expectation
After using this skill, the agent should be able to answer:
- - Should I call
memory_search for this task? - What query should I use?
- How many results should I keep?
- Should I fall back to the original skill flow immediately?
技能检索门控
目标
使用此技能判断当前任务是否应在执行其他技能或工作流之前查询memory_search。
此技能用于检索判断,而非强制检索。
核心规则
不要让每个技能都优先查询记忆。
相反:
- 1. 判断任务是否依赖本地知识或历史记录
- 仅在确实存在依赖关系时进行检索
- 仅加载少量高信号结果
- 若检索结果薄弱、不可用或不必要,立即回退
触发示例
此技能特别适用于以下请求:
- - 继续此项目的先前工作
- 在继续之前检查我们已有的文档记录
- 若依赖先前决策,优先使用项目记忆
- 在执行技能前判断检索是否值得
- 基于现有笔记而非再次询问我
工作流程
1. 判断是否需要检索
当请求可能依赖以下内容时,使用决策流程:
- - 项目历史
- 先前决策
- 本地知识库
- 用户特定偏好
- 先前整理的笔记
2. 判断技能层级
使用技能分层将当前技能或任务分类为:
3. 构建查询
使用查询构建从以下内容构建简洁查询:
4. 保持结果集精简
使用结果修剪限制上下文扩展。
默认规则:
5. 快速回退
若检索结果为空、存在噪声、置信度低、不可用或不必要,使用回退规则。
反模式
避免以下错误:
- - 强制每个任务都进行检索
- 将整个用户提示复制到memory_search中
- 仅因匹配就扩展每个命中结果
- 将薄弱或过时的片段拖入后续推理
- 将检索失败视为障碍而非回退
输出预期
使用此技能后,智能体应能回答:
- - 我应该为此任务调用memory_search吗?
- 应该使用什么查询?
- 应保留多少结果?
- 是否应立即回退到原始技能流程?