← Back to Skills Marketplace
meta-evo-creator

IMA知识库上传

by Meta-Evo · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
35
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ima-knowledge-upload
Description
上传Markdown文件到IMA知识库的标准流程。 方法A(推荐):笔记import_doc → add_knowledge(支持markdown,最简单) 方法B:create_media → COS上传 → add_knowledge(支持任意文件) ⚠️ title必须等于file_name。
README (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=
Usage Guidance
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.
Capability Analysis
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.
Capability Tags
requires-sensitive-credentials
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ima-knowledge-upload
  3. After installation, invoke the skill by name or use /ima-knowledge-upload
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
方法A(import_doc)+方法B(文件上传)+frontmatter规范+KB_ID全
Metadata
Slug ima-knowledge-upload
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is IMA知识库上传?

上传Markdown文件到IMA知识库的标准流程。 方法A(推荐):笔记import_doc → add_knowledge(支持markdown,最简单) 方法B:create_media → COS上传 → add_knowledge(支持任意文件) ⚠️ title必须等于file_name。 It is an AI Agent Skill for Claude Code / OpenClaw, with 35 downloads so far.

How do I install IMA知识库上传?

Run "/install ima-knowledge-upload" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is IMA知识库上传 free?

Yes, IMA知识库上传 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does IMA知识库上传 support?

IMA知识库上传 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created IMA知识库上传?

It is built and maintained by Meta-Evo (@meta-evo-creator); the current version is v1.0.0.

💬 Comments