memos
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMemos API Skill
Memos API 技能
This skill combines two layers:
- low-level API access for exact Memos endpoints
- task-oriented query helpers for common memo retrieval jobs
- tag inventory helpers so the calling agent can inspect existing hashtags before deciding whether to reuse them
Scope is intentionally limited to:
- attachment operations
- memo operations
- activity operations
It does not cover user management, auth setup beyond the local , shortcuts, identity providers, or instance settings. If the request drifts there, say the skill scope is limited instead of guessing unsupported commands.
.env本技能包含三层能力:
- 针对具体Memos端点的底层API访问能力
- 面向常见备忘录检索任务的任务导向查询助手
- 标签清单助手,可供调用的Agent在决定是否复用现有标签前进行检查
本技能的作用范围特意限定为:
- 附件操作
- 备忘录操作
- 活动操作
它不涵盖用户管理、本地之外的身份验证配置、快捷方式、身份提供商或实例设置。如果请求超出上述范围,请告知用户本技能的作用范围有限,不要猜测不支持的命令。
.envWhat this skill provides
本技能提供的能力
- A Bun CLI at
scripts/memos.ts - Endpoint discovery and direct API calling via ,
ops, anddescribecall - Task-oriented memo helpers via ,
latest, andrecentsearch - A helper that aggregates existing tags, counts, recency, and sample memo snippets
list-tags - A file-to-attachment helper so agents do not have to hand-roll base64 payloads
- A compact operation catalog at
references/api-summary.md - Query recipes and time-window guidance at
references/query-recipes.md
- 位于的Bun CLI
scripts/memos.ts - 通过、
ops和describe实现的端点发现和直接API调用能力call - 通过、
latest和recent实现的任务导向备忘录助手search - 可聚合现有标签、计数、新鲜度和备忘录示例片段的助手
list-tags - 文件转附件助手,Agent无需手动构建base64 payload
- 位于的精简操作目录
references/api-summary.md - 位于的查询方案和时间窗口指导
references/query-recipes.md
Setup
配置步骤
- Work from the skill directory.
- Ensure contains:
.envMEMOS_BASE_URLMEMOS_ACCESS_TOKEN
- Verify config:
bash
bun run scripts/memos.ts configMEMOS_BASE_URLhttp://localhost:5230http://localhost:5230/api/v1- 在技能目录下执行操作
- 确保文件包含以下配置:
.envMEMOS_BASE_URLMEMOS_ACCESS_TOKEN
- 验证配置:
bash
bun run scripts/memos.ts configMEMOS_BASE_URLhttp://localhost:5230http://localhost:5230/api/v1Choose the right path
选择合适的使用路径
Use the high-level commands first when the user asked for a retrieval task, not a specific endpoint.
- Latest memo or latest N memos:
bash
bun run scripts/memos.ts latest --count 5- Recent memos inside a time window:
bash
bun run scripts/memos.ts recent --days 7 --window rolling --include-content- Search by text or tag:
bash
bun run scripts/memos.ts search --text agent --tag Thought --days 30- Inspect existing tags before deciding which hashtags to reuse in a new memo:
bash
bun run scripts/memos.ts list-tags --limit 100 --sample-size 2Use when the user explicitly needs one documented endpoint or a write operation.
call- Inspect the exact endpoint first:
bash
bun run scripts/memos.ts describe MemoService_UpdateMemo- Then call it directly:
bash
bun run scripts/memos.ts call MemoService_UpdateMemo \
--path memo=YOUR_MEMO_ID \
--query updateMask=content,visibility \
--body '{"content":"Updated content","visibility":"PROTECTED"}'当用户需要执行检索任务而非调用特定端点时,优先使用高阶命令:
- 最新的1条或N条备忘录:
bash
bun run scripts/memos.ts latest --count 5- 指定时间窗口内的最近备忘录:
bash
bun run scripts/memos.ts recent --days 7 --window rolling --include-content- 按文本或标签搜索:
bash
bun run scripts/memos.ts search --text agent --tag Thought --days 30- 在新备忘录中决定复用哪些hashtag前,先查看现有标签:
bash
bun run scripts/memos.ts list-tags --limit 100 --sample-size 2当用户明确需要调用某个已文档化的端点或执行写入操作时,使用命令:
call- 首先查看指定端点的详细信息:
bash
bun run scripts/memos.ts describe MemoService_UpdateMemo- 然后直接调用该端点:
bash
bun run scripts/memos.ts call MemoService_UpdateMemo \
--path memo=YOUR_MEMO_ID \
--query updateMask=content,visibility \
--body '{"content":"Updated content","visibility":"PROTECTED"}'Known quirks
已知注意事项
- returns
call --paginate, not a top-level{ operationId, pageCount, pages: [...] }. Flatten{ memos: [...] }before post-processing.pages[*].memos - Memo time checks should use first, then fall back to
displayTime.createTime - For time-range queries, prefer plus local filtering. Do not assume the server-side
orderBy='display_time desc'field supports stable time semantics across versions.filter - The task-oriented commands default so archived or deleted content does not silently leak into user-facing summaries.
state=NORMAL - matches the memo
search --tagarray exactly. It is not a full-text hashtag parser overtags.content - is extracted by the server from hashtags in
Memo.tags. Treat it as output-only unless the deployed API docs explicitly say otherwise.content
- 返回的格式是
call --paginate,而非顶层的{ operationId, pageCount, pages: [...] },后处理前需要先展开{ memos: [...] }pages[*].memos - 备忘录时间检查优先使用,回退方案为
displayTimecreateTime - 时间范围查询优先使用加本地过滤,不要假定服务端
orderBy='display_time desc'字段在不同版本间都支持稳定的时间语义filter - 任务导向命令默认设置,因此已归档或已删除的内容不会静默泄露到面向用户的摘要中
state=NORMAL - 是精确匹配备忘录
search --tag数组,不是对tags做全文hashtag解析content - 是服务端从
Memo.tags的hashtag中提取的,除非部署的API文档明确说明支持修改,否则应当作仅输出字段处理content
Recommended workflow
推荐工作流
1. Retrieval tasks
1. 检索任务
When the user asks questions like:
- 最近一周有哪些备忘录
- 最新的一条 memo 是什么
- 带 tag 的 memo 有哪些
Thought - 搜一下包含某个关键词的 memo
Use:
- ,
latest, orrecentsearch - Return the important fields from the JSON result
- Summarize content for the user when they asked for meaning, not raw JSON
Read when you need concrete examples or want to choose between and time windows.
references/query-recipes.mdrollingcalendar当用户提出以下类型的问题时:
- 最近一周有哪些备忘录
- 最新的一条 memo 是什么
- 带 tag 的 memo 有哪些
Thought - 搜一下包含某个关键词的 memo
请按以下步骤操作:
- 使用、
latest或recent命令search - 返回JSON结果中的关键字段
- 当用户需要了解内容含义而非原始JSON时,对内容做摘要处理
如果需要具体示例,或是要在和时间窗口之间做选择,请查阅。
rollingcalendarreferences/query-recipes.md2. Tag-aware memo creation
2. 带标签感知的备忘录创建
When the user asks to create a memo with tags or hashtags:
- Run first to inspect the existing tag vocabulary.
bun run scripts/memos.ts list-tags ... - If one or more candidate tags might match, run on the likely choices to inspect prior memo context.
search --tag ... - Let the calling agent decide which existing tags to reuse. Do not hard-code similarity logic in scripts for this decision.
- Put the final tags directly into the memo as hashtags, usually at the top, for example:
content
json
{
"state": "NORMAL",
"visibility": "PRIVATE",
"content": "#memos #openclaw\n\nImplemented tag discovery before creating this memo."
}- Call with that content body.
MemoService_CreateMemo
Prefer reusing an existing tag when it clearly expresses the same concept. If the meaning is uncertain, inspect old memo examples first instead of inventing normalization rules.
当用户要求创建带标签或hashtag的备忘录时:
- 首先执行查看现有标签库
bun run scripts/memos.ts list-tags ... - 如果存在一个或多个可能匹配的候选标签,对可能的选项执行查看过往备忘录上下文
search --tag ... - 由调用的Agent决定要复用哪些现有标签,不要在脚本中硬编码相似度逻辑来做这个决策
- 将最终的标签作为hashtag直接写入备忘录中,通常放在顶部,例如:
content
json
{
"state": "NORMAL",
"visibility": "PRIVATE",
"content": "#memos #openclaw\n\nImplemented tag discovery before creating this memo."
}- 传入上述内容body调用接口
MemoService_CreateMemo
当现有标签能明确表达相同概念时优先复用,如果含义不明确,先查看旧的备忘录示例,不要自行创建标准化规则。
3. Exact API work
3. 精确API操作
When the user asks to create, update, delete, attach files, add reactions, or inspect one exact endpoint:
- Run
bun run scripts/memos.ts ops - If needed, run
bun run scripts/memos.ts describe <operationId> - Use
bun run scripts/memos.ts call <operationId> ...
This keeps the agent aligned with the documented API surface instead of inventing raw requests.
当用户要求创建、更新、删除、附加文件、添加反应,或是查看某个精确端点时:
- 执行
bun run scripts/memos.ts ops - 如有需要,执行
bun run scripts/memos.ts describe <operationId> - 使用执行操作
bun run scripts/memos.ts call <operationId> ...
这可以保证Agent和已文档化的API表面保持一致,不会自行构造原始请求。
4. Resource naming rules
4. 资源命名规则
Path placeholders usually expect bare ids:
--path memo=0195c...--path attachment=abc123--path activity=evt_123
Request bodies often expect full resource names:
memos/0195c...attachments/abc123
If you accidentally pass a full resource name into a path flag, the CLI strips the leading path and keeps the last segment.
路径占位符通常需要传入纯id:
--path memo=0195c...--path attachment=abc123--path activity=evt_123
请求体通常需要传入完整资源名:
memos/0195c...attachments/abc123
如果你不小心将完整资源名传入了路径参数,CLI会自动去掉前置路径,保留最后一段。
5. Update requests
5. 更新请求
Patch endpoints such as:
AttachmentService_UpdateAttachmentMemoService_UpdateMemo
need .
--query updateMask=...Without it, many updates fail or update less than expected.
补丁端点,例如:
AttachmentService_UpdateAttachmentMemoService_UpdateMemo
需要传入参数。
--query updateMask=...缺少该参数的话,很多更新会失败,或是更新的内容少于预期。
6. Complex bodies and binary uploads
6. 复杂请求体和二进制上传
Prefer for larger bodies:
@file.jsonbash
bun run scripts/memos.ts call MemoService_CreateMemo --body @/tmp/memo.jsonUse the helper for attachments instead of hand-building base64:
bash
bun run scripts/memos.ts attachment-body --file /path/to/file --output /tmp/body.jsonThen create the attachment:
bash
bun run scripts/memos.ts call AttachmentService_CreateAttachment --body @/tmp/body.json较大的请求体优先使用传入:
@file.jsonbash
bun run scripts/memos.ts call MemoService_CreateMemo --body @/tmp/memo.json附件上传使用助手工具,不要手动构建base64:
bash
bun run scripts/memos.ts attachment-body --file /path/to/file --output /tmp/body.json然后创建附件:
bash
bun run scripts/memos.ts call AttachmentService_CreateAttachment --body @/tmp/body.jsonRead next when needed
后续可选阅读
- Read for recent/latest/search workflows, time-window semantics, and memo post-processing examples.
references/query-recipes.md - Read for the compact endpoint catalog, body hints, and pagination details.
references/api-summary.md
- 查阅了解recent/latest/search工作流、时间窗口语义和备忘录后处理示例
references/query-recipes.md - 查阅了解精简端点目录、请求体提示和分页详情
references/api-summary.md
Output expectations
输出要求
When using this skill for execution:
- call the real API instead of only describing it
- prefer ,
latest, orrecentfor retrieval tasks instead of hand-writing pagination logic each timesearch - return the important response fields to the user
- if you create or update resources, include the resource name or id in your answer
- if the API returns an error, surface the status and body plainly instead of hiding it
使用本技能执行操作时:
- 调用真实API,不要仅做描述
- 检索任务优先使用、
latest或recent,不要每次都手动编写分页逻辑search - 向用户返回重要的响应字段
- 如果你创建或更新了资源,在回答中包含资源名称或id
- 如果API返回错误,清晰展示状态和响应体,不要隐藏