@mastra/mcp-docs-server 1.3.9-alpha.8 → 1.3.9-alpha.9
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.
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
# Memory.settled()
|
|
6
6
|
|
|
7
|
-
The `.settled()` method resolves once
|
|
7
|
+
The `.settled()` method resolves once background work the `Memory` instance started has finished. Some memory work continues after an agent run returns:
|
|
8
8
|
|
|
9
9
|
- Observational memory cycles (buffered observation and reflection, including the nested agent runs they spawn)
|
|
10
10
|
- Vector cleanup started by `deleteThread()` and `deleteMessages()`
|
|
11
11
|
|
|
12
|
-
Await this method before closing a storage connection you own. Without it, background statements can run against a closed connection.
|
|
12
|
+
Await this method before closing a storage connection you own. Without it, background statements can run against a closed connection. A scoped call can return while other threads still use the store, so call `settled()` without a scope before closing shared storage.
|
|
13
13
|
|
|
14
|
-
The method is declared on the base memory class, so it's also available on the `MastraMemory` instance returned by `agent.getMemory()`.
|
|
14
|
+
The method is declared on the base memory class, so it's also available on the `MastraMemory` instance returned by `agent.getMemory()`. The `scope` parameter is only on `Memory` from `@mastra/memory`.
|
|
15
15
|
|
|
16
16
|
## Usage example
|
|
17
17
|
|
|
@@ -26,11 +26,19 @@ await store.close()
|
|
|
26
26
|
|
|
27
27
|
## Parameters
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
**scope** (`{ threadId?: string | null; resourceId?: string | null }`): Waits only for observational memory work on this thread (or resource, when observational memory uses resource scope). If the scope omits the id observational memory is keyed on (threadId for thread scope, resourceId for resource scope), it waits for all work. Vector cleanup is always included.
|
|
30
30
|
|
|
31
31
|
## Returns
|
|
32
32
|
|
|
33
|
-
**void** (`Promise<void>`): A promise that resolves when
|
|
33
|
+
**void** (`Promise<void>`): A promise that resolves when the requested background memory work has finished (all work, if unscoped). Background work that fails does not reject this promise.
|
|
34
|
+
|
|
35
|
+
## Wait for one conversation
|
|
36
|
+
|
|
37
|
+
On a busy server, waiting for all work can take a long time because other threads keep starting new work. Pass a scope to wait for less. When observational memory uses thread scope, the call below waits for `thread-123` only. When it uses resource scope, it waits for every thread under `user-456`:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
await memory.settled({ threadId: 'thread-123', resourceId: 'user-456' })
|
|
41
|
+
```
|
|
34
42
|
|
|
35
43
|
## Extended usage example
|
|
36
44
|
|
|
@@ -6,6 +6,24 @@
|
|
|
6
6
|
|
|
7
7
|
Mastra uses the AI SDK's `embed` and `embedMany` functions to generate vector embeddings for text inputs, enabling similarity search and RAG workflows.
|
|
8
8
|
|
|
9
|
+
## Supported embedding models
|
|
10
|
+
|
|
11
|
+
Memory and RAG vector query tools accept embedding models with specification versions `v1`, `v2`, `v3`, and `v4`. Mastra selects the matching AI SDK implementation from the model's `specificationVersion`. Existing model configurations remain unchanged.
|
|
12
|
+
|
|
13
|
+
For direct calls, use the matching export from `@mastra/core/vector`: `embedV1`, `embedV2`, `embedV3`, or `embedV4`. For example, an AI SDK v7 provider exposes a specification `v4` embedding model:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { openai } from '@ai-sdk/openai'
|
|
17
|
+
import { embedV4 } from '@mastra/core/vector'
|
|
18
|
+
|
|
19
|
+
const { embedding } = await embedV4({
|
|
20
|
+
model: openai.embedding('text-embedding-3-small'),
|
|
21
|
+
value: 'Your text to embed',
|
|
22
|
+
})
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
This example requires `@ai-sdk/openai` v4. The model specification version and AI SDK package version are different: AI SDK v4 uses embedding specification `v1`, v5 uses `v2`, v6 uses `v3`, and v7 uses `v4`.
|
|
26
|
+
|
|
9
27
|
## Single embedding
|
|
10
28
|
|
|
11
29
|
The `embed` function generates a vector embedding for a single text input:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.9-alpha.
|
|
3
|
+
"version": "1.3.9-alpha.9",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
|
|
27
27
|
"local-pkg": "^1.1.2",
|
|
28
28
|
"zod": "^4.6.7",
|
|
29
|
-
"@mastra/
|
|
30
|
-
"@mastra/
|
|
29
|
+
"@mastra/core": "1.79.0-alpha.6",
|
|
30
|
+
"@mastra/mcp": "^2.5.0-alpha.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hono/node-server": "^2.0.0",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"typescript": "^7.0.2",
|
|
44
44
|
"vitest": "4.1.11",
|
|
45
45
|
"@internal/lint": "0.0.144",
|
|
46
|
-
"@
|
|
47
|
-
"@
|
|
46
|
+
"@internal/types-builder": "0.0.119",
|
|
47
|
+
"@mastra/core": "1.79.0-alpha.6"
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://mastra.ai",
|
|
50
50
|
"repository": {
|