Stores a memory verbatim from user input with appropriate type classification and metadata. Use when the user says remember this, save this, store this, note th
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-mem0-remember-06b2efac9f0a ,按照其中的说明把「mem0-remember」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Store a fact or learning directly into mem0.
The user provides the content as an argument: /mem0-remember <text>
If no text was provided, ask: "What should I remember?"
Based on the content, pick the best metadata.type:
| Content signal | Type |
|---|---|
| "we decided...", "always use...", "never..." | decision |
| "X doesn't work because...", "don't try..." | anti_pattern |
| "I prefer...", "use X instead of Y" | user_preference |
| "the convention is...", "we always..." | convention |
| "learned that...", "figured out..." | task_learning |
| setup, env, tooling, config | environmental |
| anything else | task_learning |
Call add_memory with:
text="<the user's text>"user_id=<active_user_id>app_id=<active_project_id>metadata={"type": "<classified_type>", "branch": "<active_branch>", "confidence": 1.0, "source": "remember_command"}infer=Falseinfer=False because the user stated the fact explicitly — no extraction needed.
confidence=1.0 because the user explicitly asked to store this.
The add_memory response returns event_id (not memory_id) because writes are async.
Call get_event_status(event_id=<event_id>) once.
SUCCEEDED: print the memory ID from the result.PENDING or processing: print with the event ID as fallback.Remembered as <type>: "<content, first 80 chars>"
Memory ID: <id from event status>
Append ... only if content was truncated (longer than 80 chars).
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.