ima-knowledge-upload

上传Markdown文件到IMA知识库的标准流程。 方法A(推荐):笔记import_doc → add_knowledge(支持markdown,最简单) 方法B:create_media → COS上传 → add_knowledge(支持任意文件) ⚠️ title必须等于file_name。

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "ima-knowledge-upload" with this command: npx skills add meta-evo-creator/ima-knowledge-upload

IMA知识库上传

上传Markdown报告到IMA知识库的标准方法。

方法A:笔记路径(推荐,用于Markdown文件)

const api = require('C:\\Users\\shibi\\.openclaw\\skills\\ima-skill\\ima_api.cjs');

// Step 1: 创建笔记
const ir = JSON.parse(await api.imaApi('openapi/note/v1/import_doc', {
  title: '报告标题_2026-05-11',
  content: markdownContent,
  content_format: 1  // 1=MARKDOWN
}));
if (ir.code !== 0) throw new Error('import_doc failed: ' + ir.msg);
const noteId = ir.data.note_id;

// Step 2: 添加到知识库
const ar = JSON.parse(await api.imaApi('openapi/wiki/v1/add_knowledge', {
  knowledge_base_id: 'fh6uPoAPAxgoaknrmlrV18u3yl1tmtzDEfaeRX-EVtE=',
  media_type: 11,  // 11=笔记
  note_info: { content_id: noteId }
}));
if (ar.code !== 0) throw new Error('add_knowledge failed: ' + ar.msg);

方法B:文件路径(用于PDF/Word等非文本文件)

const api = require('C:\\Users\\shibi\\.openclaw\\skills\\ima-skill\\ima_api.cjs');

// Step 1: preflight检查
// node skills/ima-skill/knowledge-base/scripts/preflight-check.cjs --file "path/to/file.pdf"

// Step 2: create_media
const cr = JSON.parse(await api.imaApi('openapi/wiki/v1/create_media', {
  knowledge_base_id: kbId,
  file_name: '报告.pdf',
  file_size: fs.statSync(filePath).size,
  media_type: 1  // 1=PDF 5=Excel 7=Markdown
}));

// Step 3: COS上传
// node skills/ima-skill/knowledge-base/scripts/cos-upload.cjs --file "file" --secret-id "..." --secret-key "..." --token "..." --bucket "..." --region "..." --cos-key "..." --content-type "application/pdf"

// Step 4: add_knowledge
const ar = JSON.parse(await api.imaApi('openapi/wiki/v1/add_knowledge', {
  media_type: 1,
  media_id: cr.data.media_id,
  title: '报告.pdf',
  knowledge_base_id: kbId
}));

关键规则

  • title必须等于file_name(含扩展名)— 违反后文件显示为原名而非描述性标题
  • COS上传失败立即停止 — 不要继续add_knowledge
  • 不要用错KB_ID — 每个知识库ID不同

常用KB_ID

知识库KB_ID
巴巴塔知识框架3CQtyf9Ix1b_qSqNpcqJb0NOrb1KHvgXQuwV5HtObJk=
医院智慧监督oXAIXrjt1QHiMF2p9HcuvFVsGz4-HcWSvNn9x-Vd9GM=
AI原生医院研究探索fh6uPoAPAxgoaknrmlrV18u3yl1tmtzDEfaeRX-EVtE=
中山一院纪检监察GwoQS60RM0dtD0z-k1wZnPPIXcHv_T0bYeGC_KyS36k=

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Research

抖音搜索关键词

抖音公开数据智能分析工具。支持关键词搜索排序、抖人作品抓取、实时热榜获取,适用于短视频营销、竞品分析和热点监控,助力爆款内容策划与流量追踪。

Registry SourceRecently Updated
7884um-why
Research

hello-skills

helloskills provides quantitative strategy analysis and signal generation based on input parameters, returning execution status and data.

Registry SourceRecently Updated
Research

Workspace Fs Daying

Learning knowledge skill v3.1.0 — memoryFlush-driven experience recording, bootstrap injection, draft buffering for multi-round debugging, triple-layer stora...

Registry SourceRecently Updated
1270Profile unavailable
Research

exam-question-generator

读取 knowledge_map.json,按三套差异化规则生成模拟题(基础巩固/综合能力/冲刺模拟), AI 生成题目内容写入 questions.json,运行脚本渲染三 Tab 独立 HTML, 生成后引导用户选择下一步。

Registry SourceRecently Updated
00Profile unavailable