knowledge-flywheel
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "knowledge-flywheel" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-08a51642bf8ce64e728f21c2ef428548e333baea508d263d64577ffbed34847c. Verify the upstream source and version against https://skillhub.cn/skills/user_d304276b/knowledge-flywheel before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Knowledge Flywheel: a framework to turn static knowledge and pipelines into a self-running flywheel — use → feedback → calibrate → better recall → more use — describing a three-ring self-running system with fault-triggered repair and automatic pipeline registration.
Introduction source: third_party · user_d304276b · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Inputs and outputs
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: knowledge-flywheel
slug: knowledge-flywheel
displayName: Knowledge Flywheel(知识飞轮框架)
version: "1.0.0"
description: 知识/记忆/流水线飞轮框架 — 三环自运转、故障牵引修复、流水线自动注册。把静态知识和流水线变成自运转飞轮:使用 → 反馈 → 校准 → 更准召回 → 更多使用。
tags: [flywheel, knowledge, pipeline, self-healing, memory]Knowledge Flywheel
把静态知识/流水线变成自运转飞轮:使用 → 反馈 → 校准 → 更准召回 → 更多使用。
核心模式
三环飞轮
| 环 | 频率 | 动作 | 实现 |
|---|---|---|---|
| 内环 | 每次运行 | 对召回的事实做正向反馈 | fact_flywheel.py inner |
| 中环 | 每次运行 | trust 微调:高频事实 trust↑,零检索事实 trust↓ | fact_flywheel.py middle |
| 外环 | 每周 | 质量校准:归档长期零检索,去重重复内容 | fact_flywheel.py outer |
故障牵引修复
故障发生 → fault_traction.py 提取错误特征 → 匹配教训库 → 输出 top_fix → 自动/人工修复 → 记录结果
流水线飞轮注册
python3 pipeline_flywheel.py register <name> <process_fn>
python3 pipeline_flywheel.py run <name> <input>
python3 pipeline_flywheel.py list
接入现有流水线
在 cron prompt 里追加:
若执行失败,立即运行:
python3 fault_traction.py "<错误特征>"
按建议修复后重试。
设计原则
- 全自动优先:飞轮必须自动运转,不需要用户手动参与
- 最小侵入:接入只需在现有流程加 1-2 行调用
- 可观测:所有事件写入持久存储,可查询审计
- 自愈优先:故障优先自动修复,失败才上报
- 不改用户配置:飞轮只记录事件,不修改现有流水线配置
故障牵引修复流程
故障发生
↓
fault_traction.py 提取错误特征
↓
匹配教训库中的活跃教训
↓
输出:top_fix + 置信度 + 历史使用次数
↓
自动修复 / 人工确认修复
↓
记录修复结果到 pipeline_flywheel
↓
若成功 → 更新教训 use_count
↓
若失败 → 标记为待人工
输入来源
| 来源 | 示例 |
|---|---|
| cron 报错 | python3 fault_traction.py "API 404 模型不存在" |
| 日志文件 | python3 fault_traction.py /var/log/agent/error.log |
| 脚本异常 | 在 except 块里自动调用 |
| 用户反馈 | "又出问题了" → 提取最近错误日志 |
输出格式
状态: matched / no_match
提取特征: [...]
匹配教训:
1. 触发词: ...
问题: ...
修复: ...
置信度: X | 使用次数: N
建议修复: ...
关键脚本
| 脚本 | 职责 |
|---|---|
fact_flywheel.py |
三环飞轮:内环正向反馈、中环 trust 校准、外环质量校准 |
fault_traction.py |
故障牵引修复,从错误文本匹配教训库 |
pipeline_flywheel.py |
流水线注册、运行记录、事件追踪、健康评估 |
sync_rules.py |
启动时自动驱动飞轮 |
健康度评估
五维健康分
| 维度 | 权重 | 说明 |
|---|---|---|
| 成功率 | 40% | success / total |
| 延迟 | 20% | <1s 满分,>5s 零分,线性插值 |
| Token 用量 | 10% | <1000 满分,>5000 零分,线性插值 |
| 错误分布 | 15% | 外部/内部错误占比越低越好 |
| Pattern 覆盖率 | 15% | 有 pattern 的失败数 / 总失败数 |
审计报告
输出 Markdown 格式,包含:综合健康分、五维得分表、运行统计、错误类型分布、自动建议。
建议触发条件:成功率<80%、延迟>3s、Token>3000、Pattern 覆盖率<70%。
Pattern 自动分类
vendor_error:401/403/404/rate limit/timeout/connection 等外部错误user_error:参数/输入/格式错误harness_defect:配置/投递层问题
Pattern 库卫生
patterns 表随时间堆积历史已解决问题。建议:
- 每周扫一次:
python3 pipeline_flywheel.py pattern list - 对已知重复类目,批量设为
deprecated - 保留置信度 >= 0.7 且
last_matched_at在 7 天内的 active pattern
常见陷阱
- 飞轮写入失败 ≠ 主任务失败:trace 记录失败时,只降级提示,不回滚主任务结果
- 健康分的"运行次数"口径:飞轮报告的运行次数是 trace 记录数,不是 cron 调度次数,两者不一定一致
- SQLite 写锁:高并发下 trace_store 可能被锁,建议 trace 表独立于主事实库,并保留 JSONL fallback
- 延迟统计异常:务必过滤
latency_ms=0和数量级异常值(如 >24h),否则均分会完全失真
与 self-fix-loop 的互补关系
self-fix-loop:聚焦单个脚本/任务的 8 阶段自愈闭环knowledge-flywheel:聚焦跨流水线知识沉淀 + 第二大脑飞轮 + 故障牵引
两者互补:
- 单个脚本级故障 →
self-fix-loop - 流水线级故障 + 知识沉淀 →
knowledge-flywheel
Current listing version
1.0.0
Safety and assessment details
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Areas to improve
-
缺少 When to Use 章节 Reported severity: Minor
文档中缺少明确的 When to Use 使用场景说明章节
Recommendation: 建议添加 When to Use 章节,明确说明在什么场景下使用此 Skill
Highlights
- 提供完整的知识飞轮框架,包含三环自运转机制
- 具备故障牵引修复能力,支持自动/人工修复
- 支持流水线自动注册和运行记录
Areas to improve
-
触发词可进一步细化 Reported severity: Minor
触发词较为通用,可进一步细化具体应用场景
Recommendation: 建议添加更具体的触发词,如 knowledge-management, fault-recovery 等
Highlights
- description 完整描述了核心功能和价值
- 触发词覆盖了主要功能点
- 边界清晰,不易与其他 Skill 混淆
Areas to improve
-
文档结构可进一步优化 Reported severity: Minor
文档结构良好,但部分章节可以进一步优化组织
Recommendation: 建议将常见陷阱和 Pattern 库卫生等内容整合到更合理的章节中
Highlights
- 结构完整,包含核心模式、设计原则、关键脚本等
- Phase/步骤清晰,有具体实现示例
- frontmatter 完整,文档长度适中
Areas to improve
-
部分异常处理未覆盖 Reported severity: Minor
虽然覆盖了主要异常,但部分边缘场景的异常处理可以进一步完善
Recommendation: 建议补充更多边缘场景的异常处理方案
Highlights
- 工具来源明确,提供了具体的 Python 脚本
- 参数正确,调用示例完整
- 覆盖主要异常,有健康度评估机制
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
These common operations were not identified in the main document. This does not mean no permissions or risks exist.
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.