> ## 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

> Sử dụng TokenLab làm nhà cung cấp LLM tương thích với OpenAI trong Mem0 OSS

## Tổng quan

Mem0 OSS có thể sử dụng TokenLab thông qua cấu hình LLM tương thích với OpenAI bằng cách giữ `provider: "openai"` và thiết lập `openai_base_url`.

<Note>
  **Loại**: Framework bộ nhớ (Memory Framework)

  **Đường dẫn chính**: Cấu hình LLM tương thích với OpenAI

  **Độ tin cậy hỗ trợ**: Hỗ trợ đường dẫn endpoint tùy chỉnh
</Note>

## Môi trường

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

## Cấu hình Python

```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)
```

## Cách sử dụng cơ bản

```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)
```

## Lưu ý về Endpoint

Cấu hình này bao gồm đường dẫn LLM tương thích với OpenAI của Mem0. Hãy cấu hình các bộ nhúng (embedders) riêng biệt tùy theo vector store và mô hình nhúng mà bạn sử dụng.
