Skip to content

Align ima knowledge mount with official Agent Interface - #41

Merged
XYAIStudio merged 3 commits into
mainfrom
cursor/ima-knowledge-mount-89db
Sep 17, 2026
Merged

XYAIStudio merged 3 commits into
mainfrom
cursor/ima-knowledge-mount-89db

Conversation

@XYAIStudio

@XYAIStudio XYAIStudio commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

ima 知识库挂接改为官方 Agent Interface。落地页 https://ima.qq.com/agent-interface 是 JS 应用(标题「ima claw配置」),静态抓取只有这几个字;真实约定在页面 JS 和它下发的 skill。

已 rebase 到最新 main(含 #39、#40)。冲突仅在 CHANGELOG.md:保留 ima 1.1.10 条目与 #40 模型选择器修复。

对照官方(从落地页 JS 挖到)

页面 bundle:https://static.ima.qq.com/ima/assets/agent-interface/assets/index-D_925oRl.js

落地页 / skill FreeOS
第 1 步复制 skill 提示词;第 2 步获取 Client ID + API Key(密钥只展示一次,可删后重取;有有效期/续期) 知识库页打开该 URL,粘贴后 POST /knowledge-bases/ima/connect,凭证加密进 tencent-ima connector
当前 skill 包:https://app-dl.ima.qq.com/skills/ima-skills-1.1.10.zip;开发者文档:https://skillhub.tencent.com/skills/ima-skills Wiki OpenAPI POST https://ima.qq.com/openapi/wiki/v1/*
Header ima-openapi-clientid / ima-openapi-apikey / ima-openapi-ctx: skill_version=1.1.10 tencent_ima._headers
信封 {code, msg, data}(skill 正文)或 {retcode, errmsg, data}(api.md) unwrap_openapi_data
列库:search_knowledge_base(limit 1–20,空 query 列全部)再 get_knowledge_base 补描述 GET /knowledge-bases/ima/bases
浏览文档:get_knowledge_list;搜文档:search_knowledge GET /knowledge-bases/ima/bases/{id}/documents(query 走搜索)
文件夹 ID 以返回的 media_id 为准,不要自造 folder_ 前缀(1.1.10) 解析为可进入的文件夹,不再当成文档勾选
游标分页 cursor / next_cursor / is_end 知识库与文档均可「加载更多」

挂接后选择写入 selected_bases / selected_docs。只勾知识库、不勾文档 = 接入整库。检索走官方 search_knowledge,并按所选 media_id 过滤。

验证

uv run pytest tests/unit/knowledge/test_knowledge_ima.py tests/unit/connectors/test_tencent_ima.py tests/unit/api/test_knowledge_bases.py tests/unit/i18n -q
cd dashboard && npx vitest run src/pages/KnowledgeBases/CloudMountPanel.test.tsx src/api/modules/knowledgeBases.test.ts

有 Client ID / API Key 时:知识库页 → agent-interface → 连接 → 勾选知识库 → 进入文件夹或搜索文档 → 保存选择。

未对 ima.qq.com 做真机调用(无官方密钥)。

Open in Web Open in Cursor 

@XYAIStudio
XYAIStudio marked this pull request as ready for review September 17, 2026 06:16
cursoragent and others added 3 commits September 17, 2026 06:44
Replace the URL-only cloud pointer with Client ID / API Key auth from
ima.qq.com/agent-interface, then let users pick knowledge bases and
documents. Persist the selection and use it in chat retrieval and distill.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
Parse folder_ media_id entries as folders, hydrate bases via
get_knowledge_base, and let users search/page documents with
search_knowledge so the mount can select both knowledge bases
and documents after the official Client ID / API Key connect.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
The JS-rendered ima.qq.com/agent-interface page now ships
ima-skills-1.1.10: send skill_version=1.1.10 and treat folder
ids as the returned media_id instead of inventing a folder_ prefix.

Co-authored-by: XYAI Labs <haoboy8@gmail.com>
@cursor
cursor Bot force-pushed the cursor/ima-knowledge-mount-89db branch from 7f358d4 to d15eb99 Compare September 17, 2026 06:45
@XYAIStudio
XYAIStudio merged commit 19cb098 into main Sep 17, 2026
5 checks passed
@XYAIStudio
XYAIStudio deleted the cursor/ima-knowledge-mount-89db branch September 17, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants