AI Agent Hub
Back to skills
Unified IMA OpenAPI icon

Unified IMA OpenAPI

Knowledge Management Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please install @user_5958866b/test00qwb according to https://skillhub.cn/install/skillhub.md.

About this skill

Problem to solve

When an agent uses the IMA OpenAPI for text and files, “notes” and “knowledge-base” are easy to conflate. A request like “save this into the knowledge base” may actually need append_doc; “add this note to the knowledge base” may require fetching note_id first. Encoding is another hidden failure: PowerShell 5.1 can silently convert the request body to GBK, and notes writes can create irreversible garbled text if content or title is not valid UTF-8.

How the skill works

  • Module routing: route to notes or knowledge-base by intent; for cross-module actions such as “view original content” or “add a note to a knowledge base”, read both submodules before executing.
  • Credential and API flow: prefer ~/.config/ima/client_id and api_key, then send JSON POST requests to https://ima.qq.com through ima_api.cjs.
  • Error handling: check both script-level stderr codes -100/-200 and backend stdout responses where code != 0.
  • Write safety: validate UTF-8 before notes text writes; keep uploaded files original, with unchanged filenames and binary contents.

Boundaries

Useful for note search, creation, appending, knowledge-base file upload, link addition, and media info retrieval. It should not process video, Bilibili/YouTube URLs, or file:// resources directly; in those cases, point users to the IMA desktop client. If intent is unclear, such as “save this”, confirm whether to create a new note or append to an existing one.

Use Cases

  • Handle a request to save a web digest as a note: route to notes and call import_doc with title and body.
  • Upload a local PDF to a knowledge base: use knowledge-base create_media and add_knowledge without renaming.
  • Inspect original content of a knowledge-base entry: call get_media_info, then branch to notes if it is a note.
  • Run IMA API requests from PowerShell 5.1: detect the version and send the body as a UTF-8 byte array.

Best For

  • Knowledge managers who consolidate scattered notes and knowledge-base entries into searchable content.
  • Backend engineers who wrap the IMA OpenAPI into automated workflows.
  • LLM application developers who route notes and knowledge-base tasks inside agent workflows.
  • Client integration engineers who debug Chinese encoding and PowerShell request-body anomalies.