repositories
loading repo index
repositories
loading repo index
repository
loading code, commits, and activity
public Clawd ADK gateway launch mirror
stars
latest
clone command
git clone gitlawb://did:key:z6Mkq5mY...iFZ5/my-project-publ...git clone gitlawb://did:key:z6Mkq5mY.../my-project-publ...2fa351d6docs: add automaton and perps launch sources16d ago| #1 | --- |
| #2 | title: Configurations |
| #3 | --- |
| #4 | |
| #5 | |
| #6 | 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. |
| #7 | |
| #8 | ## How to define configurations? |
| #9 | |
| #10 | The config is defined as an object (or dictionary) with two main keys: |
| #11 | - `embedder`: Specifies the embedder provider and its configuration |
| #12 | - `provider`: The name of the embedder (e.g., "openai", "ollama") |
| #13 | - `config`: A nested object or dictionary containing provider-specific settings |
| #14 | |
| #15 | |
| #16 | ## How to use configurations? |
| #17 | |
| #18 | Here's a general example of how to use the config with mem0: |
| #19 | |
| #20 | <CodeGroup> |
| #21 | ```python Python |
| #22 | import os |
| #23 | from mem0 import Memory |
| #24 | |
| #25 | os.environ["OPENAI_API_KEY"] = "sk-xx" |
| #26 | |
| #27 | config = { |
| #28 | "embedder": { |
| #29 | "provider": "your_chosen_provider", |
| #30 | "config": { |
| #31 | # Provider-specific settings go here |
| #32 | } |
| #33 | } |
| #34 | } |
| #35 | |
| #36 | m = Memory.from_config(config) |
| #37 | m.add("Your text here", user_id="user", metadata={"category": "example"}) |
| #38 | ``` |
| #39 | |
| #40 | ```typescript TypeScript |
| #41 | import { Memory } from 'mem0ai/oss'; |
| #42 | |
| #43 | const config = { |
| #44 | embedder: { |
| #45 | provider: 'openai', |
| #46 | config: { |
| #47 | apiKey: process.env.OPENAI_API_KEY || '', |
| #48 | model: 'text-embedding-3-small', |
| #49 | // Provider-specific settings go here |
| #50 | }, |
| #51 | }, |
| #52 | }; |
| #53 | |
| #54 | const memory = new Memory(config); |
| #55 | await memory.add("Your text here", { userId: "user", metadata: { category: "example" } }); |
| #56 | ``` |
| #57 | </CodeGroup> |
| #58 | |
| #59 | ## Why is Config Needed? |
| #60 | |
| #61 | Config is essential for: |
| #62 | 1. Specifying which embedding model to use. |
| #63 | 2. Providing necessary connection details (e.g., model, api_key, embedding_dims). |
| #64 | 3. Ensuring proper initialization and connection to your chosen embedder. |
| #65 | |
| #66 | ## Master List of All Params in Config |
| #67 | |
| #68 | Here's a comprehensive list of all parameters that can be used across different embedders: |
| #69 | |
| #70 | <Tabs> |
| #71 | <Tab title="Python"> |
| #72 | | Parameter | Description | Provider | |
| #73 | |-----------|-------------|----------| |
| #74 | | `model` | Embedding model to use | All | |
| #75 | | `api_key` | API key of the provider | All | |
| #76 | | `embedding_dims` | Dimensions of the embedding model | All | |
| #77 | | `http_client_proxies` | Allow proxy server settings | All | |
| #78 | | `ollama_base_url` | Base URL for the Ollama embedding model | Ollama | |
| #79 | | `model_kwargs` | Key-Value arguments for the Huggingface embedding model | Huggingface | |
| #80 | | `azure_kwargs` | Key-Value arguments for the AzureOpenAI embedding model | Azure OpenAI | |
| #81 | | `openai_base_url` | Base URL for OpenAI API | OpenAI | |
| #82 | | `vertex_credentials_json` | Path to the Google Cloud credentials JSON file for VertexAI | VertexAI | |
| #83 | | `memory_add_embedding_type` | The type of embedding to use for the add memory action | VertexAI | |
| #84 | | `memory_update_embedding_type` | The type of embedding to use for the update memory action | VertexAI | |
| #85 | | `memory_search_embedding_type` | The type of embedding to use for the search memory action | VertexAI | |
| #86 | | `lmstudio_base_url` | Base URL for LM Studio API | LM Studio | |
| #87 | </Tab> |
| #88 | <Tab title="TypeScript"> |
| #89 | | Parameter | Description | Provider | |
| #90 | |-----------|-------------|----------| |
| #91 | | `model` | Embedding model to use | All | |
| #92 | | `apiKey` | API key of the provider | All | |
| #93 | | `embeddingDims` | Dimensions of the embedding model | All | |
| #94 | </Tab> |
| #95 | </Tabs> |
| #96 | |
| #97 | ## Supported Embedding Models |
| #98 | |
| #99 | For detailed information on configuring specific embedders, please visit the [Embedding Models](./models) section. There you'll find information for each supported embedder with provider-specific usage examples and configuration details. |
| #100 |