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: Together |
| #3 | --- |
| #4 | |
| #5 | To use Together embedding models, set the `TOGETHER_API_KEY` environment variable. You can obtain the Together API key from the [Together Platform](https://api.together.xyz/settings/api-keys). |
| #6 | |
| #7 | ### Usage |
| #8 | |
| #9 | <Note> The `embedding_model_dims` parameter for `vector_store` should be set to `768` for Together embedder. </Note> |
| #10 | |
| #11 | ```python |
| #12 | import os |
| #13 | from mem0 import Memory |
| #14 | |
| #15 | os.environ["TOGETHER_API_KEY"] = "your_api_key" |
| #16 | os.environ["OPENAI_API_KEY"] = "your_api_key" # For LLM |
| #17 | |
| #18 | config = { |
| #19 | "embedder": { |
| #20 | "provider": "together", |
| #21 | "config": { |
| #22 | "model": "togethercomputer/m2-bert-80M-8k-retrieval" |
| #23 | } |
| #24 | } |
| #25 | } |
| #26 | |
| #27 | m = Memory.from_config(config) |
| #28 | messages = [ |
| #29 | {"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"}, |
| #30 | {"role": "assistant", "content": "How about thriller movies? They can be quite engaging."}, |
| #31 | {"role": "user", "content": "I’m not a big fan of thriller movies but I love sci-fi movies."}, |
| #32 | {"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."} |
| #33 | ] |
| #34 | m.add(messages, user_id="john") |
| #35 | ``` |
| #36 | |
| #37 | ### Config |
| #38 | |
| #39 | Here are the parameters available for configuring Together embedder: |
| #40 | |
| #41 | | Parameter | Description | Default Value | |
| #42 | | --- | --- | --- | |
| #43 | | `model` | The name of the embedding model to use | `togethercomputer/m2-bert-80M-8k-retrieval` | |
| #44 | | `embedding_dims` | Dimensions of the embedding model | `768` | |
| #45 | | `api_key` | The Together API key | `None` | |
| #46 |