@mastra/astra 1.1.1-alpha.0 → 1.1.1
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 +14 -31
- 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
|
@@ -16,55 +16,38 @@ import { AstraVector } from '@mastra/astra';
|
|
|
16
16
|
const vectorStore = new AstraVector({
|
|
17
17
|
token: 'your-astra-token',
|
|
18
18
|
endpoint: 'your-astra-endpoint',
|
|
19
|
-
keyspace: 'your-keyspace' // optional
|
|
19
|
+
keyspace: 'your-keyspace', // optional
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
// Create a new collection
|
|
23
|
-
await vectorStore.createIndex({ indexName: 'myCollection', dimension:
|
|
23
|
+
await vectorStore.createIndex({ indexName: 'myCollection', dimension: 3, metric: 'cosine' });
|
|
24
24
|
|
|
25
25
|
// Add vectors
|
|
26
|
-
const vectors = [
|
|
26
|
+
const vectors = [
|
|
27
|
+
[0.1, 0.2, 0.3],
|
|
28
|
+
[0.3, 0.4, 0.5],
|
|
29
|
+
];
|
|
27
30
|
const metadata = [{ text: 'doc1' }, { text: 'doc2' }];
|
|
28
31
|
const ids = await vectorStore.upsert({ indexName: 'myCollection', vectors, metadata });
|
|
29
32
|
|
|
30
33
|
// Query vectors
|
|
31
34
|
const results = await vectorStore.query({
|
|
32
35
|
indexName: 'myCollection',
|
|
33
|
-
queryVector: [0.1, 0.2,
|
|
36
|
+
queryVector: [0.1, 0.2, 0.3],
|
|
34
37
|
topK: 10, // topK
|
|
35
38
|
filter: { text: { $eq: 'doc1' } }, // optional filter
|
|
36
|
-
includeVector: false // includeVectors
|
|
39
|
+
includeVector: false, // includeVectors
|
|
37
40
|
});
|
|
38
41
|
```
|
|
39
42
|
|
|
40
|
-
##
|
|
43
|
+
## Documentation
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
- [@mastra/astra documentation](https://mastra.ai/reference/vectors/astra)
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
- `endpoint`: Your Astra DB endpoint
|
|
46
|
-
- `keyspace`: (Optional) The keyspace to use
|
|
47
|
+
## Changelog
|
|
47
48
|
|
|
48
|
-
|
|
49
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/stores/astra/CHANGELOG.md) for version history and release notes.
|
|
49
50
|
|
|
50
|
-
|
|
51
|
-
- Metadata filtering support
|
|
52
|
-
- Batch vector upsert operations
|
|
53
|
-
- Collection management (create, list, describe, delete)
|
|
54
|
-
- Optional vector inclusion in query results
|
|
55
|
-
- Automatic UUID generation for vectors
|
|
56
|
-
- Built on top of @datastax/astra-db-ts client
|
|
51
|
+
## Support
|
|
57
52
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- `createIndex({ indexName, dimension, metric? })`: Create a new collection
|
|
61
|
-
- `upsert({ indexName, vectors, metadata?, ids })`: Add or update vectors
|
|
62
|
-
- `query({ indexName, queryVector, topK?, filter?, includeVector? })`: Search for similar vectors
|
|
63
|
-
- `listIndexes()`: List all collections
|
|
64
|
-
- `describeIndex(indexName)`: Get collection statistics
|
|
65
|
-
- `deleteIndex(indexName)`: Delete a collection
|
|
66
|
-
|
|
67
|
-
## Related Links
|
|
68
|
-
|
|
69
|
-
- [Astra DB Vector Search Documentation](https://docs.datastax.com/en/astra-db/docs/vector-search.html)
|
|
70
|
-
- [Astra DB API Reference](https://docs.datastax.com/en/astra-db-serverless/api-reference/documents.html)
|
|
53
|
+
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/astra",
|
|
3
|
-
"version": "1.1.1
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Astra DB provider for Mastra - includes vector store capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"tsx": "^4.23.1",
|
|
35
35
|
"typescript": "^7.0.2",
|
|
36
36
|
"vitest": "4.1.10",
|
|
37
|
-
"@internal/lint": "0.0.
|
|
38
|
-
"@internal/types-builder": "0.0.
|
|
39
|
-
"@mastra/core": "1.64.0
|
|
37
|
+
"@internal/lint": "0.0.130",
|
|
38
|
+
"@internal/types-builder": "0.0.105",
|
|
39
|
+
"@mastra/core": "1.64.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@mastra/core": ">=1.0.0-0 <2.0.0-0"
|