@mastra/libsql 0.0.0-knowledge-w1-20261007232522 → 0.0.0-knowledge-w2-20261008040304
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/docs-agents-human-in-the-loop.md +3 -3
- package/dist/docs/references/docs-memory-memory-processors.md +2 -5
- package/dist/docs/references/docs-memory-semantic-recall.md +2 -2
- package/dist/docs/references/reference-memory-memory-class.md +2 -2
- package/dist/index.cjs +1649 -1073
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1650 -1074
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/knowledge/index.d.ts +115 -32
- package/dist/storage/domains/knowledge/index.d.ts.map +1 -1
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/vector/write-lock.d.ts +25 -0
- package/dist/vector/write-lock.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/_types/@internal_core/dist/knowledge-compat/index.d.ts +0 -554
- package/dist/_types/@internal_core/package.json +0 -1
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-libsql
|
|
|
3
3
|
description: Documentation for @mastra/libsql. Use when working with @mastra/libsql APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/libsql"
|
|
6
|
-
version: "0.0.0-knowledge-
|
|
6
|
+
version: "0.0.0-knowledge-w2-20261008040304"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -125,7 +125,7 @@ import { agent } from './agent'
|
|
|
125
125
|
|
|
126
126
|
const approvalClassifier = new Classifier({
|
|
127
127
|
id: 'tool-approval-classifier',
|
|
128
|
-
model: typeSafeAi.
|
|
128
|
+
model: typeSafeAi.decisionModel('jev-latest'),
|
|
129
129
|
questions: {
|
|
130
130
|
requiresApproval: {
|
|
131
131
|
type: 'boolean',
|
|
@@ -137,7 +137,7 @@ const approvalClassifier = new Classifier({
|
|
|
137
137
|
|
|
138
138
|
const stream = await agent.stream('Clean up old records', {
|
|
139
139
|
requireToolApproval: async ({ toolName, args }) => {
|
|
140
|
-
const result = await approvalClassifier.
|
|
140
|
+
const result = await approvalClassifier.decide({
|
|
141
141
|
state: {
|
|
142
142
|
toolName,
|
|
143
143
|
argumentNames: Object.keys(args),
|
|
@@ -149,7 +149,7 @@ const stream = await agent.stream('Clean up old records', {
|
|
|
149
149
|
})
|
|
150
150
|
```
|
|
151
151
|
|
|
152
|
-
The example sends argument names rather than values because the classifier forwards its state to the configured
|
|
152
|
+
The example sends argument names rather than values because the classifier forwards its state to the configured decision model. If the decision requires argument values, redact sensitive data first or use a decision model and provider that meet the protected tool's data-handling requirements.
|
|
153
153
|
|
|
154
154
|
Returning `true` pauses the tool call for human approval. It doesn't approve or decline the call automatically. Choose a threshold that matches the risk of the tools available to the agent. If this `requireToolApproval` function throws, it defaults to requiring approval.
|
|
155
155
|
|
|
@@ -99,7 +99,7 @@ import { Agent } from '@mastra/core/agent'
|
|
|
99
99
|
import { Memory } from '@mastra/memory'
|
|
100
100
|
import { LibSQLStore } from '@mastra/libsql'
|
|
101
101
|
import { PineconeVector } from '@mastra/pinecone'
|
|
102
|
-
import {
|
|
102
|
+
import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
|
|
103
103
|
import { openai } from '@ai-sdk/openai'
|
|
104
104
|
|
|
105
105
|
const agent = new Agent({
|
|
@@ -115,10 +115,7 @@ const agent = new Agent({
|
|
|
115
115
|
id: 'memory-vector',
|
|
116
116
|
apiKey: process.env.PINECONE_API_KEY!,
|
|
117
117
|
}),
|
|
118
|
-
embedder: new
|
|
119
|
-
model: 'text-embedding-3-small',
|
|
120
|
-
apiKey: process.env.OPENAI_API_KEY!,
|
|
121
|
-
}),
|
|
118
|
+
embedder: new ModelRouterEmbeddingModel('openai/text-embedding-3-small'),
|
|
122
119
|
semanticRecall: { enabled: true }, // SemanticRecall processor automatically added
|
|
123
120
|
}),
|
|
124
121
|
})
|
|
@@ -411,11 +411,11 @@ PostgreSQL supports both IVFFlat and HNSW indexes. By default, Mastra creates an
|
|
|
411
411
|
|
|
412
412
|
```typescript
|
|
413
413
|
import { Memory } from '@mastra/memory'
|
|
414
|
-
import {
|
|
414
|
+
import { PostgresStore, PgVector } from '@mastra/pg'
|
|
415
415
|
|
|
416
416
|
const agent = new Agent({
|
|
417
417
|
memory: new Memory({
|
|
418
|
-
storage: new
|
|
418
|
+
storage: new PostgresStore({
|
|
419
419
|
id: 'agent-storage',
|
|
420
420
|
connectionString: process.env.DATABASE_URL,
|
|
421
421
|
}),
|
|
@@ -101,14 +101,14 @@ export const agent = new Agent({
|
|
|
101
101
|
import { Memory } from '@mastra/memory'
|
|
102
102
|
import { Agent } from '@mastra/core/agent'
|
|
103
103
|
import { ModelRouterEmbeddingModel } from '@mastra/core/llm'
|
|
104
|
-
import {
|
|
104
|
+
import { PostgresStore, PgVector } from '@mastra/pg'
|
|
105
105
|
|
|
106
106
|
export const agent = new Agent({
|
|
107
107
|
name: 'pg-agent',
|
|
108
108
|
instructions: 'You are an agent with optimized PostgreSQL memory.',
|
|
109
109
|
model: 'openai/gpt-5.6-sol',
|
|
110
110
|
memory: new Memory({
|
|
111
|
-
storage: new
|
|
111
|
+
storage: new PostgresStore({
|
|
112
112
|
id: 'pg-agent-storage',
|
|
113
113
|
connectionString: process.env.DATABASE_URL,
|
|
114
114
|
}),
|