@mastra/qdrant 1.1.4 → 1.1.5-alpha.0
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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-rag-retrieval.md +7 -5
- package/dist/docs/references/reference-rag-vector-databases.md +1 -1
- package/dist/docs/references/reference-vectors-qdrant.md +8 -4
- package/package.json +5 -5
package/dist/docs/SKILL.md
CHANGED
|
@@ -50,23 +50,25 @@ console.log(results)
|
|
|
50
50
|
|
|
51
51
|
The `topK` parameter specifies the maximum number of most similar results to return from the vector search.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Each result includes an `id`, a similarity `score`, and the stored `metadata`. When you store chunk text in metadata, it's available as `metadata.text`:
|
|
54
54
|
|
|
55
55
|
```ts
|
|
56
56
|
[
|
|
57
57
|
{
|
|
58
|
-
|
|
58
|
+
id: 'chunk-1',
|
|
59
59
|
score: 0.89,
|
|
60
|
-
metadata: { source: 'article1.txt' },
|
|
60
|
+
metadata: { text: 'Climate change poses significant challenges...', source: 'article1.txt' },
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
|
|
63
|
+
id: 'chunk-2',
|
|
64
64
|
score: 0.82,
|
|
65
|
-
metadata: { source: 'article1.txt' },
|
|
65
|
+
metadata: { text: 'Rising temperatures affect crop yields...', source: 'article1.txt' },
|
|
66
66
|
},
|
|
67
67
|
]
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
Results can also include `vector` when you set `includeVector: true`, and `document` when the store returns the original document (Chroma only).
|
|
71
|
+
|
|
70
72
|
## Advanced retrieval options
|
|
71
73
|
|
|
72
74
|
### Metadata Filtering
|
|
@@ -198,24 +198,28 @@ Query results are returned in this format:
|
|
|
198
198
|
interface QueryResult {
|
|
199
199
|
id: string
|
|
200
200
|
score: number
|
|
201
|
-
metadata
|
|
201
|
+
metadata?: Record<string, any>
|
|
202
202
|
vector?: number[] // Only included if includeVector is true
|
|
203
203
|
}
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
## Error handling
|
|
207
207
|
|
|
208
|
-
The store throws
|
|
208
|
+
The store throws `MastraError` instances from `@mastra/core/error`:
|
|
209
209
|
|
|
210
210
|
```typescript
|
|
211
|
+
import { MastraError } from '@mastra/core/error'
|
|
212
|
+
|
|
211
213
|
try {
|
|
212
214
|
await store.query({
|
|
213
215
|
indexName: 'index_name',
|
|
214
216
|
queryVector: queryVector,
|
|
215
217
|
})
|
|
216
218
|
} catch (error) {
|
|
217
|
-
if (error instanceof
|
|
218
|
-
console.log(error.
|
|
219
|
+
if (error instanceof MastraError) {
|
|
220
|
+
console.log(error.id) // 'MASTRA_VECTOR_QDRANT_QUERY_FAILED'
|
|
221
|
+
console.log(error.domain) // 'STORAGE'
|
|
222
|
+
console.log(error.category) // 'USER' | 'THIRD_PARTY'
|
|
219
223
|
console.log(error.details) // Additional error context
|
|
220
224
|
}
|
|
221
225
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/qdrant",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5-alpha.0",
|
|
4
4
|
"description": "Qdrant vector store provider for Mastra",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"tsx": "^4.23.1",
|
|
32
32
|
"typescript": "^7.0.2",
|
|
33
33
|
"vitest": "4.1.11",
|
|
34
|
-
"@internal/
|
|
35
|
-
"@internal/
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
34
|
+
"@internal/lint": "0.0.144",
|
|
35
|
+
"@internal/storage-test-utils": "0.0.140",
|
|
36
|
+
"@mastra/core": "1.78.1-alpha.0",
|
|
37
|
+
"@internal/types-builder": "0.0.119"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"@mastra/core": ">=1.0.0-0 <2.0.0-0"
|