SuperAPI AI Directory

wecomcli-workflow-knowledge-base

Office & productivity

View repository

Updated 10-15 23:59

About this skill

WeCom Personal Knowledge Base

Operate WeCom documents and smart sheets through wecom-cli to build a personal knowledge management system. Use smart sheets as the index and documents for content storage.

Note: WeCom has no Feishu "knowledge base" module. This Skill usessmart sheet index + cloud documentsas a replacement.

Initial Configuration (Automatic Initialization)

Before performing any operation, first check whether the knowledge base configuration already exists in memory. If not, automatically create it according to the following process:

Step 1: Create Smart Sheet (Index Sheet)

wecom-cli doc create_doc '{"doc_type": 10, "doc_name": "个人知识库索引"}'

Get from the returned result docid。

Step 2: Create Sub-sheets and Fields

wecom-cli doc smartsheet_add_sheet '{"docid": "<DOCID>", "sheet_name": "知识索引"}'
wecom-cli doc smartsheet_add_fields '{"docid": "<DOCID>", "sheet_id": "<SHEET_ID>", "fields": [
  {"field_title": "标题", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "URL", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "内容类型", "field_type": "FIELD_TYPE_SINGLE_SELECT"},
  {"field_title": "来源平台", "field_type": "FIELD_TYPE_SINGLE_SELECT"},
  {"field_title": "标签", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "摘要", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "关键观点", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "文档链接", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "保存时间", "field_type": "FIELD_TYPE_TEXT"},
  {"field_title": "关联条目", "field_type": "FIELD_TYPE_TEXT"}
]}'

Step 3: Save Configuration to Memory

Save the following information to the memory file knowledge-base-config.md:

---
name: knowledge-base-config
description: 个人知识库智能表格配置信息
type: project
---

## 知识库配置

- 索引表 docid: <DOCID>
- 索引表 url: <创建时返回的URL>
- 索引表 sheet_id: <SHEET_ID>
- 表格名称: 个人知识库索引

Operation Process

In the following commands <DOCID> and <SHEET_ID> are read from knowledge-base-config in memory.

Mode 1: Save Link Content

When the user sends a link, AI automatically scrapes it, generates a summary, and saves it to the document and index sheet.

Step 1: User Sends Link

User: "Help me save this article https://example.com/ai-trends-2026"

Step 2: AI Scrapes Content and Generates Summary

Use the WebSearch/WebFetch tool to scrape webpage content. AI automatically:

  • Extract title
  • Generate a summary within 200 characters
  • Automatically generate tags (3-8)
  • Extract key viewpoints
  • Determine content type and source platform

Step 3: Check for Duplicates

wecom-cli doc smartsheet_get_records '{"docid": "<DOCID>", "sheet_id": "<SHEET_ID>"}'
# AI 比对 URL 或标题是否已存在

Step 4: Check Related Content

AI analyzes the relevance between the new content and existing entries (tag overlap, topic similarity) to find related entries.

Step 5: Create Document to Save Full Content

wecom-cli doc create_doc '{"doc_type": 3, "doc_name": "AI行业十大趋势 2026"}'

Get the returned docid(document docid), then write the content:

wecom-cli doc edit_doc_content '{"docid": "<文档DOCID>", "content": "# AI行业十大趋势 2026\n\n> 来源:https://example.com/ai-trends-2026\n> 保存时间:2026-04-02\n> 标签:AI、趋势、2026、行业分析、大模型\n\n---\n\n## 原文内容\n\n<完整文章内容>\n\n---\n\n## AI 摘要\n\n<200字摘要>\n\n## 关键观点\n\n1. ...\n2. ...\n3. ...", "content_type": 1}'

Step 6: Write to Index Sheet

wecom-cli doc smartsheet_add_records '{"docid": "<DOCID>", "sheet_id": "<SHEET_ID>", "records": [{"values": {
  "标题": [{"type": "text", "text": "AI行业十大趋势 2026"}],
  "URL": [{"type": "text", "text": "https://example.com/ai-trends-2026"}],
  "内容类型": [{"text": "文章"}],
  "来源平台": [{"text": "网站"}],
  "标签": [{"type": "text", "text": "AI, 趋势, 2026, 行业分析, 大模型"}],
  "摘要": [{"type": "text", "text": "本文分析了2026年AI行业的十大发展趋势,包括大模型成本下降、多模态应用爆发等..."}],
  "关键观点": [{"type": "text", "text": "1. 大模型成本持续下降 2. 多模态成为标配 3. AI Agent大规模落地"}],
  "文档链接": [{"type": "text", "text": "https://doc.weixin.qq.com/docx/<DOCID>"}],
  "保存时间": [{"type": "text", "text": "2026-04-02"}],
  "关联条目": [{"type": "text", "text": "大模型成本下降分析"}]
}}]}'

Mode 2: Batch Save

The user sends multiple links at once.

Interaction Process:

  1. User: "Save all these links\nhttps://a.com/article1\nhttps://b.com/video2\nhttps://c.com/thread3"
  2. AI scrapes them one by one and generates summaries
  3. Check for duplicates
  4. Batch create documents and indexes

Mode 3: Search Knowledge Base

Search saved content using natural language.

Interaction Examples:

User asks AI processing
"What articles are there about AI chips?" Search for tags containing "AI" + "chip", or summaries containing "chip"
"Who wrote about OpenAI valuation analysis?" Search for titles and summaries containing "OpenAI" + "valuation"
"I saved a video about Nvidia before" Search for tags containing "Nvidia" and type = "video"
# 获取所有索引记录
wecom-cli doc smartsheet_get_records '{"docid": "<DOCID>", "sheet_id": "<SHEET_ID>"}'

# AI 在内存中按关键词、标签、类型进行过滤和匹配
# 返回匹配结果列表,包含标题、标签、摘要、文档链接

Mode 4: Association Discovery

Automatically discover associations when saving new content.

AI Processing Logic:

  1. Extract the tag set of the new content
  2. Iterate through existing index records and calculate tag overlap
  3. Mark entries with overlap > 30% as related entries
  4. Notify the user when saving: "Found 1 related item: you saved 'Analysis of Large Model Cost Decline' three weeks ago, which discussed the AI industry from another angle."

Supported content formats

Format Processing method
Article webpage WebFetch retrieves the full text → generate summary
YouTube video WebSearch searches for video information → extract title/description
Twitter/X post WebFetch retrieves (including the full thread)
PDF Download via URL → AI extracts content
Podcast WebSearch searches for episode information → extract summary

Field type write format (general rules)

For the complete field type format description, see crm-schema

Field type Write format Example
TEXT [{"type":"text","text":"值"}] Title, URL, tags, summary, etc.
SINGLE_SELECT [{"text":"选项文本"}] Content type, source platform, etc.

Practical notes

Common pitfalls

  1. Not passing key_type when updating — must include "key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE"
  2. When an API call fails — check the error code: 301085 means the docid is invalid (use url instead); 2022004 means the field was not found (call add_fields first); 2022003 means the record does not exist (call add_records first). When encountering an error, first use smartsheet_get_sheet '{"url": "<URL>"}' to verify the table structure.
  3. SINGLE_SELECT option mismatch — the content type and source platform must exactly match existing options
  4. SINGLE_SELECT options do not take effect at creation time — smartsheet_add_fields The property.options passed in will not pre-create options; options are automatically created via [{"text": "选项"}] when a record is first written. When creating a field, the property parameter can be omitted.
  5. Document content writing — edit_doc_content 's content is in Markdown format,content_type: 1 indicates Markdown
  6. URL duplicate check — dual deduplication via exact full URL matching + fuzzy title matching
  7. WebFetch failure — if retrieval fails, inform the user and suggest providing the content manually

Knowledge base vs wecomcli-crm

Dimension Knowledge base CRM
Storage object Articles/videos/materials Customer information
Storage method Document (full text) + index table Smart sheet
Search method Tags + keywords + summary Exact field matching
Automation Automatic retrieval + summary Mainly manual entry

Data linkage

  • This Skill's data will be read by the following Skills:
    • wecomcli-workflow-business-advisor — competitive/industry consultant analyzes industry trends
    • wecomcli-workflow-content-pipeline — checks for duplicate topics