OA0 = Omni AI 0
OA0 是一个探索 AI 的论坛
现在注册
已注册用户请  登录
OA0  ›  技能包  ›  clawd-docs-v2:具备本地搜索索引的 ClawdBot 智能文档访问工具

clawd-docs-v2:具备本地搜索索引的 ClawdBot 智能文档访问工具

 
  pipeline ·  2026-02-22 15:40:59 · 3 次点击  · 0 条评论  

名称: clawd-docs-v2
描述: 智能访问 ClawdBot 文档,具备本地搜索索引、缓存片段和按需获取功能。兼顾令牌效率与内容新鲜度。
主页: https://docs.clawd.bot/
元数据: {"clawdbot":{"emoji":"📚"}}
版本: 2.2.0


Clawd-Docs v2.0 - 智能文档访问

本技能提供对 ClawdBot 文档的智能访问,具备以下特性:
- 本地搜索索引 - 即时关键词查找(0令牌消耗)
- 缓存片段 - 预获取的常见问题答案(约300-500令牌)
- 按需获取 - 需要时获取完整页面(约8-12k令牌)
- 新鲜度跟踪 - 按页面类型设置TTL(生存时间)


快速开始

步骤 1:优先检查黄金片段

在获取任何内容之前,先检查是否存在黄金片段

ls ~/clawd/data/docs-snippets/

可用片段(优先检查缓存!):
| 片段 | 匹配查询 |
|---------|---------------|
| telegram-setup.md | "ako nastaviť telegram", "telegram setup" |
| telegram-allowfrom.md | "allowFrom", "kto mi môže písať", "access control" |
| oauth-troubleshoot.md | "token expired", "oauth error", "credentials" |
| update-procedure.md | "ako updatnuť", "update clawdbot" |
| restart-gateway.md | "restart", "reštart", "stop/start" |
| config-basics.md | "config", "nastavenie", "konfigurácia" |
| config-providers.md | "pridať provider", "discord setup", "nový kanál" |
| memory-search.md | "memory", "vector search", "pamäť", "embeddings" |

读取片段:

cat ~/clawd/data/docs-snippets/telegram-setup.md

步骤 2:搜索索引(如果片段不存在)

检查 ~/clawd/data/docs-index.json 获取页面建议。

关键词匹配示例:
- "telegram" → channels/telegram
- "oauth" → concepts/oauth, gateway/troubleshooting
- "update" → install/updating
- "config" → gateway/configuration

步骤 3:检查完整页面缓存

在通过 brightdata 获取之前,检查页面是否已缓存:

# 路径转换:concepts/memory → concepts_memory.md
ls ~/clawd/data/docs-cache/ | grep "concepts_memory"

如果存在,本地读取(0令牌!):

cat ~/clawd/data/docs-cache/concepts_memory.md

步骤 4:获取页面(仅当不在缓存中时)

使用原生的 web_fetch 工具(Clawdbot 核心功能 - 免费且快速!):

web_fetch({ url: "https://docs.clawd.bot/{path}", extractMode: "markdown" })

示例:

web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })

web_fetch 优势对比:
| | web_fetch | brightdata |
|---|-----------|------------|
| 成本 | $0(免费!) | ~$0.003/次 |
| 速度 | ~400毫秒 | 2-5秒 |
| 质量 | Markdown ✅ | Markdown ✅ |


搜索索引结构

位置: ~/clawd/data/docs-index.json

{
  "pages": [
    {
      "path": "channels/telegram",
      "ttl_days": 7,
      "keywords": ["telegram", "tg", "bot", "allowfrom"]
    }
  ],
  "synonyms": {
    "telegram": ["tg", "telegrambot"],
    "configuration": ["config", "nastavenie", "settings"]
  }
}

使用同义词进行模糊匹配。


TTL 策略(新鲜度)

页面类别 TTL 原因
install/updating 1 天 始终保持最新!
gateway/* 7 天 配置变更
channels/* 7 天 提供商更新
tools/* 7 天 功能新增
concepts/* 14 天 很少变更
reference/* 30 天 稳定模板

检查片段过期时间:

head -10 ~/clawd/data/docs-snippets/telegram-setup.md | grep expires

常见场景

"Ako nastaviť Telegram?"

  1. ✅ 读取 ~/clawd/data/docs-snippets/telegram-setup.md

"allowFrom nefunguje"

  1. ✅ 读取 ~/clawd/data/docs-snippets/telegram-allowfrom.md

"Token expired / oauth error"

  1. ✅ 读取 ~/clawd/data/docs-snippets/oauth-troubleshoot.md

"Ako updatnúť ClawdBot?"

  1. ✅ 读取 ~/clawd/data/docs-snippets/update-procedure.md

"Ako pridať nový skill?"(无片段)

  1. 搜索索引 → tools/skills
  2. 获取:web_fetch({ url: "https://docs.clawd.bot/tools/skills", extractMode: "markdown" })

"Multi-agent routing"

  1. 搜索索引 → concepts/multi-agent
  2. 获取:web_fetch({ url: "https://docs.clawd.bot/concepts/multi-agent", extractMode: "markdown" })

备用方案:完整索引刷新

如果找不到所需内容:

web_fetch({ url: "https://docs.clawd.bot/llms.txt", extractMode: "markdown" })

返回完整列表,包含所有文档页面。


令牌效率指南

方法 令牌消耗 使用时机
黄金片段 ~300-500 ✅ 始终优先使用!
搜索索引 0 关键词查找
完整页面获取 ~8-12k 最后手段
批量获取 ~20-30k 多个相关主题

80-90% 的查询都应通过片段回答!


数据位置

~/clawd/data/
├── docs-index.json       # 搜索索引
├── docs-stats.json       # 使用情况跟踪
├── docs-snippets/        # 缓存的黄金片段
│   ├── telegram-setup.md
│   ├── telegram-allowfrom.md
│   ├── oauth-troubleshoot.md
│   ├── update-procedure.md
│   ├── restart-gateway.md
│   └── config-basics.md
└── docs-cache/           # 完整页面缓存(未来功能)

版本信息

项目
技能版本 2.1.0
创建时间 2026-01-14
更新时间 2026-01-26
作者 Claude Code + Clawd(协作)
源地址 https://docs.clawd.bot/
依赖项 web_fetch(Clawdbot 核心工具)
索引页面 ~50 个核心页面
黄金片段 7 个预缓存

更新日志

v2.2.0 (2026-01-26)

  • 迁移至 web_fetch - 用原生 Clawdbot 工具替换了 brightdata MCP
  • 优势:免费($0)、更快(~400毫秒 vs 2-5秒)
  • 无外部依赖(不再需要 mcporter)
  • 协作成果:Claude Code 🦞 实现,Clawd 🐾 审核

v2.1.3 (2026-01-25) - ClawdHub

  • 文档修复:检查与刷新的说明澄清

v2.0.0 (2026-01-14)

  • 三层架构:搜索索引 → 片段 → 按需获取
  • 预缓存黄金片段用于常见查询
  • 基于TTL的新鲜度跟踪
  • 支持同义词进行模糊匹配
  • 常见查询令牌消耗减少80-90%

v1.0.0 (2026-01-08)

  • 初始版本,仅支持 brightdata 获取

本技能提供智能文档访问 - 始终优先使用缓存片段,仅在必要时进行获取。

3 次点击  ∙  0 人收藏  
登录后收藏  
目前尚无回复
0 条回复
About   ·   Help   ·    
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
Developed with Cursor