# AI use cases for Mem0 (mem0ai/mem0)

Repo: [mem0ai/mem0](https://github.com/mem0ai/mem0) | Use cases: 3 | Page: https://dedupedai.com/use-cases/mem0ai-mem0/

Mem0 is a memory layer for AI agents and apps, available as Python and npm libraries, a CLI, a self-hostable server and a managed platform, that stores and searches memories per user.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Give your coding agent a memory it can add to and search: https://dedupedai.com/use-cases/mem0ai-mem0/give-agent-memory-from-cli/
- Remember each user's preferences in your app: https://dedupedai.com/use-cases/mem0ai-mem0/store-per-user-preferences-in-app/
- Self-host the memory server with Docker: https://dedupedai.com/use-cases/mem0ai-mem0/self-host-mem0-server/

## How to give your coding agent a memory it can add to and search with Mem0

Repo: [mem0ai/mem0](https://github.com/mem0ai/mem0) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Install the CLI, sign up as an agent, and add and search memories from the terminal.

**Who it is for:** A developer who wants Claude Code to remember project preferences.

**The problem:** Agents forget preferences between sessions.

**The outcome:** Memories the agent can add and retrieve by meaning.

### Steps

1. Install with `npm install -g @mem0/cli`
2. Run `mem0 init --agent --agent-caller claude-code`
3. Add a memory with `mem0 add "I am using mem0"`
4. Search with `mem0 search "am I using mem0"`

### Prompt to paste into your agent

```text
Install the mem0 CLI, initialize it for <agent>, add the memory <fact>, and search for it. Confirm the search returns it.
```

### Caveat

Agent sign-up uses the managed platform unless you point the CLI at your own server.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/mem0ai-mem0/give-agent-memory-from-cli/

## Mem0 tutorial: remember each user's preferences in your AI app

Repo: [mem0ai/mem0](https://github.com/mem0ai/mem0) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Add and search memories scoped by user id so your assistant personalizes replies.

**Who it is for:** A developer building a chat assistant that should remember each user.

**The problem:** Users must repeat preferences every session.

**The outcome:** Per-user memories retrieved when relevant.

### Steps

1. Install with `pip install mem0ai` or `npm install mem0ai`
2. Add a memory with a user id, for example alice
3. Search memories for that user before replying
4. Include results in the prompt

### Prompt to paste into your agent

```text
Using mem0, store <preference> for user <id> and search "What does <id> prefer?". Confirm results only include that user's memories.
```

### Caveat

The README's benchmark numbers come from the project's own runs.

Risk, credentials: Your LLM key and any Mem0 API key are used for extraction and storage.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/mem0ai-mem0/store-per-user-preferences-in-app/

## How to self-host Mem0 with Docker

Repo: [mem0ai/mem0](https://github.com/mem0ai/mem0) | Difficulty: Advanced | Time: 45 minutes | Basis: From the README

Bootstrap the server stack, create an admin and issue the first API key.

**Who it is for:** A team that must keep user memories on its own infrastructure.

**The problem:** Managed memory services hold user data externally.

**The outcome:** A self-hosted Mem0 server with a dashboard on port 3000.

### Steps

1. Clone the repo
2. Run `cd server && make bootstrap`
3. Or run `cd server && docker compose up -d` and finish in the browser wizard
4. Point your clients at the server

### Prompt to paste into your agent

```text
Self-host mem0 with `cd server && make bootstrap`, create an API key, and add one memory through the API. Confirm it appears in the dashboard.
```

### Caveat

Advanced NLP features need the nlp extra and a spaCy model download.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/mem0ai-mem0/self-host-mem0-server/
