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 | [Upstash Vector](https://upstash.com/docs/vector) is a serverless vector database with built-in embedding models. |
| #2 | |
| #3 | ### Usage with Upstash embeddings |
| #4 | |
| #5 | You can enable the built-in embedding models by setting `enable_embeddings` to `True`. This allows you to use Upstash's embedding models for vectorization. |
| #6 | |
| #7 | ```python |
| #8 | import os |
| #9 | from mem0 import Memory |
| #10 | |
| #11 | os.environ["UPSTASH_VECTOR_REST_URL"] = "..." |
| #12 | os.environ["UPSTASH_VECTOR_REST_TOKEN"] = "..." |
| #13 | |
| #14 | config = { |
| #15 | "vector_store": { |
| #16 | "provider": "upstash_vector", |
| #17 | "enable_embeddings": True, |
| #18 | } |
| #19 | } |
| #20 | |
| #21 | m = Memory.from_config(config) |
| #22 | m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"}) |
| #23 | ``` |
| #24 | |
| #25 | <Note> |
| #26 | Setting `enable_embeddings` to `True` will bypass any external embedding provider you have configured. |
| #27 | </Note> |
| #28 | |
| #29 | ### Usage with external embedding providers |
| #30 | |
| #31 | ```python |
| #32 | import os |
| #33 | from mem0 import Memory |
| #34 | |
| #35 | os.environ["OPENAI_API_KEY"] = "..." |
| #36 | os.environ["UPSTASH_VECTOR_REST_URL"] = "..." |
| #37 | os.environ["UPSTASH_VECTOR_REST_TOKEN"] = "..." |
| #38 | |
| #39 | config = { |
| #40 | "vector_store": { |
| #41 | "provider": "upstash_vector", |
| #42 | }, |
| #43 | "embedder": { |
| #44 | "provider": "openai", |
| #45 | "config": { |
| #46 | "model": "text-embedding-3-large" |
| #47 | }, |
| #48 | } |
| #49 | } |
| #50 | |
| #51 | m = Memory.from_config(config) |
| #52 | m.add("Likes to play cricket on weekends", user_id="alice", metadata={"category": "hobbies"}) |
| #53 | ``` |
| #54 | |
| #55 | ### Config |
| #56 | |
| #57 | Here are the parameters available for configuring Upstash Vector: |
| #58 | |
| #59 | | Parameter | Description | Default Value | |
| #60 | | ------------------- | ---------------------------------- | ------------- | |
| #61 | | `url` | URL for the Upstash Vector index | `None` | |
| #62 | | `token` | Token for the Upstash Vector index | `None` | |
| #63 | | `client` | An `upstash_vector.Index` instance | `None` | |
| #64 | | `collection_name` | The default namespace used | `""` | |
| #65 | | `enable_embeddings` | Whether to use Upstash embeddings | `False` | |
| #66 | |
| #67 | <Note> |
| #68 | When `url` and `token` are not provided, the `UPSTASH_VECTOR_REST_URL` and |
| #69 | `UPSTASH_VECTOR_REST_TOKEN` environment variables are used. |
| #70 | </Note> |
| #71 |