aihaoji
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAi好记
Ai好记
通过 Ai好记 Agent Open Platform 查询、读取、导出和整理用户笔记。实际接口、字段和场景细节见 ;处理写入、记录读取、导出、自动归类或接口参数不确定时必须读取该参考。
references/agent-open-platform.mdUse the Ai好记 Agent Open Platform to query, read, export, and organize user notes. For actual endpoints, fields, and use-case details, see ; this reference must be read when handling writes, record retrieval, exports, automatic classification, or when API parameters are uncertain.
references/agent-open-platform.md触发边界
Trigger Boundaries
按以下优先级路由:
- 用户明确指定操作对象位于本地文件、代码仓库、Obsidian、Notion、有道云笔记或其他服务时,服从指定载体,不触发本 Skill。
- 未指定载体,且请求对象是个人笔记、个人笔记本或本 Skill 支持的笔记详情时,默认触发 Ai好记;这里指用户的外部个人笔记库,不是 Agent 或 Claude memory,无需出现“Ai好记”“AI好记”或 。
aihaoji - 只出现 、
notes、记录、文件或内容等宽泛词,不足以触发;源码、测试、接口字段和本地文件上下文均不属于个人笔记意图。folder
正向范围包括查询、搜索、导出、创建空白笔记、整理、移动和自动归类笔记,管理笔记本,以及查看总结、大纲、全文、原文、润色稿、划线、高亮、批注、我的记录和 AI 高亮。导出个人笔记为 Markdown 仍属于本 Skill;创建笔记公开使用 Markdown;创建、读取或修改一个本地 Markdown 文件则不属于本 Skill。
路由到本 Skill 不等于授权写入:创建、重命名、移动、删除和自动归类前,必须先只读查询真实 ID、展示变更计划并等待明确确认;确认前不得调用写接口,删除笔记本仍须单独确认。
Route requests according to the following priority:
- When the user explicitly specifies that the target is in local files, a code repository, Obsidian, Notion, Youdao Note, or another service, follow the specified carrier and do not trigger this Skill.
- When no carrier is specified and the request concerns personal notes, personal notebooks, or note details supported by this Skill, trigger Ai好记 by default. This refers to the user’s external personal note library, not Agent or Claude memory, and the user does not need to mention “Ai好记,” “AI好记,” or .
aihaoji - Broad terms such as ,
notes, records, files, or content are not sufficient on their own. Source code, tests, API fields, and local-file contexts do not indicate a personal-note intent.folder
The positive scope includes querying, searching, exporting, creating blank notes, organizing, moving, and automatically classifying notes; managing notebooks; and viewing summaries, outlines, full text, original text, polished versions, highlights, annotations, My Records, and AI Highlights. Exporting personal notes to Markdown still falls within this Skill; creating notes uses Markdown directly; creating, reading, or modifying a local Markdown file does not fall within this Skill.
Routing to this Skill does not authorize writes. Before creating, renaming, moving, deleting, or automatically classifying anything, first perform read-only queries to obtain the real IDs, present a change plan, and wait for explicit confirmation. Do not call write endpoints before confirmation. Deleting a notebook still requires separate confirmation.
配置
Configuration
优先从 读取:
~/.aihaoji/config.jsonjson
{
"apiKey": "sk-sxxxxxxxx",
"baseUrl": "https://openapi.aihaoji.com"
}缺失时再读 和 。请求头固定为:
$AIHAOJI_API_KEY$AIHAOJI_BASE_URLtext
Authorization: $AIHAOJI_API_KEY没有 API Key 时,引导用户去 创建 开发者密钥。用户可以直接在聊天中提供 Key,由当前 Agent 校验并写入共享配置;本机已安装 CLI 时,也可运行 。拿到 key 后先调 校验,再写入权限为 的 。自动配置失败时再提示用户使用可用的配置入口。
https://openapi.aihaoji.comsk-s...aihaoji-skillsaihaoji-skills setupGET /agent-open/api/v1/auth/verify0600~/.aihaoji/config.jsonPrefer reading from :
~/.aihaoji/config.jsonjson
{
"apiKey": "sk-sxxxxxxxx",
"baseUrl": "https://openapi.aihaoji.com"
}If it is missing, then read and . The request header is always:
$AIHAOJI_API_KEY$AIHAOJI_BASE_URLtext
Authorization: $AIHAOJI_API_KEYWhen no API Key is available, guide the user to to create an developer key. The user may provide the Key directly in chat, in which case the current Agent validates it and writes it to the shared configuration. If the CLI is installed locally, the user may also run . After obtaining the Key, first validate it by calling , then write it to with permissions. If automatic configuration fails, prompt the user to use an available configuration entry point.
https://openapi.aihaoji.comsk-s...aihaoji-skillsaihaoji-skills setupGET /agent-open/api/v1/auth/verify~/.aihaoji/config.json0600宿主安装位置
Host Installation Locations
跨平台安装时,以 作为全局主副本,不为每个宿主复制独立内容:
~/.agents/skills/aihaoji| 宿主 | 读取位置 | 说明 |
|---|---|---|
| Codex | | 最新官方用户级 Skill 目录 |
| OpenClaw | | personal-agent 来源,优先级高于 |
| Claude Code | | 链接到 |
| Hermes Agent | | 在 |
Hermes Agent 配置:
yaml
skills:
external_dirs:
- ~/.agents/skills~/.aihaoji/config.json0600For cross-platform installation, use as the global master copy and do not duplicate separate content for every host:
~/.agents/skills/aihaoji| Host | Read Location | Description |
|---|---|---|
| Codex | | Latest official user-level Skill directory |
| OpenClaw | | personal-agent source; takes priority over |
| Claude Code | | Symlink to |
| Hermes Agent | | Enabled through |
Hermes Agent configuration:
yaml
skills:
external_dirs:
- ~/.agents/skills~/.aihaoji/config.json0600安装与配置入口
Installation and Configuration Entry Points
- 跨平台安装 Skill:运行 。它把 Skill 安装到用户级目录;Codex 和 OpenClaw 读取
npx skills add AiHaoJi-Agent/aihaoji-skills -g,Claude Code 使用~/.agents/skills/aihaoji,Hermes Agent 通过~/.claude/skills/aihaoji读取共享目录。external_dirs - 配置 Key:优先由当前 Agent 校验 Key 并写入共享配置;本机已安装 CLI 时,可运行
aihaoji-skills。aihaoji-skills setup
Hermes Agent 对本仓库使用 。不要同时保留多个同名副本,以免宿主加载到旧版本。
skills.external_dirs- Cross-platform Skill installation: run . This installs the Skill into the user-level directory. Codex and OpenClaw read
npx skills add AiHaoJi-Agent/aihaoji-skills -g, Claude Code uses~/.agents/skills/aihaoji, and Hermes Agent reads the shared directory through~/.claude/skills/aihaoji.external_dirs - Key configuration: preferably, the current Agent validates the Key and writes it to the shared configuration. If the CLI is installed locally, the user may run
aihaoji-skills.aihaoji-skills setup
Hermes Agent uses for this repository. Do not keep multiple copies with the same name, as this may cause a host to load an outdated version.
skills.external_dirs强制规则
Mandatory Rules
- 用户要查、看、找、整理 Ai好记 笔记时,必须调用开放平台接口;不要扫描本地目录、日志、缓存或源码来猜笔记内容。
- 所有内部 ID 必须来自接口返回,不能手写:、
folder_id、target_folder_id、note_id都必须先查询确认。move_item_list[].item_id - 普通展示默认隐藏 、
note_id、folder_id和user_id;只有用户要求调试或原始字段时再展示。key_id - 接口报错、超时、时,明确说明当前无法通过 Ai好记开放平台获取数据,不要退回本地搜索。
401/403/429/5xx - 写入前必须展示变更计划并等待用户确认;删除笔记本必须单独确认,不能包含在自动整理默认计划里。
- When the user wants to query, view, find, or organize Ai好记 notes, the Open Platform endpoints must be called. Do not scan local directories, logs, caches, or source code to guess note content.
- Every internal ID must come from an API response and must never be written manually. ,
folder_id,target_folder_id, andnote_idmust first be queried and confirmed.move_item_list[].item_id - Hide ,
note_id,folder_id, anduser_idduring normal display. Show them only when the user requests debugging information or raw fields.key_id - If an endpoint reports an error, times out, or returns , clearly state that data cannot currently be obtained through the Ai好记 Open Platform. Do not fall back to a local search.
401/403/429/5xx - Before every write, present the change plan and wait for user confirmation. Deleting a notebook requires separate confirmation and must not be included in the default automatic-organization plan.
参数来源
Parameter Sources
| 参数 | 来源 |
|---|---|
| |
| 新建子笔记本时来自真实父级 |
| 单篇/批量移动笔记的目标笔记本 ID,也用于批量移动笔记本;必须来自真实笔记本 ID;移动笔记本到根目录可传 |
| |
| 与 PC 端移动接口同形:笔记 |
| 用户明确输入,或 AI 自动归类计划生成并经用户确认 |
| 用户要看划线/高亮/批注/我的记录,或归类需要标注依据时传 |
| 用户选择导出 Markdown 到本地时传 |
| Parameter | Source |
|---|---|
| Real notebook ID returned by |
| For a new sub-notebook, use the real parent |
| Target notebook ID for moving one or multiple notes, also used when bulk-moving notebooks; must be a real notebook ID; use |
| Real note ID returned by |
| Same structure as the PC move endpoint: notes use |
| Explicit user input, or an AI-generated automatic-classification plan that has been confirmed by the user |
| Set to |
| Set to |
常用接口
Common Endpoints
| 意图 | 接口 |
|---|---|
| 校验 Key | |
| 笔记本树 | |
| 笔记列表 / 搜索 / 最近笔记 | |
| 笔记详情 / 语义视图 / 导出 / 划线、批注、我的记录 | |
| 新建笔记本 | |
| 重命名笔记本 | |
| 删除笔记本 | |
| 创建空白笔记 | |
| 移动单篇笔记 | |
| 批量移动笔记 | |
| 批量移动笔记本 | |
笔记本树读取需要 ;创建空白笔记需要 ;其他写入权限通常需要 或 ;记录读取需要 。
folder:listnote:createfolder:writenote:movenote:read| Intent | Endpoint |
|---|---|
| Verify Key | |
| Notebook tree | |
| Note list / search / recent notes | |
| Note details / semantic view / export / highlights, annotations, and My Records | |
| Create notebook | |
| Rename notebook | |
| Delete notebook | |
| Create blank note | |
| Move a single note | |
| Bulk-move notes | |
| Bulk-move notebooks | |
Reading the notebook tree requires ; creating a blank note requires ; other write permissions generally require or ; reading records requires .
folder:listnote:createfolder:writenote:movenote:read意图路由
Intent Routing
- 列出笔记本:先调 ,按接口的
GET /agent-open/api/v1/folders或folder_tree_text真实层级展示。children - 看某个笔记本里的笔记:先用 定位真实
/folders,再调folder_id;不要把笔记本名复用成/notes?folder_id=...。keyword - 在某个笔记本里搜关键词:先定位 ,再调
folder_id;结果数量以 API 返回为准,不做人为二次删减。/notes?folder_id=...&keyword=... - 查最近/最新 N 篇:;未给 N 默认 10。
/notes?page_no=1&page_size=N&sort_mode=create_time&sort_order=desc - 查最早/最老 N 篇:;未给 N 默认 10。
sort_order=asc - 按 URL 找笔记:把完整 URL 作为 搜索,优先匹配返回里的真实 URL。
keyword - 看总结/大纲/精华速览:详情接口传 。
semantic_view=summary|outline|highlights - 看全文/原文/润色稿:先问 /
A:导出为 Markdown 文件到本地;用户选 A 时用B:直接在聊天里查看,选 B 时按include_export_markdown=true分块查看。semantic_chunk_no - 看划线/高亮/批注/我的记录:调详情接口并传 ;重点读取
include_records=true、data.records_detail.records、data.records_detail.my_record和data.records_detail.ai_highlights。data.records_detail.ai_highlights_status - 创建空白笔记:先询问并确认标题、目标笔记本和 Markdown 正文摘要,再调用 ;创建成功后用返回的
POST /agent-open/api/v1/notes调详情接口note_id回读验证。semantic_view=full
- List notebooks: first call , then display the actual hierarchy from the endpoint’s
GET /agent-open/api/v1/foldersorfolder_tree_text.children - View notes in a notebook: first use to locate the real
/folders, then callfolder_id; do not reuse the notebook name as/notes?folder_id=....keyword - Search for a keyword within a notebook: first locate , then call
folder_id; use the number of results returned by the API without applying an additional manual reduction./notes?folder_id=...&keyword=... - Find the most recent N notes: use ; if N is not specified, default to 10.
/notes?page_no=1&page_size=N&sort_mode=create_time&sort_order=desc - Find the oldest N notes: use ; if N is not specified, default to 10.
sort_order=asc - Find a note by URL: search using the complete URL as and prioritize matching the real URL in the returned results.
keyword - View a summary, outline, or highlights overview: pass to the details endpoint.
semantic_view=summary|outline|highlights - View full text, original text, or a polished version: first ask /
A: Export as a Markdown file to the local system. For A, useB: View directly in the chat; for B, view it in chunks usinginclude_export_markdown=true.semantic_chunk_no - View highlights, annotations, or My Records: call the details endpoint with ; focus on
include_records=true,data.records_detail.records,data.records_detail.my_record, anddata.records_detail.ai_highlights.data.records_detail.ai_highlights_status - Create a blank note: first ask for and confirm the title, target notebook, and Markdown body summary, then call . After creation succeeds, use the returned
POST /agent-open/api/v1/notesto call the details endpoint withnote_idand verify the result by reading it back.semantic_view=full
整理与写入
Organization and Writes
写入固定顺序:
- 读取 和
folders,确认真实 ID。notes - 读取详情和必要的记录信息。
- 输出计划:将创建的笔记本、将移动的笔记/笔记本、目标位置、归类依据。
- 等用户明确确认。
- 创建缺失笔记本,再移动笔记或笔记本。
- 重新查询目标笔记本或笔记列表验证结果。
创建空白笔记的首版边界:单篇创建, 必填且最多 100000 个字符;支持标题、粗体、列表、表格、链接、代码等安全 Markdown。不要传开放 HTML,不支持附件、图片上传、@ 引用、编辑、追加、删除或批量创建。
content_markdown新建顶层笔记本时请求体必须使用 。后端会把 归一为根级 ;不要传 JSON ,线上接口可能返回“创建笔记本失败”。
"parent_id": 00parent_id=Nonenull自动归类整理要求:
- AI 自动归类整理必须先读笔记内容和记录依据,不能只凭标题批量移动,除非用户明确要求粗略整理。
- 已存在同名笔记本时复用,不重复创建。
- 目标不确定的笔记列为“待确认”,不要强行移动。
- 同一轮自动整理不删除笔记本。
批量移动请求优先使用 PC 端同形参数:
json
{
"target_folder_id": 123,
"move_item_list": [
{"move_type": 1, "item_id": "task_xxx", "pre_id": null}
]
}移动笔记本时 , 表示移动到根目录。
move_type=2target_folder_id=-1The required write sequence is:
- Read and
foldersto confirm the real IDs.notes - Read note details and any necessary record information.
- Present a plan containing the notebooks to create, notes or notebooks to move, target locations, and classification rationale.
- Wait for explicit user confirmation.
- Create missing notebooks, then move the notes or notebooks.
- Re-query the target notebook or note list to verify the result.
Initial boundaries for creating blank notes: create one note at a time; is required and may contain at most 100000 characters. Safe Markdown such as headings, bold text, lists, tables, links, and code is supported. Do not pass unrestricted HTML. Attachments, image uploads, @ references, editing, appending, deleting, and bulk creation are not supported.
content_markdownWhen creating a top-level notebook, the request body must use . The backend normalizes to the root-level ; do not send JSON , because the production endpoint may return a “Failed to create notebook” error.
"parent_id": 00parent_id=NonenullRequirements for automatic classification and organization:
- AI-powered automatic classification must first read the note content and record evidence. Do not bulk-move notes based only on their titles unless the user explicitly requests rough organization.
- Reuse an existing notebook with the same name instead of creating a duplicate.
- List notes with uncertain destinations as “Pending confirmation”; do not force them into a destination.
- Do not delete notebooks during the same automatic-organization run.
Prefer the same parameters as the PC endpoint for bulk-move requests:
json
{
"target_folder_id": 123,
"move_item_list": [
{"move_type": 1, "item_id": "task_xxx", "pre_id": null}
]
}When moving notebooks, use . A value moves the notebook to the root directory.
move_type=2target_folder_id=-1错误处理
Error Handling
- :提示 API Key 可能无效、过期、停用、删除、无权限、非会员或应用绑定失效。
401/403 - 权限不足:指出需要 、
note:list、note:read、note:create、folder:list或folder:write。note:move - :说明笔记或笔记本不存在,重新查询候选让用户确认。
404 - :说明触发频率限制,建议稍后再试或减少批量范围。
429
- : Explain that the API Key may be invalid, expired, disabled, deleted, unauthorized, associated with a non-member account, or no longer bound to the application.
401/403 - Insufficient permissions: Identify the required permission: ,
note:list,note:read,note:create,folder:list, orfolder:write.note:move - : Explain that the note or notebook does not exist, then re-query the candidates and ask the user to confirm.
404 - : Explain that the rate limit was triggered and suggest trying again later or reducing the batch size.
429
参考
Reference
- 详细 API、字段、记录结构、导出规则和场景话术:
references/agent-open-platform.md
- Detailed API information, fields, record structures, export rules, and scenario wording:
references/agent-open-platform.md