@mastra/turbopuffer 1.2.1-alpha.0 → 1.2.1-alpha.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 +3 -3
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Vector store implementation for Turbopuffer, using the official @turbopuffer/tur
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
npm install @mastra/turbopuffer
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -20,51 +20,34 @@ const vectorStore = new TurbopufferVector({
|
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
// Create a new index
|
|
23
|
-
await vectorStore.createIndex({ indexName: 'my-index', dimension:
|
|
23
|
+
await vectorStore.createIndex({ indexName: 'my-index', 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: 'my-index', vectors, metadata });
|
|
29
32
|
|
|
30
33
|
// Query vectors
|
|
31
34
|
const results = await vectorStore.query({
|
|
32
35
|
indexName: 'my-index',
|
|
33
|
-
queryVector: [0.1, 0.2,
|
|
36
|
+
queryVector: [0.1, 0.2, 0.3],
|
|
34
37
|
topK: 10,
|
|
35
38
|
filter: { text: { $eq: 'doc1' } },
|
|
36
39
|
includeVector: false,
|
|
37
|
-
);
|
|
40
|
+
});
|
|
38
41
|
```
|
|
39
42
|
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
Required:
|
|
43
|
-
|
|
44
|
-
- `apiKey`: Your Turbopuffer API key
|
|
45
|
-
|
|
46
|
-
Optional:
|
|
43
|
+
## Documentation
|
|
47
44
|
|
|
48
|
-
-
|
|
49
|
-
- `connectTimeout`: Timeout to establish a connection, in ms (default: 10_000)
|
|
50
|
-
- `connectionIdleTimeout`: Socket idle timeout, in ms (default: 60_000)
|
|
51
|
-
- `warmConnections`: Number of connections to open initially (default: 0)
|
|
52
|
-
- `compression`: Whether to compress requests and accept compressed responses (default: true)
|
|
53
|
-
- `schemaConfigForIndex`: A function that returns a Turbopuffer schema config for an index (default: undefined).
|
|
45
|
+
- [@mastra/turbopuffer documentation](https://mastra.ai/reference/vectors/turbopuffer)
|
|
54
46
|
|
|
55
|
-
##
|
|
47
|
+
## Changelog
|
|
56
48
|
|
|
57
|
-
|
|
58
|
-
- `upsert({ indexName, vectors, metadata?, ids? })`: Add or update vectors
|
|
59
|
-
- `query({ indexName, queryVector, topK?, filter?, includeVector? })`: Search for similar vectors
|
|
60
|
-
- `updateVector({ indexName, id?, filter?, update })`: Update a single vector by ID or metadata filter
|
|
61
|
-
- `deleteVector({ indexName, id })`: Delete a single vector by ID
|
|
62
|
-
- `deleteVectors({ indexName, ids?, filter? })`: Delete multiple vectors by IDs or metadata filter
|
|
63
|
-
- `listIndexes()`: List all namespaces
|
|
64
|
-
- `describeIndex({ indexName })`: Get namespace statistics
|
|
65
|
-
- `deleteIndex({ indexName })`: Delete a namespace
|
|
49
|
+
See the [package changelog](https://github.com/mastra-ai/mastra/blob/main/stores/turbopuffer/CHANGELOG.md) for version history and release notes.
|
|
66
50
|
|
|
67
|
-
##
|
|
51
|
+
## Support
|
|
68
52
|
|
|
69
|
-
|
|
70
|
-
- [Turbopuffer TypeScript Client Library](https://github.com/turbopuffer/turbopuffer-typescript)
|
|
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
|
@@ -3,7 +3,7 @@ name: mastra-turbopuffer
|
|
|
3
3
|
description: Documentation for @mastra/turbopuffer. Use when working with @mastra/turbopuffer APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/turbopuffer"
|
|
6
|
-
version: "1.2.1-alpha.
|
|
6
|
+
version: "1.2.1-alpha.1"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/turbopuffer",
|
|
3
|
-
"version": "1.2.1-alpha.
|
|
3
|
+
"version": "1.2.1-alpha.1",
|
|
4
4
|
"description": "Turbopuffer vector store provider for Mastra",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"typescript": "^7.0.2",
|
|
37
37
|
"vitest": "4.1.10",
|
|
38
38
|
"@internal/lint": "0.0.129",
|
|
39
|
-
"@internal/storage-test-utils": "0.0.125",
|
|
40
39
|
"@internal/types-builder": "0.0.104",
|
|
41
|
-
"@
|
|
40
|
+
"@internal/storage-test-utils": "0.0.125",
|
|
41
|
+
"@mastra/core": "1.64.0-alpha.7"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@mastra/core": ">=1.0.0-0 <2.0.0-0"
|