Embedding Models
Config
What is Config?
Config in mem0 is a dictionary that specifies the settings for your embedding models. It allows you to customize the behavior and connection details of your chosen embedder.
How to Define Config
The config is defined as a Python dictionary with two main keys:
embedder
: Specifies the embedder provider and its configurationprovider
: The name of the embedder (e.g., “openai”, “ollama”)config
: A nested dictionary containing provider-specific settings
How to Use Config
Here’s a general example of how to use the config with mem0:
Why is Config Needed?
Config is essential for:
- Specifying which embedding model to use.
- Providing necessary connection details (e.g., model, api_key, embedding_dims).
- Ensuring proper initialization and connection to your chosen embedder.
Master List of All Params in Config
Here’s a comprehensive list of all parameters that can be used across different embedders:
Parameter | Description | |
---|---|---|
model | Embedding model to use | |
api_key | API key of the provider | |
embedding_dims | Dimensions of the embedding model | |
http_client_proxies | Allow proxy server settings | |
ollama_base_url | Base URL for the Ollama embedding model | |
model_kwargs | Key-Value arguments for the Huggingface embedding model | |
azure_kwargs | Key-Value arguments for the AzureOpenAI embedding model | |
openai_base_url | Base URL for OpenAI API | OpenAI |
vertex_credentials_json | Path to the Google Cloud credentials JSON file for VertexAI |
Supported Embedding Models
For detailed information on configuring specific embedders, please visit the Embedding Models section. There you’ll find information for each supported embedder with provider-specific usage examples and configuration details.