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

# Mem0

> Use TokenLab as an OpenAI-compatible LLM provider in Mem0 OSS

## Overview

Mem0 OSS can use TokenLab through its OpenAI-compatible LLM configuration by keeping `provider: "openai"` and setting `openai_base_url`.

<Note>
  **Type**: Memory Framework

  **Primary Path**: OpenAI-compatible LLM configuration

  **Support Confidence**: Supported custom endpoint path
</Note>

## Environment

```bash theme={null}
export TOKENLAB_API_KEY="sk-your-tokenlab-key"
```

## Python Configuration

```python theme={null}
import os

from mem0 import Memory

config = {
    "llm": {
        "provider": "openai",
        "config": {
            "model": "claude-sonnet-5",
            "api_key": os.environ["TOKENLAB_API_KEY"],
            "openai_base_url": "https://api.tokenlab.sh/v1",
            "temperature": 0.1,
        },
    },
    "vector_store": {
        "provider": "qdrant",
        "config": {"host": "localhost", "port": 6333},
    },
}

memory = Memory.from_config(config)
```

## Basic Usage

```python theme={null}
memory.add("The user prefers concise engineering summaries.", user_id="demo")
results = memory.search("How should I answer?", user_id="demo")
print(results)
```

## Endpoint Notes

This configuration covers Mem0's OpenAI-compatible LLM path. Configure embedders separately according to the vector store and embedding model you use.
