To use Together embedding models, set the TOGETHER_API_KEY environment variable. You can obtain the Together API key from the Together Platform.

Usage

The embedding_model_dims parameter for vector_store should be set to 768 for Together embedder.
import os
from mem0 import Memory

os.environ["TOGETHER_API_KEY"] = "your_api_key"
os.environ["OPENAI_API_KEY"] = "your_api_key" # For LLM

config = {
    "embedder": {
        "provider": "together",
        "config": {
            "model": "togethercomputer/m2-bert-80M-8k-retrieval"
        }
    }
}

m = Memory.from_config(config)
m.add("I'm visiting Paris", user_id="john")

Config

Here are the parameters available for configuring Together embedder:

ParameterDescriptionDefault Value
modelThe name of the embedding model to usetogethercomputer/m2-bert-80M-8k-retrieval
embedding_dimsDimensions of the embedding model768
api_keyThe Together API keyNone