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

# Mem0 integration guide

Mem0 is a memory engine designed to maintain contextual conversations, ensuring users don't have to repeat themselves and that your agents provide consistent, continuous responses. It offers an adaptive memory solution tailored for teams who want to manage everything on their own infrastructure. You retain full control over the stack, data, and customizations.

## Prerequisites

Before starting, ensure you have:

* A [SambaCloud](https://cloud.sambanova.ai/apis) account and API key.
* Python 3.9 or later.

## Installation and setup

### Clone the repository

```bash theme={null}
git clone https://github.com/sambanova/integrations.git
cd integrations/mem0
```

### Create a virtual environment

```bash theme={null}
python -m venv .venv
source .venv/bin/activate
```

### Install dependencies

```bash theme={null}
pip install -r requirements.txt
```

## Set environment variables

Create a `.env` file in the project directory with your API key:

```bash theme={null}
SAMBANOVA_API_KEY=your-sambanova-api-key
```

Or export it directly:

```bash theme={null}
export SAMBANOVA_API_KEY="your-sambanova-api-key"
```

## Run the example

```bash theme={null}
python main.py
```

For the complete source code, see the [Mem0 integration example](https://github.com/sambanova/integrations/tree/main/mem0) on GitHub.

## Mem0 documentation

For more information about Mem0, see the [official Mem0 documentation](https://docs.mem0.ai/introduction).
