mem0-cli

Manage Mem0 memories from the terminal using add, search, list, update, and delete commands.

1|Updated Jan 13, 2022
One-click install
npx skills add https://github.com/jayho-k/TIL --skill mem0-cli-jayho-k
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mem0-cli
Source: https://github.com/jayho-k/TIL/tree/main/AI/mem0/code/mem0_code_analize/mem0/skills/mem0-cli
Command: npx skills add https://github.com/jayho-k/TIL --skill mem0-cli-jayho-k

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing AI memories through a web dashboard or writing SDK code is slow when you just need to add, search, or delete memories quickly from a terminal, script, or CI/CD pipeline. ## Core Features & Use Cases - Full memory lifecycle from the shell: Run mem0 add, search, list, get, update, delete, import, config, entity, event, and status commands with correct flags, scoping, and output formats. - Agent and JSON modes: Use --json or --agent flags to get structured JSON envelopes on stdout, making output parseable by LLMs, jq, and shell scripts. - Scripting and CI/CD workflows: Pipe content via stdin, bulk import from JSON files, and integrate memory operations into pipelines and agent loops. - Use Case: Ask the assistant to "search alice's memories for dietary preferences and output as JSON" and it constructs the correct mem0 search command with the right flags. ## Quick Start Ask the assistant 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 bulk-load from a JSON file with mem0 import.

How do I search memories from the command line?

Use mem0 search with a query and scope, such as mem0 search "preferences" --user-id alice. You can control result count with -k, set a similarity --threshold, enable --rerank, and choose text, json, or table output formats.

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 behave identically. They share the same commands, flags, output formats, entity resolution, error messages, and exit codes, so you can use whichever runtime you already have.

Why can't I find a memory right after running mem0 add?

Memories are processed asynchronously after mem0 add, so new content may not appear in search results for 2-3 seconds. Wait briefly before searching, or use mem0 event list and mem0 event status to check processing completion.

How do I get JSON output from mem0 commands for scripts?

Pass --json or --agent to any command to receive a structured JSON envelope on stdout with status, command, count, error, and data fields. Spinners go to stderr, so stdout stays clean for jq parsing or LLM consumption.

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

mem0 delete --all -u alice deletes all memories for user alice but keeps the entity. mem0 delete --entity -u alice deletes the entity itself plus all its memories in a cascade. The two modes are mutually exclusive.