> ## Documentation Index
> Fetch the complete documentation index at: https://spacesail.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Mem0 Tools

## Code

```python cookbook/tools/mem0_tools.py theme={null}
from agno.agent import Agent
from agno.tools.mem0 import Mem0Tools

agent = Agent(
    instructions=[
        "You are a memory-enhanced assistant that can remember information across conversations",
        "Store important information about users and their preferences",
        "Retrieve relevant memories to provide personalized responses",
    ],
    tools=[Mem0Tools(user_id="user_123")],
    markdown=True,
)

agent.print_response("Remember that I prefer vegetarian meals and I'm allergic to nuts")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Set your API keys">
    ```bash theme={null}
    export MEM0_API_KEY=your-mem0-api-key
    export MEM0_ORG_ID=your-organization-id
    export MEM0_PROJECT_ID=your-project-id
    export OPENAI_API_KEY=xxx
    ```
  </Step>

  <Step title="Install libraries">
    ```bash theme={null}
    pip install -U mem0ai openai agno
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
      ```bash Mac theme={null}
      python cookbook/tools/mem0_tools.py
      ```

      ```bash Windows theme={null}
      python cookbook/tools/mem0_tools.py
      ```
    </CodeGroup>
  </Step>
</Steps>
