@mastra/libsql 1.6.3 → 1.6.4-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/CHANGELOG.md +9 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-agents-agent-approval.md +61 -31
- package/dist/docs/references/docs-memory-semantic-recall.md +17 -1
- package/dist/docs/references/reference-core-getMemory.md +2 -2
- package/dist/docs/references/reference-core-listMemory.md +1 -1
- package/dist/docs/references/reference-core-mastra-class.md +17 -17
- package/dist/docs/references/reference-memory-memory-class.md +12 -14
- package/dist/docs/references/reference-storage-composite.md +9 -9
- package/dist/docs/references/reference-storage-dynamodb.md +9 -9
- package/dist/docs/references/reference-storage-libsql.md +2 -2
- package/dist/docs/references/reference-vectors-libsql.md +31 -31
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/experiments/index.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -71,13 +71,13 @@ const results = await store.query({
|
|
|
71
71
|
|
|
72
72
|
## Constructor Options
|
|
73
73
|
|
|
74
|
-
**url
|
|
74
|
+
**url** (`string`): libSQL database URL. Use ':memory:' for in-memory database, 'file:dbname.db' for local file, or a libSQL-compatible connection string like 'libsql://your-database.turso.io'.
|
|
75
75
|
|
|
76
|
-
**authToken
|
|
76
|
+
**authToken** (`string`): Authentication token for Turso cloud databases
|
|
77
77
|
|
|
78
|
-
**syncUrl
|
|
78
|
+
**syncUrl** (`string`): URL for database replication (Turso specific)
|
|
79
79
|
|
|
80
|
-
**syncInterval
|
|
80
|
+
**syncInterval** (`number`): Interval in milliseconds for database sync (Turso specific)
|
|
81
81
|
|
|
82
82
|
## Methods
|
|
83
83
|
|
|
@@ -85,45 +85,45 @@ const results = await store.query({
|
|
|
85
85
|
|
|
86
86
|
Creates a new vector collection. The index name must start with a letter or underscore and can only contain letters, numbers, and underscores. The dimension must be a positive integer.
|
|
87
87
|
|
|
88
|
-
**indexName
|
|
88
|
+
**indexName** (`string`): Name of the index to create
|
|
89
89
|
|
|
90
|
-
**dimension
|
|
90
|
+
**dimension** (`number`): Vector dimension size (must match your embedding model)
|
|
91
91
|
|
|
92
|
-
**metric
|
|
92
|
+
**metric** (`'cosine' | 'euclidean' | 'dotproduct'`): Distance metric for similarity search. Note: Currently only cosine similarity is supported by libSQL. (Default: `cosine`)
|
|
93
93
|
|
|
94
94
|
### upsert()
|
|
95
95
|
|
|
96
96
|
Adds or updates vectors and their metadata in the index. Uses a transaction to ensure all vectors are inserted atomically - if any insert fails, the entire operation is rolled back.
|
|
97
97
|
|
|
98
|
-
**indexName
|
|
98
|
+
**indexName** (`string`): Name of the index to insert into
|
|
99
99
|
|
|
100
|
-
**vectors
|
|
100
|
+
**vectors** (`number[][]`): Array of embedding vectors
|
|
101
101
|
|
|
102
|
-
**metadata
|
|
102
|
+
**metadata** (`Record<string, any>[]`): Metadata for each vector
|
|
103
103
|
|
|
104
|
-
**ids
|
|
104
|
+
**ids** (`string[]`): Optional vector IDs (auto-generated if not provided)
|
|
105
105
|
|
|
106
106
|
### query()
|
|
107
107
|
|
|
108
108
|
Searches for similar vectors with optional metadata filtering.
|
|
109
109
|
|
|
110
|
-
**indexName
|
|
110
|
+
**indexName** (`string`): Name of the index to search in
|
|
111
111
|
|
|
112
|
-
**queryVector
|
|
112
|
+
**queryVector** (`number[]`): Query vector to find similar vectors for
|
|
113
113
|
|
|
114
|
-
**topK
|
|
114
|
+
**topK** (`number`): Number of results to return (Default: `10`)
|
|
115
115
|
|
|
116
|
-
**filter
|
|
116
|
+
**filter** (`Filter`): Metadata filters
|
|
117
117
|
|
|
118
|
-
**includeVector
|
|
118
|
+
**includeVector** (`boolean`): Whether to include vector data in results (Default: `false`)
|
|
119
119
|
|
|
120
|
-
**minScore
|
|
120
|
+
**minScore** (`number`): Minimum similarity score threshold (Default: `0`)
|
|
121
121
|
|
|
122
122
|
### describeIndex()
|
|
123
123
|
|
|
124
124
|
Gets information about an index.
|
|
125
125
|
|
|
126
|
-
**indexName
|
|
126
|
+
**indexName** (`string`): Name of the index to describe
|
|
127
127
|
|
|
128
128
|
Returns:
|
|
129
129
|
|
|
@@ -139,7 +139,7 @@ interface IndexStats {
|
|
|
139
139
|
|
|
140
140
|
Deletes an index and all its data.
|
|
141
141
|
|
|
142
|
-
**indexName
|
|
142
|
+
**indexName** (`string`): Name of the index to delete
|
|
143
143
|
|
|
144
144
|
### listIndexes()
|
|
145
145
|
|
|
@@ -151,41 +151,41 @@ Returns: `Promise<string[]>`
|
|
|
151
151
|
|
|
152
152
|
Removes all vectors from an index while keeping the index structure.
|
|
153
153
|
|
|
154
|
-
**indexName
|
|
154
|
+
**indexName** (`string`): Name of the index to truncate
|
|
155
155
|
|
|
156
156
|
### updateVector()
|
|
157
157
|
|
|
158
158
|
Update a single vector by ID or by metadata filter. Either `id` or `filter` must be provided, but not both.
|
|
159
159
|
|
|
160
|
-
**indexName
|
|
160
|
+
**indexName** (`string`): Name of the index containing the vector
|
|
161
161
|
|
|
162
|
-
**id
|
|
162
|
+
**id** (`string`): ID of the vector entry to update (mutually exclusive with filter)
|
|
163
163
|
|
|
164
|
-
**filter
|
|
164
|
+
**filter** (`Record<string, any>`): Metadata filter to identify vector(s) to update (mutually exclusive with id)
|
|
165
165
|
|
|
166
|
-
**update
|
|
166
|
+
**update** (`object`): Update data containing vector and/or metadata
|
|
167
167
|
|
|
168
|
-
**update.vector
|
|
168
|
+
**update.vector** (`number[]`): New vector data to update
|
|
169
169
|
|
|
170
|
-
**update.metadata
|
|
170
|
+
**update.metadata** (`Record<string, any>`): New metadata to update
|
|
171
171
|
|
|
172
172
|
### deleteVector()
|
|
173
173
|
|
|
174
174
|
Deletes a specific vector entry from an index by its ID.
|
|
175
175
|
|
|
176
|
-
**indexName
|
|
176
|
+
**indexName** (`string`): Name of the index containing the vector
|
|
177
177
|
|
|
178
|
-
**id
|
|
178
|
+
**id** (`string`): ID of the vector entry to delete
|
|
179
179
|
|
|
180
180
|
### deleteVectors()
|
|
181
181
|
|
|
182
182
|
Delete multiple vectors by IDs or by metadata filter. Either `ids` or `filter` must be provided, but not both.
|
|
183
183
|
|
|
184
|
-
**indexName
|
|
184
|
+
**indexName** (`string`): Name of the index containing the vectors to delete
|
|
185
185
|
|
|
186
|
-
**ids
|
|
186
|
+
**ids** (`string[]`): Array of vector IDs to delete (mutually exclusive with filter)
|
|
187
187
|
|
|
188
|
-
**filter
|
|
188
|
+
**filter** (`Record<string, any>`): Metadata filter to identify vectors to delete (mutually exclusive with ids)
|
|
189
189
|
|
|
190
190
|
## Response Types
|
|
191
191
|
|
package/dist/index.cjs
CHANGED
|
@@ -3900,6 +3900,10 @@ var ExperimentsLibSQL = class extends storage.ExperimentsStorage {
|
|
|
3900
3900
|
updates.push("failedCount = ?");
|
|
3901
3901
|
values.push(input.failedCount);
|
|
3902
3902
|
}
|
|
3903
|
+
if (input.totalItems !== void 0) {
|
|
3904
|
+
updates.push("totalItems = ?");
|
|
3905
|
+
values.push(input.totalItems);
|
|
3906
|
+
}
|
|
3903
3907
|
if (input.startedAt !== void 0) {
|
|
3904
3908
|
updates.push("startedAt = ?");
|
|
3905
3909
|
values.push(input.startedAt?.toISOString() ?? null);
|