Searches memories and displays compact one-liner results, or looks up a specific memory by ID. Use for quick memory lookups, checking if a decision was recorded
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-mem0-search-529a6cef80bd ,按照其中的说明把「mem0-search」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Quick search with compact output. Lighter than /mem0-tour.
The user provides a search query: /mem0-search auth middleware
If 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:
^[a-f0-9]{8}$ (short ID) or ^[a-f0-9]{8}-[a-f0-9-]+$ (full UUID)[mem0:<hex>] — extract the hex portionWhen an ID is detected:
get_memory(<id>) directly (if short ID, try as prefix of full UUID)Call search_memories once with the user's question: query=<user's query>, filters={"AND": [{"user_id": "<id>"}, {"app_id": "<pid>"}]}, top_k=10.
Show compact results:
## mem0 search: "<query>" (<N> results)
1. [decision] Auth module uses JWT with RS256 keys (2025-05-15) [mem0:a3f8b2c1]
2. [anti_pattern] Don't use symmetric HS256 — leaked in env (2025-05-10) [mem0:7e2d9f4a]
3. [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>.
IMPORTANT: Do NOT use markdown in your output. OpenCode TUI renders text verbatim — markdown like bold, ## headers, and | table | syntax appears as raw characters. Use plain text with indentation for structure. Use dashes for lists. Use spaces to align columns instead of markdown tables.