cli-memory
Use for Mem0/mem0ai command-line memory workflows: Python or Node mem0 CLI install, init, Agent Mode, add/search/list/get/update/delete, import/export via JSON, config defaults, entities, events, stdin/files, graph flags, and shell-safe automation.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- cli-memory
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use for Mem0/mem0ai command-line memory workflows: Python or Node mem0 CLI install, init, Agent Mode, add/search/list/get/update/delete, import/export via JSON, config defaults, entities, events, stdin/files, graph flags, and shell-safe automation.
- disable-model-invocation
- true
02 资源文件 6
- 参考文档references/agent-json-workflows.md8.4 KB
- 参考文档references/command-reference.md12.8 KB
- 参考文档references/configuration.md7.9 KB
- 参考文档references/troubleshooting.md10.1 KB
- 脚本scripts/summarize_cli_spec.py9.5 KB
- 脚本scripts/validate_cli_json.py9.5 KB
03 SKILL.md 正文
cli-memory
Use this sub-skill when the task is about operating the Mem0 memory layer from a terminal rather than embedding SDK calls in application code.
Natural triggers include: "Mem0 CLI", "mem0 command line", "mem0ai terminal", "memory layer shell workflow", mem0 init, mem0 add, mem0 search, mem0 list, mem0 config, mem0 import, mem0 --agent, mem0 --json, @mem0/cli, mem0-cli, stdin/file import, JSON output, entity cleanup, event status, or debugging CLI defaults.
Route First
- Use this sub-skill for Python
mem0-cliand Node@mem0/cliworkflows, command parity, config precedence, output contracts, safe scripting, and CLI troubleshooting. - Use sibling
../sdk-memory/SKILL.mdfor Python/TypeScript SDK call-site code,MemoryClient,Memory, async clients, or app integration logic. - Use sibling
../provider-configuration/SKILL.mdfor OSS provider/vector/embedding/LLM/reranker/graph backend configuration beyond CLI flags. - Use sibling
../self-hosted-openmemory/SKILL.mdfor self-hosted server, OpenMemory, Docker, REST server, MCP server, migrations, and operational deployment. - Use sibling
../integrations-plugins/SKILL.mdfor editor plugin slash commands, lifecycle hooks, MCP agent plugins, Vercel AI SDK, OpenClaw, Pi Agent, and framework integrations.
Key Facts
- Both CLI packages install a
mem0executable and target the hosted Mem0 Platform API by default. - Python package facts from repo metadata:
mem0-cliversion0.2.8, Python>=3.10, Typer/Rich/httpx, entry pointmem0 = mem0_cli.app:main. - Node package facts from repo metadata:
@mem0/cliversion0.2.9, Node>=18, ESM binarydist/index.js, Commander-based. - The checked CLI contract is
specVersion: 1; the CLI spec’s owncli.versionis0.1.0, so do not confuse spec version with package release versions. - Agent/programmatic output uses a JSON envelope; human output may contain tables, colors, spinners, and status text.
Read Before Acting
- Command catalog and parity: references/command-reference.md
- Config precedence and secrets: references/configuration.md
- Agent mode, JSON parsing, stdin/files, import/export recipes: references/agent-json-workflows.md
- Failure diagnosis: references/troubleshooting.md
Bundled Helpers
scripts/summarize_cli_spec.pysummarizes a Mem0 CLI spec JSON into Markdown or JSON without contacting Mem0.scripts/validate_cli_json.pyvalidates Mem0 CLI agent-mode envelopes, raw JSON outputs, import files, and config snapshots using local JSON only.
Working Rules
- Never print, log, commit, or paste raw API keys; prefer env vars and redacted config views.
- For automation, prefer
mem0 --agent <command>ormem0 <command> --output jsonand parse stdout only. - Put destructive commands behind
--dry-runfirst when available, then require explicit--forcefor agent/CI flows. - Treat CLI flags as highest precedence, then environment variables, then
~/.mem0/config.json, then built-in defaults. - If any explicit scope flag is provided (
--user-id,--agent-id,--app-id,--run-id), do not assume unspecified scope IDs are filled from config defaults.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).