@mastra/vectorize 1.1.2-alpha.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -33
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -11,64 +11,51 @@ npm install @mastra/vectorize
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import {
|
|
14
|
+
import { CloudflareVector } from '@mastra/vectorize';
|
|
15
15
|
|
|
16
|
-
const vectorStore = new
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const vectorStore = new CloudflareVector({
|
|
17
|
+
id: 'vectorize',
|
|
18
|
+
accountId: process.env.CLOUDFLARE_ACCOUNT_ID!,
|
|
19
|
+
apiToken: process.env.CLOUDFLARE_API_TOKEN!,
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
// Create a new index
|
|
22
23
|
await vectorStore.createIndex({
|
|
23
24
|
indexName: 'my-index',
|
|
24
|
-
dimension:
|
|
25
|
-
metric: 'cosine'
|
|
25
|
+
dimension: 3,
|
|
26
|
+
metric: 'cosine',
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
// Add vectors
|
|
29
|
-
const vectors = [
|
|
30
|
+
const vectors = [
|
|
31
|
+
[0.1, 0.2, 0.3],
|
|
32
|
+
[0.3, 0.4, 0.5],
|
|
33
|
+
];
|
|
30
34
|
const metadata = [{ text: 'doc1' }, { text: 'doc2' }];
|
|
31
35
|
const ids = await vectorStore.upsert({
|
|
32
36
|
indexName: 'my-index',
|
|
33
37
|
vectors,
|
|
34
|
-
metadata
|
|
38
|
+
metadata,
|
|
35
39
|
});
|
|
36
40
|
|
|
37
41
|
// Query vectors
|
|
38
42
|
const results = await vectorStore.query({
|
|
39
43
|
indexName: 'my-index',
|
|
40
|
-
queryVector: [0.1, 0.2,
|
|
44
|
+
queryVector: [0.1, 0.2, 0.3],
|
|
41
45
|
topK: 10,
|
|
42
46
|
filter: { text: { $eq: 'doc1' } },
|
|
43
|
-
includeVector: false
|
|
47
|
+
includeVector: false,
|
|
44
48
|
});
|
|
45
49
|
```
|
|
46
50
|
|
|
47
|
-
##
|
|
51
|
+
## Documentation
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
- [@mastra/vectorize documentation](https://mastra.ai/reference/vectors/vectorize)
|
|
50
54
|
|
|
51
|
-
|
|
52
|
-
- `VECTORIZE_INDEX_NAME`: Name of the index to use
|
|
53
|
-
- `VECTORIZE_PROJECT_ID`: Your Vectorize project ID
|
|
55
|
+
## Changelog
|
|
54
56
|
|
|
55
|
-
|
|
57
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/stores/vectorize/CHANGELOG.md) for version history and release notes.
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
- High-performance vector similarity search
|
|
59
|
-
- Automatic index optimization
|
|
60
|
-
- Scalable architecture
|
|
61
|
-
- Real-time updates and queries
|
|
59
|
+
## Support
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- `createIndex({ indexName, dimension, metric? })`: Create a new index
|
|
66
|
-
- `upsert({ indexName, vectors, metadata?, ids? })`: Add or update vectors
|
|
67
|
-
- `query({ indexName, queryVector, topK?, filter?, includeVector? })`: Search for similar vectors
|
|
68
|
-
- `listIndexes()`: List all indexes
|
|
69
|
-
- `describeIndex(indexName)`: Get index statistics
|
|
70
|
-
- `deleteIndex(indexName)`: Delete an index
|
|
71
|
-
|
|
72
|
-
## Related Links
|
|
73
|
-
|
|
74
|
-
- [Vectorize Documentation](https://www.vectorize.com/docs)
|
|
61
|
+
We have an [open community Discord](https://discord.gg/mastra-ai). Come and say hello and let us know if you have any questions or need any help getting things running.
|
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-vectorize
|
|
|
3
3
|
description: Documentation for @mastra/vectorize. Use when working with @mastra/vectorize APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/vectorize"
|
|
6
|
-
version: "1.1.2
|
|
6
|
+
version: "1.1.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/vectorize",
|
|
3
|
-
"version": "1.1.2
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Cloudflare Vectorize store provider for Mastra",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"tsx": "^4.23.1",
|
|
36
36
|
"typescript": "^7.0.2",
|
|
37
37
|
"vitest": "4.1.10",
|
|
38
|
-
"@internal/lint": "0.0.
|
|
39
|
-
"@internal/types-builder": "0.0.
|
|
40
|
-
"@mastra/core": "1.64.0
|
|
38
|
+
"@internal/lint": "0.0.130",
|
|
39
|
+
"@internal/types-builder": "0.0.105",
|
|
40
|
+
"@mastra/core": "1.64.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@mastra/core": ">=1.0.0-0 <2.0.0-0"
|