mem0-cli

Manage Mem0 memories from the terminal using the mem0 command-line interface.

Updated Jun 29, 2026
One-click install
npx skills add https://github.com/nhatnguyen1122/Agent-Memory-Eval --skill mem0-cli-nhatnguyen1122
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mem0-cli
Source: https://github.com/nhatnguyen1122/Agent-Memory-Eval/tree/main/mem0/skills/mem0-cli
Command: npx skills add https://github.com/nhatnguyen1122/Agent-Memory-Eval --skill mem0-cli-nhatnguyen1122

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing AI memories through a terminal requires knowing the exact mem0 CLI commands, flags, scoping rules, and output formats across both the Node.js and Python implementations. This Skill teaches the AI to construct correct mem0 invocations, handle entity scoping, and debug common CLI issues. ## Core Features & Use Cases - Full command coverage: Run add, search, list, get, update, delete, import, config, init, status, entity, and event commands with correct flags and output modes. - Agent and JSON mode: Produce structured JSON envelopes via --json or --agent flags for LLM consumption, scripting, and CI/CD pipelines. - Workflow recipes: Pipe content via stdin, bulk import from JSON files, combine with jq, and handle async processing delays with event polling. - Use Case: Ask the AI to "search alice's memories for dietary preferences and output as JSON" and it constructs the correct command with proper scoping and output flags. ## Quick Start Ask the AI to add a memory for a user, for example: add a memory for user alice that she prefers dark mode using the mem0 CLI.

Frequently Asked Questions about mem0-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a memory using the mem0 CLI?

Run mem0 add followed by the text and a scope flag, for example: mem0 add "I prefer dark mode" --user-id alice. You can also pipe content via stdin, pass conversation messages with --messages, or import from a JSON file with mem0 import.

How do I search memories from the command line?

Use mem0 search with a query and scope flag, such as mem0 search "preferences" --user-id alice. Add -k to limit results, --threshold for minimum similarity score, --rerank for improved relevance, and -o json for machine-readable output.

What is the difference between the Node.js and Python mem0 CLI?

Both @mem0/cli (npm) and mem0-cli (pip) are built from the same specification and share identical commands, flags, output formats, error messages, and exit codes. Choose whichever runtime you already have installed; behavior is the same.

Why can't I find a memory right after adding it with mem0 add?

Memories are processed asynchronously after mem0 add, so wait 2-3 seconds before searching. You can check processing status with mem0 event list or poll a specific event using mem0 event status with the event ID.

What is the difference between mem0 delete --all and --entity?

mem0 delete --all -u alice deletes all memories for user alice, while mem0 delete --entity -u alice deletes the entity itself plus all its memories in a cascade. The two modes are mutually exclusive, and --dry-run previews either operation.

How do I use mem0 CLI in CI/CD pipelines?

Set the MEM0_API_KEY environment variable or run mem0 init --api-key <key> --user-id ci-bot --force for non-interactive setup. Use --json or --agent flags for parseable output and combine with jq for scripting and exit-code checks.