peek
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMem0 Peek
Mem0 Peek
Quick search with compact output. Lighter than .
/mem0:tour快速搜索并输出简洁结果,比更轻量化。
/mem0:tourExecution
执行步骤
Step 1: Parse query
步骤1:解析查询
The user provides a search query:
/mem0:peek auth middlewareIf no query provided, ask: "What should I search for?"
Memory ID detection: If the query matches any of these patterns, treat it as a
direct memory ID lookup instead of a search:
- Bare hex: (short ID) or
^[a-f0-9]{8}$(full UUID)^[a-f0-9]{8}-[a-f0-9-]+$ - Citation ref: — extract the hex portion
[mem0:<hex>]
When an ID is detected:
- Call directly (if short ID, try as prefix of full UUID)
get_memory(<id>) - If found, skip to Step 3 and display the single result
- If not found, fall through to search using the ID as query text
用户提供搜索查询:
/mem0:peek auth middleware如果未提供查询,询问:“需要搜索什么内容?”
记忆ID检测: 如果查询匹配以下任一模式,则将其视为直接记忆ID查找而非搜索:
- 纯十六进制字符串:(短ID)或
^[a-f0-9]{8}$(完整UUID)^[a-f0-9]{8}-[a-f0-9-]+$ - 引用格式:—— 提取其中的十六进制部分
[mem0:<hex>]
检测到ID时:
- 直接调用(如果是短ID,尝试作为完整UUID的前缀匹配)
get_memory(<id>) - 如果找到结果,跳至步骤3并显示单个结果
- 如果未找到,将该ID作为查询文本执行搜索
Step 2: Search
步骤2:执行搜索
Run 2 parallel calls:
search_memories- Broad: ,
query=<user's query>,filters={"AND": [{"user_id": "<id>"}, {"app_id": "<pid>"}]},top_k=10rerank=true - Targeted: ,
query=<user's query>,filters={"AND": [{"user_id": "<id>"}, {"app_id": "<pid>"}, {"metadata": {"type": "decision"}}]},top_k=5rerank=true
并行执行2次调用:
search_memories- 宽泛搜索:,
query=<用户查询内容>,filters={"AND": [{"user_id": "<id>"}, {"app_id": "<pid>"}]},top_k=10rerank=true - 定向搜索:,
query=<用户查询内容>,filters={"AND": [{"user_id": "<id>"}, {"app_id": "<pid>"}, {"metadata": {"type": "decision"}}]},top_k=5rerank=true
Step 3: Display
步骤3:结果展示
Deduplicate by ID, then show compact results:
undefined按ID去重后,显示简洁结果:
undefinedmem0 peek: "<query>" (<N> results)
mem0 peek: "<query>" (<N> results)
- [decision] Auth module uses JWT with RS256 keys (2025-05-15) [mem0:a3f8b2c1]
- [anti_pattern] Don't use symmetric HS256 — leaked in env (2025-05-10) [mem0:7e2d9f4a]
- [convention] All middleware in src/middleware/ (2025-05-08) [mem0:c4d5e6f7]
Format: `<number>. [<type>] <content, 80 chars> (<date>) [mem0:<short_id>]`
If no results:No memories matching "<query>" for project <project_id>.
undefined- [decision] Auth module uses JWT with RS256 keys (2025-05-15) [mem0:a3f8b2c1]
- [anti_pattern] Don't use symmetric HS256 — leaked in env (2025-05-10) [mem0:7e2d9f4a]
- [convention] All middleware in src/middleware/ (2025-05-08) [mem0:c4d5e6f7]
格式:`<序号>. [<类型>] <内容,最多80字符> (<日期>) [mem0:<短ID>]`
如果无匹配结果:项目<project_id>中未找到与"<query>"匹配的记忆。
undefined