@mastra/libsql 0.0.0-knowledge-studio-20261029065150 → 0.0.0-knowledge-alpha-studio-20261030162625
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/_types/@internal_core/dist/knowledge-compat/index.d.ts +306 -183
- package/dist/_types/@internal_core/dist/memory/index.d.ts +0 -2
- 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 +10 -1
- package/dist/docs/references/docs-memory-memory-processors.md +49 -3
- package/dist/docs/references/docs-memory-message-history.md +3 -0
- package/dist/docs/references/docs-memory-overview.md +6 -0
- package/dist/docs/references/docs-memory-semantic-recall.md +9 -3
- package/dist/docs/references/integrations-databases-dynamodb.md +4 -4
- package/dist/docs/references/reference-core-mastra-class.md +7 -3
- package/dist/docs/references/reference-memory-memory-class.md +87 -8
- package/dist/docs/references/reference-rag-retrieval.md +11 -0
- package/dist/index.cjs +1521 -3071
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1522 -3072
- package/dist/index.js.map +1 -1
- package/dist/storage/db/index.d.ts +12 -0
- package/dist/storage/db/index.d.ts.map +1 -1
- package/dist/storage/domains/background-tasks/index.d.ts +1 -0
- package/dist/storage/domains/background-tasks/index.d.ts.map +1 -1
- package/dist/storage/domains/knowledge/index.d.ts +33 -193
- package/dist/storage/domains/knowledge/index.d.ts.map +1 -1
- package/dist/storage/domains/knowledge/pages.d.ts +148 -0
- package/dist/storage/domains/knowledge/pages.d.ts.map +1 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/dist/storage/domains/observability/index.d.ts +2 -1
- package/dist/storage/domains/observability/index.d.ts.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts +9 -3
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/dist/vector/sql-builder.d.ts.map +1 -1
- package/package.json +11 -11
- package/dist/storage/domains/knowledge/fixtures/generate-snapshot-dbs.d.mts +0 -2
- package/dist/storage/domains/knowledge/fixtures/generate-snapshot-dbs.d.mts.map +0 -1
|
@@ -164,6 +164,9 @@ const response = await memoryAgent.generate('Remember my favorite color is blue.
|
|
|
164
164
|
Scopes can also come from the agent and from the request context. Mastra combines all three sources:
|
|
165
165
|
|
|
166
166
|
```typescript
|
|
167
|
+
import { Agent } from '@mastra/core/agent'
|
|
168
|
+
import { Memory } from '@mastra/memory'
|
|
169
|
+
|
|
167
170
|
export const memoryAgent = new Agent({
|
|
168
171
|
id: 'memory-agent',
|
|
169
172
|
name: 'Memory Agent',
|
|
@@ -271,6 +274,9 @@ Open [Studio](https://mastra.ai/docs/studio/overview) and select the **Observabi
|
|
|
271
274
|
Use [`RequestContext`](https://mastra.ai/docs/server/request-context) to access request-specific values. This lets you conditionally select different memory or storage configurations based on the context of the request.
|
|
272
275
|
|
|
273
276
|
```typescript
|
|
277
|
+
import { Agent } from '@mastra/core/agent'
|
|
278
|
+
import { Memory } from '@mastra/memory'
|
|
279
|
+
|
|
274
280
|
export type UserTier = {
|
|
275
281
|
'user-tier': 'enterprise' | 'pro'
|
|
276
282
|
}
|
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
# Semantic recall
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Semantic recall is a built-in form of Retrieval-Augmented Generation (RAG) for agent memory. When a user sends a message, Mastra searches earlier messages for ones with a similar meaning and adds the most relevant ones to the agent's context.
|
|
8
|
+
|
|
9
|
+
Matching on meaning matters because people often remember the idea behind something, not the exact words they used. A user might ask "What did we decide about the refund?" after originally writing "Let's give them their money back." A keyword search misses that connection, but semantic recall finds it.
|
|
10
|
+
|
|
11
|
+
Use semantic recall when your agent needs details from earlier in a long conversation, or from a user's other conversations, that are no longer in [recent message history](https://mastra.ai/docs/memory/message-history).
|
|
8
12
|
|
|
9
13
|
> **📹 Watch:** Watch [Mastra semantic recall](https://www.youtube.com/watch?v=UVZtK8cK8xQ\&pp=ygUVbWFzdHJhIHdvcmtpbmcgbWVtb3J5) to see how agents retrieve relevant messages from past conversations.
|
|
10
14
|
|
|
@@ -452,8 +456,10 @@ const agent = new Agent({
|
|
|
452
456
|
indexConfig: {
|
|
453
457
|
type: 'hnsw', // Use HNSW for better performance
|
|
454
458
|
metric: 'dotproduct', // Best for OpenAI embeddings
|
|
455
|
-
|
|
456
|
-
|
|
459
|
+
hnsw: {
|
|
460
|
+
m: 16, // Number of bi-directional links (default: 16)
|
|
461
|
+
efConstruction: 64, // Size of candidate list during construction (default: 64)
|
|
462
|
+
},
|
|
457
463
|
},
|
|
458
464
|
},
|
|
459
465
|
},
|
|
@@ -50,7 +50,7 @@ bun add @mastra/dynamodb@latest
|
|
|
50
50
|
|
|
51
51
|
Before using this package, you **must** create a DynamoDB table with a specific structure, including primary keys and Global Secondary Indexes (GSIs). This adapter expects the DynamoDB table and its GSIs to be provisioned externally.
|
|
52
52
|
|
|
53
|
-
Detailed instructions for setting up the table using AWS CloudFormation or AWS CDK are available in [
|
|
53
|
+
Detailed instructions for setting up the table using AWS CloudFormation or AWS CDK are available in [TABLE_SETUP.md](https://github.com/mastra-ai/mastra/blob/main/stores/dynamodb/TABLE_SETUP.md). Please ensure your table is configured according to those instructions before proceeding.
|
|
54
54
|
|
|
55
55
|
## Usage
|
|
56
56
|
|
|
@@ -122,7 +122,7 @@ For local development, you can use [DynamoDB Local](https://docs.aws.amazon.com/
|
|
|
122
122
|
|
|
123
123
|
**config.credentials** (`object`): AWS credentials object with accessKeyId and secretAccessKey. If not provided, the AWS SDK will attempt to source credentials from environment variables, IAM roles (e.g., for EC2/Lambda), or the shared AWS credentials file.
|
|
124
124
|
|
|
125
|
-
**config.ttl** (`object`): TTL (Time To Live) configuration for automatic data expiration. Configure per entity type: thread, message, trace, eval,
|
|
125
|
+
**config.ttl** (`object`): TTL (Time To Live) configuration for automatic data expiration. Configure per entity type: thread, message, trace, eval, workflow_snapshot, resource, score. Each entity config includes: enabled (boolean), attributeName (string, default: 'ttl'), defaultTtlSeconds (number).
|
|
126
126
|
|
|
127
127
|
## TTL (time to live) configuration
|
|
128
128
|
|
|
@@ -254,7 +254,7 @@ The IAM role or user executing the code needs appropriate permissions to interac
|
|
|
254
254
|
|
|
255
255
|
Before diving into the architectural details, keep these key points in mind when working with the DynamoDB storage adapter:
|
|
256
256
|
|
|
257
|
-
- **External Table Provisioning:** This adapter _requires_ you to create and configure the DynamoDB table and its Global Secondary Indexes (GSIs) yourself, prior to using the adapter. Follow the guide in [
|
|
257
|
+
- **External Table Provisioning:** This adapter _requires_ you to create and configure the DynamoDB table and its Global Secondary Indexes (GSIs) yourself, prior to using the adapter. Follow the guide in [TABLE_SETUP.md](https://github.com/mastra-ai/mastra/blob/main/stores/dynamodb/TABLE_SETUP.md).
|
|
258
258
|
- **Single-Table Design:** All Mastra data (threads, messages, etc.) is stored in one DynamoDB table. This is a deliberate design choice optimized for DynamoDB, differing from relational database approaches.
|
|
259
259
|
- **Understanding GSIs:** Familiarity with how the GSIs are structured (as per `TABLE_SETUP.md`) is important for understanding data retrieval and potential query patterns.
|
|
260
260
|
- **ElectroDB:** The adapter uses ElectroDB to manage interactions with DynamoDB, providing a layer of abstraction and type safety over raw DynamoDB operations.
|
|
@@ -266,7 +266,7 @@ This storage adapter utilizes a **single-table design pattern** with [ElectroDB]
|
|
|
266
266
|
Key aspects of this approach:
|
|
267
267
|
|
|
268
268
|
- **DynamoDB Native:** The single-table design is optimized for DynamoDB's key-value and query capabilities, often leading to better performance and capacity compared to mimicking relational models.
|
|
269
|
-
- **External Table Management:** Unlike some adapters that might offer helper functions to create tables via code, this adapter **expects the DynamoDB table and its associated Global Secondary Indexes (GSIs) to be provisioned externally** before use. Please refer to [
|
|
269
|
+
- **External Table Management:** Unlike some adapters that might offer helper functions to create tables via code, this adapter **expects the DynamoDB table and its associated Global Secondary Indexes (GSIs) to be provisioned externally** before use. Please refer to [TABLE_SETUP.md](https://github.com/mastra-ai/mastra/blob/main/stores/dynamodb/TABLE_SETUP.md) for detailed instructions using tools like AWS CloudFormation or CDK. The adapter focuses solely on interacting with the pre-existing table structure.
|
|
270
270
|
- **Consistency via Interface:** While the underlying storage model differs, this adapter adheres to the same `MastraStorage` interface as other adapters, ensuring it can be used interchangeably within the Mastra `Memory` component.
|
|
271
271
|
|
|
272
272
|
### Mastra Data in the Single Table
|
|
@@ -34,6 +34,8 @@ export const mastra = new Mastra({
|
|
|
34
34
|
Enable scheduled notification dispatch when deferred notification records and notification summaries should be delivered automatically through the workflow scheduler:
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
|
+
import { Mastra } from '@mastra/core'
|
|
38
|
+
|
|
37
39
|
export const mastra = new Mastra({
|
|
38
40
|
agents: { supportAgent },
|
|
39
41
|
storage,
|
|
@@ -63,7 +65,7 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
63
65
|
|
|
64
66
|
**logger** (`Logger`): Logger instance created with new PinoLogger() (Default: `Console logger with INFO level`)
|
|
65
67
|
|
|
66
|
-
**loggerOptions** (`{ correlation?: boolean; export?: boolean }`): Controls logger observability behavior. correlation injects
|
|
68
|
+
**loggerOptions** (`{ correlation?: boolean; export?: boolean }`): Controls logger observability behavior. correlation injects trace_id/span_id into native log output during traced operations; export forwards log records to observability storage. (Default: `{ correlation: true, export: true }`)
|
|
67
69
|
|
|
68
70
|
**idGenerator** (`(context?: IdGeneratorContext) => string`): Custom ID generator function. Used by agents, workflows, memory, and other components to generate unique identifiers. Receives optional context such as idType, source, entityId, and threadId to support context-aware ID formats.
|
|
69
71
|
|
|
@@ -73,9 +75,9 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
73
75
|
|
|
74
76
|
**observability** (`ObservabilityEntrypoint`): Observability configuration for tracing and monitoring
|
|
75
77
|
|
|
76
|
-
**environment** (`string`): Deployment environment name (e.g. production, staging, development). When set, automatically attached to all observability signals so they can be filtered by environment without passing tracingOptions.metadata.environment on each call. When unset, resolves to development for mastra dev runs, then falls back to process.env.
|
|
78
|
+
**environment** (`string`): Deployment environment name (e.g. production, staging, development). When set, automatically attached to all observability signals so they can be filtered by environment without passing tracingOptions.metadata.environment on each call. When unset, resolves to development for mastra dev runs, then falls back to process.env.NODE_ENV; left undefined if none are set. Per-call tracingOptions.metadata.environment always takes precedence.
|
|
77
79
|
|
|
78
|
-
**deployer** (`
|
|
80
|
+
**deployer** (`IDeployer`): A deployer for managing deployments, such as VercelDeployer from @mastra/deployer-vercel.
|
|
79
81
|
|
|
80
82
|
**server** (`ServerConfig`): Server configuration including port, host, timeout, API routes, middleware, CORS settings, and build options for Swagger UI, API request logging, and OpenAPI docs.
|
|
81
83
|
|
|
@@ -121,6 +123,8 @@ Visit the [Configuration reference](https://mastra.ai/reference/configuration) f
|
|
|
121
123
|
|
|
122
124
|
**backgroundTasks.perAgentConcurrency** (`number`): Max concurrent tasks per agent.
|
|
123
125
|
|
|
126
|
+
**backgroundTasks.perOwnerConcurrency** (`Record<string, number>`): Per-owner overrides of perAgentConcurrency, keyed by agentId. Overridden owners still count toward globalConcurrency.
|
|
127
|
+
|
|
124
128
|
**backgroundTasks.backpressure** (`'queue' | 'reject' | 'fallback-sync'`): Behavior when concurrency limit is reached.
|
|
125
129
|
|
|
126
130
|
**backgroundTasks.defaultTimeoutMs** (`number`): Default task timeout in milliseconds.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
# Memory class
|
|
6
6
|
|
|
7
|
-
The `Memory` class provides a reliable system for managing conversation history and thread-based message storage in Mastra. It enables persistent storage of conversations, semantic search capabilities, and efficient message retrieval. You must configure a storage provider for conversation history, and if you enable semantic recall you will also need to provide a vector store and embedder.
|
|
7
|
+
The `Memory` class provides a reliable system for managing conversation history and thread-based message storage in Mastra. It enables persistent storage of conversations, semantic search capabilities, and efficient message retrieval. You must configure a storage provider for conversation history, and if you enable semantic recall you will also need to provide a vector store and, unless that vector store embeds text itself, an embedder.
|
|
8
8
|
|
|
9
9
|
## Usage example
|
|
10
10
|
|
|
@@ -31,17 +31,17 @@ export const agent = new Agent({
|
|
|
31
31
|
|
|
32
32
|
## Constructor parameters
|
|
33
33
|
|
|
34
|
-
**storage** (`MastraCompositeStore`): Storage implementation for persisting memory data.
|
|
34
|
+
**storage** (`MastraCompositeStore`): Storage implementation for persisting memory data. Optional: when omitted, an agent uses the storage of the Mastra instance it belongs to. If neither is configured, accessing memory.storage throws Memory requires a storage provider to function.
|
|
35
35
|
|
|
36
36
|
**vector** (`MastraVector | false`): Vector store for semantic search capabilities. Set to false to disable vector operations.
|
|
37
37
|
|
|
38
|
-
**embedder** (`EmbeddingModel<string> | EmbeddingModelV2<string>`): Embedder
|
|
38
|
+
**embedder** (`string | EmbeddingModel<string> | EmbeddingModelV2<string>`): Embedder for vector embeddings, as a model-router ID string (for example "openai/text-embedding-3-small"), an EmbeddingModel, or an EmbeddingModelV2. Required when semantic recall is enabled and the vector store doesn't generate embeddings itself (vector.isSelfEmbedding is false).
|
|
39
39
|
|
|
40
|
-
**embeddingDimension** (`number`): Output dimension of the embedder, as a positive integer. When set, Memory uses it to name the semantic recall index instead of embedding a probe string on first use. It must match the vectors the embedder returns: a mismatch throws a
|
|
40
|
+
**embeddingDimension** (`number`): Output dimension of the embedder, as a positive integer. When set, Memory uses it to name the semantic recall index instead of embedding a probe string on first use. It must match the vectors the embedder returns: a mismatch throws a MASTRA_MEMORY_EMBEDDING_DIMENSION_MISMATCH error before any index is created. See Setting the embedding dimension.
|
|
41
41
|
|
|
42
42
|
**options** (`MemoryConfig`): Memory configuration options.
|
|
43
43
|
|
|
44
|
-
**options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to false to disable the message history feature entirely (messages are not loaded into context or saved). Use Number.
|
|
44
|
+
**options.lastMessages** (`number | false`): Number of most recent messages to include in context. Set to false to disable the message history feature entirely (messages are not loaded into context or saved). Use Number.MAX_SAFE_INTEGER to retrieve all messages with no limit. To load messages without saving new ones, use the readOnly option. The window slides forward on every request, so once a thread exceeds the limit, each turn invalidates the provider prompt cache. For long-running conversations, use Observational Memory instead.
|
|
45
45
|
|
|
46
46
|
**options.messageHistory** (`{ maxTokens: number; atMaxRemoveTokens?: number }`): Token budget for the complete prompt, including remembered history, system instructions, context, and the current turn. When the prompt exceeds maxTokens, the oldest remembered messages are dropped until the prompt is at most maxTokens - atMaxRemoveTokens (defaults to 25% of maxTokens). Protected content is never removed. Linked tool calls and results are removed together. During agent runs, trimmed history is excluded from later turns via a persisted per-thread boundary, but the messages themselves stay in storage. When set without an explicit lastMessages, the default 10-message cap is not applied. Set maxTokens to 0 to disable message history. Prefer this over lastMessages, since message count is a poor proxy for context size.
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ export const agent = new Agent({
|
|
|
49
49
|
|
|
50
50
|
**options.retainFullInput** (`boolean`): When true, the request input is processed exactly as supplied instead of being filtered against stored history. Use this when you assemble the input yourself and need the message sequence preserved. Stored history is still loaded underneath, and every input message that isn't already stored is saved to the thread, including few-shot examples. Can be set per call on memory.options or agent-wide in the memory constructor options.
|
|
51
51
|
|
|
52
|
-
**options.semanticRecall** (`boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource' }`): Enable semantic search in message history. Can be a boolean or an object with configuration options. When enabled, requires
|
|
52
|
+
**options.semanticRecall** (`boolean | { topK: number; messageRange: number | { before: number; after: number }; scope?: 'thread' | 'resource' }`): Enable semantic search in message history. Can be a boolean or an object with configuration options. When enabled, requires a vector store, and an embedder unless the vector store embeds text itself (isSelfEmbedding). Default topK is 4, default messageRange is {before: 1, after: 1}.
|
|
53
53
|
|
|
54
54
|
**options.workingMemory** (`WorkingMemory`): Configuration for working memory feature. Can be { enabled: boolean; template?: string; schema?: ZodObject\<any> | JSONSchema7; scope?: 'thread' | 'resource' } or { enabled: boolean } to disable.
|
|
55
55
|
|
|
@@ -61,6 +61,83 @@ export const agent = new Agent({
|
|
|
61
61
|
|
|
62
62
|
**memory** (`Memory`): A new Memory instance with the specified configuration.
|
|
63
63
|
|
|
64
|
+
## `saveMessages()`
|
|
65
|
+
|
|
66
|
+
`agent.generate()` and `agent.stream()` persist messages for you. Call `memory.saveMessages()` when you need to write messages yourself, for example to seed a thread, to import a transcript, or to store messages that originated outside Mastra. Each message needs a `threadId` and a `resourceId`, so create the thread with [`createThread()`](https://mastra.ai/reference/memory/createThread) before saving into it.
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
await memory.saveMessages({
|
|
70
|
+
messages: [
|
|
71
|
+
{
|
|
72
|
+
id: 'msg-1',
|
|
73
|
+
threadId: 'thread-123',
|
|
74
|
+
resourceId: 'user-456',
|
|
75
|
+
role: 'user',
|
|
76
|
+
createdAt: new Date(),
|
|
77
|
+
content: {
|
|
78
|
+
format: 2,
|
|
79
|
+
parts: [{ type: 'text', text: 'Where is my order?' }],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
})
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Parameters
|
|
87
|
+
|
|
88
|
+
**messages** (`MastraDBMessage[]`): The messages to save. Every message must include a threadId and a resourceId.
|
|
89
|
+
|
|
90
|
+
**memoryConfig** (`MemoryConfig`): Per-call memory options. Merged over the options passed to the constructor.
|
|
91
|
+
|
|
92
|
+
**observabilityContext** (`Partial<ObservabilityContext>`): Tracing context attached to the save operation.
|
|
93
|
+
|
|
94
|
+
Returns `Promise<{ messages: MastraDBMessage[]; usage?: { tokens: number } }>`. `usage` is present when the embedder reports token usage while indexing messages for semantic recall.
|
|
95
|
+
|
|
96
|
+
### `MastraDBMessage`
|
|
97
|
+
|
|
98
|
+
Storage uses a single message shape, `MastraDBMessage`. The methods that hand messages back or take them in use this shape, including `saveMessages()` and [`recall()`](https://mastra.ai/reference/memory/recall).
|
|
99
|
+
|
|
100
|
+
**id** (`string`): Message identifier.
|
|
101
|
+
|
|
102
|
+
**role** (`'user' | 'assistant' | 'system' | 'signal'`): Who produced the message. System messages and transient signals are not persisted.
|
|
103
|
+
|
|
104
|
+
**threadId** (`string`): Thread the message belongs to. Required when saving.
|
|
105
|
+
|
|
106
|
+
**resourceId** (`string`): Resource (usually a user or tenant) the message belongs to. Required when saving.
|
|
107
|
+
|
|
108
|
+
**createdAt** (`Date`): Message timestamp.
|
|
109
|
+
|
|
110
|
+
**content** (`MastraMessageContentV2`): The message body. Its parts array holds the text, reasoning, tool calls, and attachments.
|
|
111
|
+
|
|
112
|
+
`content.parts` is the part the agent actually reads. `content.format` is always `2` for stored messages, and `content.metadata` carries arbitrary custom data. `content.toolInvocations`, `content.reasoning`, and `content.experimental_attachments` are flat mirrors kept for AI SDK v4 compatibility; write to `parts` instead.
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
const assistantMessage = {
|
|
116
|
+
id: 'msg-2',
|
|
117
|
+
threadId: 'thread-123',
|
|
118
|
+
resourceId: 'user-456',
|
|
119
|
+
role: 'assistant',
|
|
120
|
+
createdAt: new Date(),
|
|
121
|
+
content: {
|
|
122
|
+
format: 2,
|
|
123
|
+
parts: [
|
|
124
|
+
{ type: 'text', text: 'It ships tomorrow.' },
|
|
125
|
+
{
|
|
126
|
+
type: 'tool-invocation',
|
|
127
|
+
toolInvocation: {
|
|
128
|
+
state: 'result',
|
|
129
|
+
toolCallId: 'call-1',
|
|
130
|
+
toolName: 'lookupOrder',
|
|
131
|
+
args: { orderId: 'A-1' },
|
|
132
|
+
result: { eta: '2026-10-30' },
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
metadata: { source: 'import' },
|
|
137
|
+
},
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
64
141
|
## Extended usage example
|
|
65
142
|
|
|
66
143
|
```typescript
|
|
@@ -128,8 +205,10 @@ export const agent = new Agent({
|
|
|
128
205
|
indexConfig: {
|
|
129
206
|
type: 'hnsw', // Use HNSW for better performance
|
|
130
207
|
metric: 'dotproduct', // Optimal for OpenAI embeddings
|
|
131
|
-
|
|
132
|
-
|
|
208
|
+
hnsw: {
|
|
209
|
+
m: 16, // Number of bi-directional links
|
|
210
|
+
efConstruction: 64, // Construction-time candidate list size
|
|
211
|
+
},
|
|
133
212
|
},
|
|
134
213
|
},
|
|
135
214
|
workingMemory: {
|
|
@@ -382,6 +382,7 @@ Vector store prompts define query patterns and filtering capabilities for each v
|
|
|
382
382
|
|
|
383
383
|
```ts
|
|
384
384
|
import { MONGODB_PROMPT } from '@mastra/mongodb'
|
|
385
|
+
import { Agent } from '@mastra/core/agent'
|
|
385
386
|
|
|
386
387
|
export const ragAgent = new Agent({
|
|
387
388
|
id: 'rag-agent',
|
|
@@ -416,6 +417,7 @@ export const ragAgent = new Agent({
|
|
|
416
417
|
|
|
417
418
|
```ts
|
|
418
419
|
import { PINECONE_PROMPT } from '@mastra/pinecone'
|
|
420
|
+
import { Agent } from '@mastra/core/agent'
|
|
419
421
|
|
|
420
422
|
export const ragAgent = new Agent({
|
|
421
423
|
id: 'rag-agent',
|
|
@@ -433,6 +435,7 @@ export const ragAgent = new Agent({
|
|
|
433
435
|
|
|
434
436
|
```ts
|
|
435
437
|
import { QDRANT_PROMPT } from '@mastra/qdrant'
|
|
438
|
+
import { Agent } from '@mastra/core/agent'
|
|
436
439
|
|
|
437
440
|
export const ragAgent = new Agent({
|
|
438
441
|
id: 'rag-agent',
|
|
@@ -450,6 +453,7 @@ export const ragAgent = new Agent({
|
|
|
450
453
|
|
|
451
454
|
```ts
|
|
452
455
|
import { CHROMA_PROMPT } from '@mastra/chroma'
|
|
456
|
+
import { Agent } from '@mastra/core/agent'
|
|
453
457
|
|
|
454
458
|
export const ragAgent = new Agent({
|
|
455
459
|
id: 'rag-agent',
|
|
@@ -467,6 +471,7 @@ export const ragAgent = new Agent({
|
|
|
467
471
|
|
|
468
472
|
```ts
|
|
469
473
|
import { ASTRA_PROMPT } from '@mastra/astra'
|
|
474
|
+
import { Agent } from '@mastra/core/agent'
|
|
470
475
|
|
|
471
476
|
export const ragAgent = new Agent({
|
|
472
477
|
id: 'rag-agent',
|
|
@@ -484,6 +489,7 @@ export const ragAgent = new Agent({
|
|
|
484
489
|
|
|
485
490
|
```ts
|
|
486
491
|
import { LIBSQL_PROMPT } from '@mastra/libsql'
|
|
492
|
+
import { Agent } from '@mastra/core/agent'
|
|
487
493
|
|
|
488
494
|
export const ragAgent = new Agent({
|
|
489
495
|
id: 'rag-agent',
|
|
@@ -501,6 +507,7 @@ export const ragAgent = new Agent({
|
|
|
501
507
|
|
|
502
508
|
```ts
|
|
503
509
|
import { UPSTASH_PROMPT } from '@mastra/upstash'
|
|
510
|
+
import { Agent } from '@mastra/core/agent'
|
|
504
511
|
|
|
505
512
|
export const ragAgent = new Agent({
|
|
506
513
|
id: 'rag-agent',
|
|
@@ -518,6 +525,7 @@ export const ragAgent = new Agent({
|
|
|
518
525
|
|
|
519
526
|
```ts
|
|
520
527
|
import { VECTORIZE_PROMPT } from '@mastra/vectorize'
|
|
528
|
+
import { Agent } from '@mastra/core/agent'
|
|
521
529
|
|
|
522
530
|
export const ragAgent = new Agent({
|
|
523
531
|
id: 'rag-agent',
|
|
@@ -535,6 +543,7 @@ export const ragAgent = new Agent({
|
|
|
535
543
|
|
|
536
544
|
```ts
|
|
537
545
|
import { OPENSEARCH_PROMPT } from '@mastra/opensearch'
|
|
546
|
+
import { Agent } from '@mastra/core/agent'
|
|
538
547
|
|
|
539
548
|
export const ragAgent = new Agent({
|
|
540
549
|
id: 'rag-agent',
|
|
@@ -552,6 +561,7 @@ export const ragAgent = new Agent({
|
|
|
552
561
|
|
|
553
562
|
```ts
|
|
554
563
|
import { ORACLEDB_PROMPT } from '@mastra/oracledb'
|
|
564
|
+
import { Agent } from '@mastra/core/agent'
|
|
555
565
|
|
|
556
566
|
export const ragAgent = new Agent({
|
|
557
567
|
id: 'rag-agent',
|
|
@@ -569,6 +579,7 @@ export const ragAgent = new Agent({
|
|
|
569
579
|
|
|
570
580
|
```ts
|
|
571
581
|
import { S3VECTORS_PROMPT } from '@mastra/s3vectors'
|
|
582
|
+
import { Agent } from '@mastra/core/agent'
|
|
572
583
|
|
|
573
584
|
export const ragAgent = new Agent({
|
|
574
585
|
id: 'rag-agent',
|