# mem0ai/mem0

> mem0 is a universal memory layer for AI agents, used to give assistants and agents memory of user preferences and past interactions. It stores memories from what users and agents provide and retrieves the relevant ones later, so responses can be personalized and adapt over time. The main language is Python, and the repository also includes a TypeScript SDK and a Node command line tool.

Source: https://github.com/mem0ai/mem0
Indexed: commit 001c235 on 2026-08-18 by Repowise. Facts come from the source and git history, not from the maintainer.

## Facts

- Type: Command-line tool
- Language: Python
- Stars: 69,014 at index time
- License: Apache-2.0
- Code health: 7.1/10, Good
- Last commit: 2026-08-14
- Contributors: 120

## Install

From the README: https://github.com/mem0ai/mem0#-quickstart-guide

Clone the mem0 repository.
    git clone https://github.com/mem0ai/mem0.git

Move into the mem0 folder.
    cd mem0

Install the Python library.
    pip install mem0ai

Install the TypeScript SDK.
    npm install mem0ai

Start the self-hosted server, create an admin, and issue the first API key.
    cd server && make bootstrap

## How to use

Initialize the mem0 command line tool.
    mem0 init

## How it works

Input enters through the Python library, where mem0/memory/main.py, a hotspot file in the mem0 package, holds the central memory logic. The TypeScript SDK has a matching memory module at mem0-ts/src/oss/src/memory/index.ts. The server directory contains the self-hosted stack, which is started with make bootstrap or Docker Compose and then configured through a browser setup wizard. The cli directory provides the mem0 command line tool, with cli/python/src/mem0_cli/app.py and cli/node/src/index.ts as its entry points for commands such as add and search. The integrations directory, the largest module by file count, contains the integration code.

- .github/scripts/infer-component-labels.js: entry point
- cli/node/src/index.ts: entry point
- cli/python/src/mem0_cli/__main__.py: entry point
- cli/python/src/mem0_cli/app.py: entry point
- examples/mem0-demo/app/api/chat/route.ts: entry point
Modules: integrations, docs, mem0-ts, mem0, server, examples, tests, cli. 1,491 files, 228,481 lines, 8,251 symbols.

## Code health

- Score: 7.1/10 (Good)
- Rank: #137 of 4,000+ indexed repos
- Hotspots: mem0-ts/src/oss/tests/vector-stores-compat.test.ts, mem0/memory/main.py, mem0-ts/src/oss/src/memory/index.ts, tests/test_memory.py, tests/memory/test_main.py
- Lowest file: mem0/memory/main.py
- Dead code: 158 findings

## Maintenance

- Last commit 2026-08-14, first commit 2026-04-10, 500 commits
- 120 contributors, bus factor 1

## Security

- Security findings are shown to signed-in users at https://repowise.dev/repo/mem0ai/mem0/security

## More

- Page: https://repowise.dev/repo/mem0ai/mem0
- Ask this codebase: https://repowise.dev/repo/mem0ai/mem0/chat
- Docs: https://repowise.dev/repo/mem0ai/mem0/docs
- MCP (signs in with Repowise on first use):
    claude mcp add --transport http repowise https://api.repowise.dev/mcp/mem0ai/mem0
