cf_judge
Determines whether the current request can hit existing cached context using layered keyword matching, time decay, and negative filtering, then returns explainable evidence before cache injection.
Instructions
判定当前请求能否命中既有缓存上下文:关键词分层(实体锚词/意图修饰词)、三层匹配、时效衰减、负向过滤,输出可解释证据。【何时调】要判断「这段历史/记忆值不值得复用、能不能命中」时,在 cf_inject 之前调一次;不要每轮都调。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"query": "<query>",
"entries": "<entries>"
},
"name": "cf_judge"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| now | No | 用于测试的当前时间戳(毫秒),必须 ≥ 0 | |
| topK | No | 返回候选数,默认 5;必须为 ≥ 1 的整数 | |
| query | Yes | 当前请求文本(不能为空:空文本无实体锚词,判定结果恒为未命中) | |
| entries | Yes | 缓存条目列表(记忆/历史对话) | |
| blacklist | No | 黑名单词,支持 /regex/ 形式 | |
| hitTokens | No | 本次请求厂商 usage 命中 tokens(prompt_cache_hit_tokens),供 cf_meter 计费相对值曲线累计;必须 ≥ 0 | |
| threshold | No | 命中阈值,默认 5;必须 ≥ 0 | |
| missTokens | No | 本次请求厂商 usage 未命中 tokens(prompt_cache_miss_tokens),供 cf_meter 计费相对值曲线累计;必须 ≥ 0 |