@mastra/astra 1.0.0 → 1.0.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/CHANGELOG.md +18 -0
- package/dist/docs/SKILL.md +15 -21
- package/dist/docs/{SOURCE_MAP.json → assets/SOURCE_MAP.json} +1 -1
- package/dist/docs/{rag/02-retrieval.md → references/docs-rag-retrieval.md} +155 -188
- package/dist/docs/references/docs-rag-vector-databases.md +645 -0
- package/dist/docs/references/reference-vectors-astra.md +121 -0
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/vector/index.d.ts.map +1 -1
- package/package.json +9 -10
- package/dist/docs/README.md +0 -32
- package/dist/docs/rag/01-vector-databases.md +0 -643
- package/dist/docs/vectors/01-reference.md +0 -87
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# Vectors API Reference
|
|
2
|
-
|
|
3
|
-
> API reference for vectors - 1 entries
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Reference: Astra Vector Store
|
|
9
|
-
|
|
10
|
-
> Documentation for the AstraVector class in Mastra, which provides vector search using DataStax Astra DB.
|
|
11
|
-
|
|
12
|
-
The AstraVector class provides vector search using [DataStax Astra DB](https://www.datastax.com/products/datastax-astra), a cloud-native, serverless database built on Apache Cassandra.
|
|
13
|
-
It provides vector search capabilities with enterprise-grade scalability and high availability.
|
|
14
|
-
|
|
15
|
-
## Constructor Options
|
|
16
|
-
|
|
17
|
-
## Methods
|
|
18
|
-
|
|
19
|
-
### createIndex()
|
|
20
|
-
|
|
21
|
-
### upsert()
|
|
22
|
-
|
|
23
|
-
### query()
|
|
24
|
-
|
|
25
|
-
### listIndexes()
|
|
26
|
-
|
|
27
|
-
Returns an array of index names as strings.
|
|
28
|
-
|
|
29
|
-
### describeIndex()
|
|
30
|
-
|
|
31
|
-
Returns:
|
|
32
|
-
|
|
33
|
-
```typescript
|
|
34
|
-
interface IndexStats {
|
|
35
|
-
dimension: number;
|
|
36
|
-
count: number;
|
|
37
|
-
metric: "cosine" | "euclidean" | "dotproduct";
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### deleteIndex()
|
|
42
|
-
|
|
43
|
-
### updateVector()
|
|
44
|
-
|
|
45
|
-
### deleteVector()
|
|
46
|
-
|
|
47
|
-
## Response Types
|
|
48
|
-
|
|
49
|
-
Query results are returned in this format:
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
interface QueryResult {
|
|
53
|
-
id: string;
|
|
54
|
-
score: number;
|
|
55
|
-
metadata: Record<string, any>;
|
|
56
|
-
vector?: number[]; // Only included if includeVector is true
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
## Error Handling
|
|
61
|
-
|
|
62
|
-
The store throws typed errors that can be caught:
|
|
63
|
-
|
|
64
|
-
```typescript
|
|
65
|
-
try {
|
|
66
|
-
await store.query({
|
|
67
|
-
indexName: "index_name",
|
|
68
|
-
queryVector: queryVector,
|
|
69
|
-
});
|
|
70
|
-
} catch (error) {
|
|
71
|
-
if (error instanceof VectorStoreError) {
|
|
72
|
-
console.log(error.code); // 'connection_failed' | 'invalid_dimension' | etc
|
|
73
|
-
console.log(error.details); // Additional error context
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Environment Variables
|
|
79
|
-
|
|
80
|
-
Required environment variables:
|
|
81
|
-
|
|
82
|
-
- `ASTRA_DB_TOKEN`: Your Astra DB API token
|
|
83
|
-
- `ASTRA_DB_ENDPOINT`: Your Astra DB API endpoint
|
|
84
|
-
|
|
85
|
-
## Related
|
|
86
|
-
|
|
87
|
-
- [Metadata Filters](../rag/metadata-filters)
|