@mastra/mcp-docs-server 1.3.11-alpha.3 → 1.3.11
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.
|
@@ -435,6 +435,8 @@ When using PostgreSQL as your vector store, you can optimize semantic recall per
|
|
|
435
435
|
|
|
436
436
|
PostgreSQL supports both IVFFlat and HNSW indexes. By default, Mastra creates an IVFFlat index, but HNSW indexes typically provide better performance, especially with OpenAI embeddings which use inner product distance.
|
|
437
437
|
|
|
438
|
+
Semantic recall always filters by thread or resource. PgVector uses the vector index for these searches only with HNSW on pgvector 0.8.0 or newer. With IVFFlat, each search compares the query against every message in the thread or resource.
|
|
439
|
+
|
|
438
440
|
```typescript
|
|
439
441
|
import { Memory } from '@mastra/memory'
|
|
440
442
|
import { PostgresStore, PgVector } from '@mastra/pg'
|
|
@@ -223,6 +223,12 @@ The example mounts the filesystem inside the resolver because static `mounts` ca
|
|
|
223
223
|
|
|
224
224
|
> **Warning:** Your application owns sandboxes returned by a resolver. Destroy them and call `workspace.clearSandboxCache(cacheKey)` when the user, thread, or session ends. `workspace.destroy()` doesn't destroy resolver-returned sandboxes.
|
|
225
225
|
|
|
226
|
+
### Agent workspace functions
|
|
227
|
+
|
|
228
|
+
An agent's `workspace` option also accepts a function that returns a `Workspace`. Mastra calls this function whenever it needs the agent's workspace, not only when the agent runs. This includes registering the agent at startup and reading agent metadata, such as `GET /api/agents` and `GET /api/agents/:agentId`, which Studio calls when it lists agents. These calls aren't cached.
|
|
229
|
+
|
|
230
|
+
Keep the function cheap. Don't start a sandbox or other paid infrastructure inside it. Return a workspace that uses `filesystem` and `sandbox` resolvers instead. Mastra calls the filesystem resolver when it builds the workspace instructions for a run, when a tool needs the provider, and when the agent's workspace skills are read, including on the agent metadata routes. It calls the sandbox resolver only when a tool needs the provider, unless you set `instructions.dynamicSandbox` to `'resolve'`.
|
|
231
|
+
|
|
226
232
|
### Tool availability
|
|
227
233
|
|
|
228
234
|
With a static sandbox, Mastra knows which capabilities the backend supports and only gives the agent the corresponding tools. Application code should also check that an optional capability is available before using it.
|
|
@@ -565,7 +565,7 @@ export const mastra = new Mastra({
|
|
|
565
565
|
**Type:** `boolean`\
|
|
566
566
|
**Default:** `false`
|
|
567
567
|
|
|
568
|
-
Enables source map generation for the bundled output.
|
|
568
|
+
Enables source map generation for the bundled output. When it's enabled, `mastra dev` and `mastra start` run the server with Node's `--enable-source-maps` flag, so stack traces point at your source files.
|
|
569
569
|
|
|
570
570
|
```typescript
|
|
571
571
|
import { Mastra } from '@mastra/core'
|
|
@@ -251,7 +251,11 @@ const results = await pgVector.query({
|
|
|
251
251
|
})
|
|
252
252
|
```
|
|
253
253
|
|
|
254
|
-
|
|
254
|
+
With an HNSW index on pgvector 0.8.0 or newer, PostgreSQL searches the index and skips rows that don't match the filter. When the index search can't fill `topK`, pgVector reruns the query as an exact search.
|
|
255
|
+
|
|
256
|
+
With IVFFlat, or HNSW on older pgvector versions, pgVector compares the query vector against every matching row. Results are exact, but the work grows with the number of matching rows.
|
|
257
|
+
|
|
258
|
+
Indexing the metadata fields you filter on speeds up both cases and gives PostgreSQL the row counts it needs to choose between them.
|
|
255
259
|
|
|
256
260
|
### Vector Query Tool
|
|
257
261
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.3.11
|
|
3
|
+
"version": "1.3.11",
|
|
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.2.1",
|
|
28
28
|
"zod": "^4.6.7",
|
|
29
|
-
"@mastra/core": "1.81.0
|
|
30
|
-
"@mastra/mcp": "^2.7.0
|
|
29
|
+
"@mastra/core": "1.81.0",
|
|
30
|
+
"@mastra/mcp": "^2.7.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@hono/node-server": "^2.1.3",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"tsx": "^4.23.15",
|
|
43
43
|
"typescript": "^7.0.2",
|
|
44
44
|
"vitest": "4.1.12",
|
|
45
|
-
"@internal/
|
|
46
|
-
"@internal/
|
|
47
|
-
"@mastra/core": "1.81.0
|
|
45
|
+
"@internal/lint": "0.0.147",
|
|
46
|
+
"@internal/types-builder": "0.0.122",
|
|
47
|
+
"@mastra/core": "1.81.0"
|
|
48
48
|
},
|
|
49
49
|
"homepage": "https://mastra.ai",
|
|
50
50
|
"repository": {
|