Skip to main content

case-matcher

基于特征包在案例库中做相似案例匹配。当用户描述现象(频段 + 场景 + 平台 + 幅度)且诊断流程尚未完成时触发,用于快速通道。

Source facts

Repository
cuipointer/ageis
Last source activity
May 8, 2026 at 01:58
Detected SKILL.md language
Chinese
Stars
0
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
case-matcher
description
基于特征包在案例库中做相似案例匹配。当用户描述现象(频段 + 场景 + 平台 + 幅度)且诊断流程尚未完成时触发,用于快速通道。
# case-matcher · 案例匹配 ## 何时使用 - `diagnose-desense` 工作流阶段二(模式匹配) - 用户主动检索历史案例 - 整改方案设计阶段寻找同类案例参考 ## 用法 ```python # 伪代码 from tools.case_matcher import search hits = search(feature_pack, top_k=5) for h in hits: print(h.case_id, h.similarity, h.summary) ``` ## 匹配逻辑 1. 关键字段粗筛:频段、平台系列、场景、超标量 ±3 dB 窗 2. 向量语义精排:对"现象描述"字段做 embedding + cosine 相似度 3. 返回 top-K + 置信度 ## 当前状态 - Sprint 0:stub - Sprint 1:粗筛可用(`tools/case_keeper.py search --band --scenario`) - **Sprint 2(已完成)**:轻量向量检索(`tools/case_vector_index.py`,TF-IDF + 字符 bigram,无外部依赖) ## 调用方式 ```bash # 混合检索(向量 + 粗筛) python3 tools/case_vector_index.py search "后摄 WiFi 2.4G 恶化" --band W24 --top-k 3 # 纯粗筛(无查询文本时) python3 tools/case_keeper.py search --band W24 --scenario rc --degradation 5 ``` ## 索引维护 案例新增 / 修改后必须重建索引: ```bash python3 tools/case_vector_index.py build ``` Hook `on-knowledge-change.sh` 在 `knowledge/cases/` 变更时自动触发(Sprint 2 起)。
View on GitHub