← 返回 Skills 市场
meta-evo-creator

IMA知识库上传

作者 Meta-Evo · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
35
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ima-knowledge-upload
功能描述
上传Markdown文件到IMA知识库的标准流程。 方法A(推荐):笔记import_doc → add_knowledge(支持markdown,最简单) 方法B:create_media → COS上传 → add_knowledge(支持任意文件) ⚠️ title必须等于file_name。
使用说明 (SKILL.md)

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=
安全使用建议
This skill appears purpose-aligned for uploading documents to IMA. Before installing or using it, make sure you trust the referenced ima-skill helper code, store the IMA and COS credentials securely, and confirm the file and KB_ID every time to avoid uploading sensitive content to the wrong knowledge base.
功能分析
Type: OpenClaw Skill Name: ima-knowledge-upload Version: 1.0.0 The skill contains hardcoded absolute file paths (C:\Users\shibi\...) in SKILL.md, which is a significant security and portability flaw that reveals local system information. While the logic aligns with the stated purpose of uploading documents to the IMA knowledge base, the inclusion of specific internal Knowledge Base IDs and references to external scripts (cos-upload.cjs) not included in the bundle suggests a poorly packaged or environment-specific tool that could lead to unexpected behavior if executed in a different context.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
The stated purpose is uploading Markdown or other files to an IMA knowledge base, and the documented API steps align with that purpose. The workflow does create remote notes/media and knowledge-base entries, so users should treat it as an account-mutating upload workflow.
Instruction Scope
The instructions include fixed example knowledge-base IDs and warn not to use the wrong KB_ID. This is useful but means the user or agent should explicitly confirm the intended destination before uploading.
Install Mechanism
There is no install spec or code in this skill, but the examples depend on an external ima-skill helper and scripts from a hard-coded local Windows path that are not part of the reviewed artifact.
Credentials
IMA API credentials, and optionally COS upload credentials, are expected for this integration. The artifacts do not show credential logging, hardcoding of secrets, or unrelated transmission.
Persistence & Privilege
The skill does not show background persistence or self-start behavior, but successful use creates persistent content in the external IMA knowledge base.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ima-knowledge-upload
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ima-knowledge-upload 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
方法A(import_doc)+方法B(文件上传)+frontmatter规范+KB_ID全
元数据
Slug ima-knowledge-upload
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

IMA知识库上传 是什么?

上传Markdown文件到IMA知识库的标准流程。 方法A(推荐):笔记import_doc → add_knowledge(支持markdown,最简单) 方法B:create_media → COS上传 → add_knowledge(支持任意文件) ⚠️ title必须等于file_name。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 35 次。

如何安装 IMA知识库上传?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ima-knowledge-upload」即可一键安装,无需额外配置。

IMA知识库上传 是免费的吗?

是的,IMA知识库上传 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

IMA知识库上传 支持哪些平台?

IMA知识库上传 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 IMA知识库上传?

由 Meta-Evo(@meta-evo-creator)开发并维护,当前版本 v1.0.0。

💬 留言讨论