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 | [Cloudflare Vectorize](https://developers.cloudflare.com/vectorize/) is a vector database offering from Cloudflare, allowing you to build AI-powered applications with vector embeddings. |
| #2 | |
| #3 | ### Usage |
| #4 | |
| #5 | <CodeGroup> |
| #6 | ```typescript TypeScript |
| #7 | import { Memory } from 'mem0ai/oss'; |
| #8 | |
| #9 | const config = { |
| #10 | vectorStore: { |
| #11 | provider: 'vectorize', |
| #12 | config: { |
| #13 | indexName: 'my-memory-index', |
| #14 | accountId: 'your-cloudflare-account-id', |
| #15 | apiKey: 'your-cloudflare-api-key', |
| #16 | dimension: 1536, // Optional: defaults to 1536 |
| #17 | }, |
| #18 | }, |
| #19 | }; |
| #20 | |
| #21 | const memory = new Memory(config); |
| #22 | const messages = [ |
| #23 | {"role": "user", "content": "I'm looking for a good book to read."}, |
| #24 | {"role": "assistant", "content": "Sure, what genre are you interested in?"}, |
| #25 | {"role": "user", "content": "I enjoy fantasy novels with strong world-building."}, |
| #26 | {"role": "assistant", "content": "Great! I'll keep that in mind for future recommendations."} |
| #27 | ] |
| #28 | await memory.add(messages, { userId: "bob", metadata: { interest: "books" } }); |
| #29 | ``` |
| #30 | </CodeGroup> |
| #31 | |
| #32 | ### Config |
| #33 | |
| #34 | Here are the parameters available for configuring Vectorize: |
| #35 | |
| #36 | <Tabs> |
| #37 | <Tab title="TypeScript"> |
| #38 | | Parameter | Description | Default Value | |
| #39 | | --- | --- | --- | |
| #40 | | `indexName` | The name of the Vectorize index | `None` (Required) | |
| #41 | | `accountId` | Your Cloudflare account ID | `None` (Required) | |
| #42 | | `apiKey` | Your Cloudflare API token | `None` (Required) | |
| #43 | | `dimension` | Dimensions of the embedding model | `1536` | |
| #44 | </Tab> |
| #45 | </Tabs> |
| #46 |