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 | ## How to define configurations? |
| #6 | |
| #7 | The `config` is defined as an object with two main keys: |
| #8 | - `vector_store`: Specifies the vector database provider and its configuration |
| #9 | - `provider`: The name of the vector database (e.g., "chroma", "pgvector", "qdrant", "milvus", "upstash_vector", "azure_ai_search", "vertex_ai_vector_search", "valkey") |
| #10 | - `config`: A nested dictionary containing provider-specific settings |
| #11 | |
| #12 | |
| #13 | ## How to Use Config |
| #14 | |
| #15 | Here's a general example of how to use the config with mem0: |
| #16 | |
| #17 | <CodeGroup> |
| #18 | ```python Python |
| #19 | import os |
| #20 | from mem0 import Memory |
| #21 | |
| #22 | os.environ["OPENAI_API_KEY"] = "sk-xx" |
| #23 | |
| #24 | config = { |
| #25 | "vector_store": { |
| #26 | "provider": "your_chosen_provider", |
| #27 | "config": { |
| #28 | # Provider-specific settings go here |
| #29 | } |
| #30 | } |
| #31 | } |
| #32 | |
| #33 | m = Memory.from_config(config) |
| #34 | m.add("Your text here", user_id="user", metadata={"category": "example"}) |
| #35 | ``` |
| #36 | |
| #37 | ```typescript TypeScript |
| #38 | // Example for in-memory vector database (Only supported in TypeScript) |
| #39 | import { Memory } from 'mem0ai/oss'; |
| #40 | |
| #41 | const configMemory = { |
| #42 | vector_store: { |
| #43 | provider: 'memory', |
| #44 | config: { |
| #45 | collectionName: 'memories', |
| #46 | dimension: 1536, |
| #47 | }, |
| #48 | }, |
| #49 | }; |
| #50 | |
| #51 | const memory = new Memory(configMemory); |
| #52 | await memory.add("Your text here", { userId: "user", metadata: { category: "example" } }); |
| #53 | ``` |
| #54 | </CodeGroup> |
| #55 | |
| #56 | <Note> |
| #57 | The in-memory vector database is only supported in the TypeScript implementation. |
| #58 | </Note> |
| #59 | |
| #60 | ## Why is Config Needed? |
| #61 | |
| #62 | Config is essential for: |
| #63 | 1. Specifying which vector database to use. |
| #64 | 2. Providing necessary connection details (e.g., host, port, credentials). |
| #65 | 3. Customizing database-specific settings (e.g., collection name, path). |
| #66 | 4. Ensuring proper initialization and connection to your chosen vector store. |
| #67 | |
| #68 | ## Master List of All Params in Config |
| #69 | |
| #70 | Here's a comprehensive list of all parameters that can be used across different vector databases: |
| #71 | |
| #72 | <Tabs> |
| #73 | <Tab title="Python"> |
| #74 | | Parameter | Description | |
| #75 | |-----------|-------------| |
| #76 | | `collection_name` | Name of the collection | |
| #77 | | `embedding_model_dims` | Dimensions of the embedding model | |
| #78 | | `client` | Custom client for the database | |
| #79 | | `path` | Path for the database | |
| #80 | | `host` | Host where the server is running | |
| #81 | | `port` | Port where the server is running | |
| #82 | | `user` | Username for database connection | |
| #83 | | `password` | Password for database connection | |
| #84 | | `dbname` | Name of the database | |
| #85 | | `url` | Full URL for the server | |
| #86 | | `api_key` | API key for the server | |
| #87 | | `on_disk` | Enable persistent storage | |
| #88 | | `endpoint_id` | Endpoint ID (vertex_ai_vector_search) | |
| #89 | | `index_id` | Index ID (vertex_ai_vector_search) | |
| #90 | | `deployment_index_id` | Deployment index ID (vertex_ai_vector_search) | |
| #91 | | `project_id` | Project ID (vertex_ai_vector_search) | |
| #92 | | `project_number` | Project number (vertex_ai_vector_search) | |
| #93 | | `vector_search_api_endpoint` | Vector search API endpoint (vertex_ai_vector_search) | |
| #94 | | `connection_string` | PostgreSQL connection string (for Supabase/PGVector) | |
| #95 | | `index_method` | Vector index method (for Supabase) | |
| #96 | | `index_measure` | Distance measure for similarity search (for Supabase) | |
| #97 | </Tab> |
| #98 | <Tab title="TypeScript"> |
| #99 | | Parameter | Description | |
| #100 | |-----------|-------------| |
| #101 | | `collectionName` | Name of the collection | |
| #102 | | `embeddingModelDims` | Dimensions of the embedding model | |
| #103 | | `dimension` | Dimensions of the embedding model (for memory provider) | |
| #104 | | `host` | Host where the server is running | |
| #105 | | `port` | Port where the server is running | |
| #106 | | `url` | URL for the server | |
| #107 | | `apiKey` | API key for the server | |
| #108 | | `path` | Path for the database | |
| #109 | | `onDisk` | Enable persistent storage | |
| #110 | | `redisUrl` | URL for the Redis server | |
| #111 | | `username` | Username for database connection | |
| #112 | | `password` | Password for database connection | |
| #113 | </Tab> |
| #114 | </Tabs> |
| #115 | |
| #116 | ## Customizing Config |
| #117 | |
| #118 | Each vector database has its own specific configuration requirements. To customize the config for your chosen vector store: |
| #119 | |
| #120 | 1. Identify the vector database you want to use from [supported vector databases](./dbs). |
| #121 | 2. Refer to the `Config` section in the respective vector database's documentation. |
| #122 | 3. Include only the relevant parameters for your chosen database in the `config` dictionary. |
| #123 | |
| #124 | ## Supported Vector Databases |
| #125 | |
| #126 | For detailed information on configuring specific vector databases, please visit the [Supported Vector Databases](./dbs) section. There you'll find individual pages for each supported vector store with provider-specific usage examples and configuration details. |
| #127 |