---
title: "Common Problems"
description: "This page addresses common issues you might encounter, especially after upgrading to mem0 v1.0.0. This version introduced significant API simplifications, which means some of your existing code mig..."
last_updated: "2026-05-07T04:49:20.375451+00:00"
canonical_url: "https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/guide/section-5/common-problems"
---

This page addresses common issues you might encounter, especially after upgrading to mem0 v1.0.0. This version introduced significant API simplifications, which means some of your existing code might need minor adjustments. Understanding these changes will help you resolve problems quickly and efficiently.

<Callout title="Important Upgrade" variant="info">
The mem0 v1.0.0 release streamlines the API by removing confusing version parameters and standardizing response formats. If you are experiencing unexpected behavior or errors, especially `KeyError` or `TypeError`, it's likely related to these changes.
</Callout>

### Quick Migration Steps

If you haven't already, follow these steps to upgrade your mem0 installation and code. This often resolves many common problems.

<Steps>
<Step>
### Install the Update
Upgrade your `mem0ai` package to the latest version.

```bash
pip install mem0ai==1.0.0
```
</Step>
<Step>
### Update Your Code
Remove any `version` or `output_format` parameters from your `Memory` or `MemoryClient` initialization and method calls.

**Before:**
```python
# With Memory API
memory = Memory(config=MemoryConfig(version="v1.1"))
result = memory.add("I like pizza")

# With Client API
client.add(messages, output_format="v1.1")
client.search(query, version="v2", output_format="v1.1")
```

**After:**
```python
# With Memory API
memory = Memory() # Version is automatic now
result = memory.add("I like pizza")

# With Client API
client.add(messages) # Just remove those extra parameters
client.search(query)
```
</Step>
<Step>
### Adjust Response Handling
All responses now use a consistent format: a dictionary with a `"results"` key. You need to access the actual data through this key.

**Before:**
```python
result = memory.add("I like pizza")
for item in result: # Treating it as a list
    print(item)
```

**After:**
```python
result = memory.add("I like pizza")
for item in result["results"]: # Access the results key
    print(item)
```
</Step>
</Steps>

## Common Problems and Solutions

Here are some specific errors you might encounter and how to fix them.

### `KeyError: 'results'`

This error occurs when your code expects the API response to be a direct list of memories, but it's now a dictionary containing a `"results"` key.

<Steps>
<Step>
### Understand the New Response Format
In mem0 v1.0.0, all API responses (from `add`, `search`, `get_all`, etc.) are now consistently structured as a dictionary with a top-level key called `"results"`. The actual data you're interested in (e.g., the list of memories) is nested under this key.

**Example of a new response:**
```json
{
  "results": [
    {"memory": "I like pizza", "timestamp": "..."},
    {"memory": "I like pasta", "timestamp": "..."}
  ]
}
```
</Step>
<Step>
### Update Your Code to Access `results`
Modify your code to access the `"results"` key from the response dictionary.

**Change this:**
```python
for memory_item in response:
    # ... your code ...
```

**To this:**
```python
for memory_item in response["results"]:
    # ... your code ...
```
</Step>
</Steps>

### `TypeError: unexpected keyword argument`

This error indicates that you are passing parameters that are no longer supported by the mem0 API methods. Specifically, `version` and `output_format` have been removed.

<Steps>
<Step>
### Identify and Remove Old Parameters
Review your `Memory` or `MemoryClient` initialization and any method calls (like `add`, `search`) for `version` or `output_format` parameters.

**Change this:**
```python
# Example with MemoryClient
client.add(messages, output_format="v1.1")
client.search(query, version="v2", output_format="v1.1")

# Example with MemoryConfig
memory = Memory(config=MemoryConfig(version="v1.0"))
```

**To this:**
```python
# Example with MemoryClient
client.add(messages)
client.search(query)

# Example with MemoryConfig
memory = Memory() # Remove the version parameter
```
</Step>
</Steps>

### Seeing Deprecation Warnings

If you see warnings related to `version` parameters, it means you still have an explicit `version` set in your `MemoryConfig`.

<Steps>
<Step>
### Remove `version` from `MemoryConfig`
The `version` parameter is no longer needed in `MemoryConfig` as the API now uses a single, consistent version.

**Change this:**
```python
from mem0 import Memory, MemoryConfig

config = MemoryConfig(
    version="v1.0",
    # ... other configurations ...
)
memory = Memory(config=config)
```

**To this:**
```python
from mem0 import Memory, MemoryConfig

config = MemoryConfig(
    # ... other configurations, but no 'version' ...
)
memory = Memory(config=config)

# Or, if you don't have other config:
memory = Memory()
```
</Step>
</Steps>

## Key Concepts

### Consistent Response Format

As mentioned, all API responses now return a dictionary with a `"results"` key. This standardization makes it easier to predict and handle data returned by mem0, regardless of the specific operation.

### Flexible Message Input

The `MemoryClient` now supports the same flexible message formats as the open-source version. You can provide messages as:
*   A single string (automatically treated as a user message).
*   A single message dictionary (e.g., `{"role": "user", "content": "..."}`).
*   A list of message dictionaries (for a conversation history).

```python
from mem0 import MemoryClient

client = MemoryClient(api_key="your-key")

# 1. Single string
client.add("I like pizza", user_id="alice")

# 2. Single message dictionary
client.add({"role": "user", "content": "I like pizza"}, user_id="alice")

# 3. List of messages (conversation)
client.add([
    {"role": "user", "content": "I like pizza"},
    {"role": "assistant", "content": "I'll remember that!"}
], user_id="alice")
```

## Tips and Warnings

<Callout title="Async Mode Default" variant="info">
The `async_mode` parameter for adding memories now defaults to `True`. This generally provides better performance by processing memory additions in the background. You can explicitly set it to `False` if you have specific requirements for synchronous processing, but it's usually not necessary.

```python
# Default behavior (async_mode=True)
client.add(messages, user_id="alice")

# Explicitly set async mode
client.add(messages, user_id="alice", async_mode=True)

# Disable async mode if needed
client.add(messages, user_id="alice", async_mode=False)
```
</Callout>

## Testing Your Migration

After making changes, you can use this quick sanity check to ensure your migration was successful and the API responses are in the expected format.

<Steps>
<Step>
### Run the Sanity Check
Execute the following Python code to verify that `add`, `search`, and `get_all` methods return dictionaries with the `"results"` key.

```python
from mem0 import Memory

memory = Memory()

# Add should return a dict with "results"
result = memory.add("I like pizza", user_id="test")
assert "results" in result, "Add method did not return 'results' key"

# Search should return a dict with "results"
search = memory.search("food", user_id="test")
assert "results" in search, "Search method did not return 'results' key"

# Get all should return a dict with "results"
all_memories = memory.get_all(user_id="test")
assert "results" in all_memories, "Get all method did not return 'results' key"

print("✅ Migration successful! All checks passed.")
```
</Step>
</Steps>

## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/faa36707-7c28-4f69-a18f-700ff61c704e/llms.txt) for all pages in this wiki.
