@mastra/mcp-docs-server 0.13.18 → 0.13.19-alpha.1
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/.docs/organized/changelogs/%40internal%2Fstorage-test-utils.md +17 -17
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +2 -0
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +29 -0
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +16 -0
- package/.docs/organized/changelogs/%40mastra%2Fastra.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fchroma.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +42 -42
- package/.docs/organized/changelogs/%40mastra%2Fcloud.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +64 -64
- package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +39 -0
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +28 -28
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-vercel.md +33 -33
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +53 -53
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Fevals.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +19 -19
- package/.docs/organized/changelogs/%40mastra%2Fgithub.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Flance.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +36 -36
- package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +26 -26
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +39 -39
- package/.docs/organized/changelogs/%40mastra%2Fmem0.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +34 -34
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +30 -30
- package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +47 -47
- package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Frag.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fragie.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +10 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +37 -37
- package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +21 -21
- package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-azure.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-cloudflare.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-deepgram.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-elevenlabs.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-gladia.md +16 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +16 -0
- package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fvoice-murf.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-openai.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-playai.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-sarvam.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fvoice-speechify.md +17 -17
- package/.docs/organized/changelogs/create-mastra.md +27 -27
- package/.docs/organized/changelogs/mastra.md +57 -57
- package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
- package/.docs/organized/code-examples/ai-sdk-v5.md +8 -8
- package/.docs/organized/code-examples/heads-up-game.md +5 -5
- package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -0
- package/.docs/raw/auth/jwt.mdx +2 -2
- package/.docs/raw/auth/supabase.mdx +128 -0
- package/.docs/raw/deployment/overview.mdx +7 -7
- package/.docs/raw/getting-started/mcp-docs-server.mdx +52 -48
- package/.docs/raw/memory/overview.mdx +2 -2
- package/.docs/raw/rag/retrieval.mdx +19 -2
- package/.docs/raw/rag/vector-databases.mdx +39 -3
- package/.docs/raw/reference/auth/jwt.mdx +2 -3
- package/.docs/raw/reference/auth/supabase.mdx +62 -0
- package/.docs/raw/reference/{agents → core}/getAgent.mdx +1 -2
- package/.docs/raw/reference/core/getAgentById.mdx +43 -0
- package/.docs/raw/reference/core/getAgents.mdx +35 -0
- package/.docs/raw/reference/core/getDeployer.mdx +35 -0
- package/.docs/raw/reference/core/getLogger.mdx +35 -0
- package/.docs/raw/reference/core/getLogs.mdx +92 -0
- package/.docs/raw/reference/core/getLogsByRunId.mdx +84 -0
- package/.docs/raw/reference/core/getMCPServer.mdx +49 -0
- package/.docs/raw/reference/core/getMCPServers.mdx +35 -0
- package/.docs/raw/reference/core/getMemory.mdx +35 -0
- package/.docs/raw/reference/core/getServer.mdx +35 -0
- package/.docs/raw/reference/core/getStorage.mdx +35 -0
- package/.docs/raw/reference/core/getTelemetry.mdx +35 -0
- package/.docs/raw/reference/core/getVector.mdx +43 -0
- package/.docs/raw/reference/core/getVectors.mdx +35 -0
- package/.docs/raw/reference/core/getWorkflow.mdx +49 -0
- package/.docs/raw/reference/core/getWorkflows.mdx +44 -0
- package/.docs/raw/reference/core/mastra-class.mdx +14 -178
- package/.docs/raw/reference/core/setLogger.mdx +47 -0
- package/.docs/raw/reference/core/setStorage.mdx +39 -0
- package/.docs/raw/reference/core/setTelemetry.mdx +35 -0
- package/.docs/raw/reference/observability/providers/arize-ax.mdx +81 -0
- package/.docs/raw/reference/observability/providers/arize-phoenix.mdx +120 -0
- package/.docs/raw/reference/observability/providers/index.mdx +3 -1
- package/.docs/raw/reference/rag/metadata-filters.mdx +15 -0
- package/.docs/raw/reference/rag/s3vectors.mdx +386 -0
- package/.docs/raw/reference/tools/mcp-server.mdx +27 -26
- package/.docs/raw/tools-mcp/mcp-overview.mdx +5 -6
- package/.docs/raw/workflows/control-flow.mdx +2 -2
- package/.docs/raw/workflows/overview.mdx +8 -8
- package/.docs/raw/workflows/suspend-and-resume.mdx +4 -4
- package/CHANGELOG.md +18 -0
- package/package.json +5 -5
- package/.docs/raw/reference/workflows/execute.mdx +0 -131
- /package/.docs/raw/reference/workflows/{branch.mdx → workflow-methods/branch.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{commit.mdx → workflow-methods/commit.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{create-run.mdx → workflow-methods/create-run.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{dountil.mdx → workflow-methods/dountil.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{dowhile.mdx → workflow-methods/dowhile.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{foreach.mdx → workflow-methods/foreach.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{map.mdx → workflow-methods/map.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{parallel.mdx → workflow-methods/parallel.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{sendEvent.mdx → workflow-methods/sendEvent.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{sleep.mdx → workflow-methods/sleep.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{sleepUntil.mdx → workflow-methods/sleepUntil.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{then.mdx → workflow-methods/then.mdx} +0 -0
- /package/.docs/raw/reference/workflows/{waitForEvent.mdx → workflow-methods/waitForEvent.mdx} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getVectors() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getVectors()` method in Mastra, which retrieves all configured vector stores."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getVectors()
|
|
7
|
+
|
|
8
|
+
The `.getVectors()` method is used to retrieve all vector stores that have been configured in the Mastra instance.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getVectors();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
This method does not accept any parameters.
|
|
19
|
+
|
|
20
|
+
## Returns
|
|
21
|
+
|
|
22
|
+
<PropertiesTable
|
|
23
|
+
content={[
|
|
24
|
+
{
|
|
25
|
+
name: "vectors",
|
|
26
|
+
type: "TVectors",
|
|
27
|
+
description: "A record of all configured vector stores, where keys are vector store names and values are vector store instances.",
|
|
28
|
+
},
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Vector stores overview](../../docs/rag/vector-databases.mdx)
|
|
35
|
+
- [RAG overview](../../docs/rag/overview.mdx)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getWorkflow() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getWorkflow()` method in Mastra, which retrieves a workflow by ID."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getWorkflow()
|
|
7
|
+
|
|
8
|
+
The `.getWorkflow()` method is used to retrieve a workflow by its ID. The method accepts a workflow ID and an optional options object.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getWorkflow("testWorkflow");
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "id",
|
|
22
|
+
type: "TWorkflowId extends keyof TWorkflows",
|
|
23
|
+
description: "The ID of the workflow to retrieve. Must be a valid workflow ID that exists in the Mastra configuration.",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "options",
|
|
27
|
+
type: "{ serialized?: boolean }",
|
|
28
|
+
description: "Optional configuration object. When `serialized` is true, returns only the workflow name instead of the full workflow instance.",
|
|
29
|
+
optional: true,
|
|
30
|
+
},
|
|
31
|
+
]}
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
## Returns
|
|
35
|
+
|
|
36
|
+
<PropertiesTable
|
|
37
|
+
content={[
|
|
38
|
+
{
|
|
39
|
+
name: "workflow",
|
|
40
|
+
type: "TWorkflows[TWorkflowId]",
|
|
41
|
+
description: "The workflow instance with the specified ID. Throws an error if the workflow is not found.",
|
|
42
|
+
},
|
|
43
|
+
]}
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
## Related
|
|
47
|
+
|
|
48
|
+
- [Workflows overview](../../docs/workflows/overview.mdx)
|
|
49
|
+
- [Dynamic workflows](../../docs/workflows/dynamic-workflows.mdx)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.getWorkflows() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.getWorkflows()` method in Mastra, which retrieves all configured workflows."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.getWorkflows()
|
|
7
|
+
|
|
8
|
+
The `.getWorkflows()` method is used to retrieve all workflows that have been configured in the Mastra instance. The method accepts an optional options object.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.getWorkflows();
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "options",
|
|
22
|
+
type: "{ serialized?: boolean }",
|
|
23
|
+
description: "Optional configuration object. When `serialized` is true, returns simplified workflow objects with only the name property instead of full workflow instances.",
|
|
24
|
+
optional: true,
|
|
25
|
+
},
|
|
26
|
+
]}
|
|
27
|
+
/>
|
|
28
|
+
|
|
29
|
+
## Returns
|
|
30
|
+
|
|
31
|
+
<PropertiesTable
|
|
32
|
+
content={[
|
|
33
|
+
{
|
|
34
|
+
name: "workflows",
|
|
35
|
+
type: "Record<string, Workflow>",
|
|
36
|
+
description: "A record of all configured workflows, where keys are workflow IDs and values are workflow instances (or simplified objects if serialized is true).",
|
|
37
|
+
},
|
|
38
|
+
]}
|
|
39
|
+
/>
|
|
40
|
+
|
|
41
|
+
## Related
|
|
42
|
+
|
|
43
|
+
- [Workflows overview](../../docs/workflows/overview.mdx)
|
|
44
|
+
- [Dynamic workflows](../../docs/workflows/dynamic-workflows.mdx)
|
|
@@ -3,7 +3,7 @@ title: "Mastra Core"
|
|
|
3
3
|
description: Documentation for the Mastra Class, the core entry point for managing agents, workflows, MCP servers, and server endpoints.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Mastra Class
|
|
7
7
|
|
|
8
8
|
The `Mastra` class is the central orchestrator in any Mastra application, managing agents, workflows, storage, logging, telemetry, and more. Typically, you create a single instance of `Mastra` to coordinate your application.
|
|
9
9
|
|
|
@@ -13,42 +13,29 @@ Think of `Mastra` as a top-level registry:
|
|
|
13
13
|
- **tools** aren’t registered on `Mastra` directly but are associated with agents and discovered automatically.
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
##
|
|
16
|
+
## Usage example
|
|
17
17
|
|
|
18
|
-
```typescript
|
|
19
|
-
import { Mastra } from
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
Creates a new `Mastra` instance with the specified configuration.
|
|
25
|
-
|
|
26
|
-
```typescript
|
|
27
|
-
constructor(config?: Config);
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Initialization
|
|
31
|
-
|
|
32
|
-
The Mastra class is typically initialized in your `src/mastra/index.ts` file:
|
|
33
|
-
|
|
34
|
-
```typescript filename="src/mastra/index.ts" showLineNumbers copy
|
|
35
|
-
import { Mastra } from "@mastra/core/mastra";
|
|
36
|
-
import { LibSQLStore } from "@mastra/libsql";
|
|
37
|
-
import { weatherAgent } from "./agents/weather-agent";
|
|
18
|
+
```typescript filename="src/mastra/index.ts"
|
|
19
|
+
import { Mastra } from '@mastra/core/mastra';
|
|
20
|
+
import { PinoLogger } from '@mastra/loggers';
|
|
21
|
+
import { LibSQLStore } from '@mastra/libsql';
|
|
22
|
+
import { weatherWorkflow } from './workflows/weather-workflow';
|
|
23
|
+
import { weatherAgent } from './agents/weather-agent';
|
|
38
24
|
|
|
39
25
|
export const mastra = new Mastra({
|
|
26
|
+
workflows: { weatherWorkflow },
|
|
40
27
|
agents: { weatherAgent },
|
|
41
28
|
storage: new LibSQLStore({
|
|
42
29
|
url: ":memory:",
|
|
43
30
|
}),
|
|
31
|
+
logger: new PinoLogger({
|
|
32
|
+
name: 'Mastra',
|
|
33
|
+
level: 'info',
|
|
34
|
+
}),
|
|
44
35
|
});
|
|
45
36
|
```
|
|
46
37
|
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
The constructor accepts an optional `Config` object to customize its behavior and integrate various Mastra components. All properties on the `Config` object are optional.
|
|
50
|
-
|
|
51
|
-
### Properties
|
|
38
|
+
## Constructor parameters
|
|
52
39
|
|
|
53
40
|
<PropertiesTable
|
|
54
41
|
content={[
|
|
@@ -145,156 +132,5 @@ The constructor accepts an optional `Config` object to customize its behavior an
|
|
|
145
132
|
]}
|
|
146
133
|
/>
|
|
147
134
|
|
|
148
|
-
## Usage
|
|
149
|
-
|
|
150
|
-
Any of the below methods can be used with the Mastra class, for example:
|
|
151
|
-
|
|
152
|
-
```typescript {3} filename="example.ts" showLineNumbers
|
|
153
|
-
import { mastra } from "./mastra";
|
|
154
|
-
|
|
155
|
-
const agent = mastra.getAgent("weatherAgent");
|
|
156
|
-
const result = await agent.generate("What's the weather like in London?");
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
### Methods
|
|
160
|
-
|
|
161
|
-
<PropertiesTable
|
|
162
|
-
content={[
|
|
163
|
-
{
|
|
164
|
-
name: "getAgent(name)",
|
|
165
|
-
type: "Agent",
|
|
166
|
-
description:
|
|
167
|
-
"Returns an agent instance by id. Throws if agent not found.",
|
|
168
|
-
example: 'const agent = mastra.getAgent("agentOne");',
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
name: "getAgents()",
|
|
172
|
-
type: "Record<string, Agent>",
|
|
173
|
-
description: "Returns all registered agents as a key-value object.",
|
|
174
|
-
example: "const agents = mastra.getAgents();",
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: "getWorkflow(id, { serialized })",
|
|
178
|
-
type: "Workflow",
|
|
179
|
-
description:
|
|
180
|
-
"Returns a workflow instance by id. The serialized option (default: false) returns a simplified representation with just the name.",
|
|
181
|
-
example: 'const workflow = mastra.getWorkflow("myWorkflow");',
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
name: "getWorkflows({ serialized })",
|
|
185
|
-
type: "Record<string, Workflow>",
|
|
186
|
-
description:
|
|
187
|
-
"Returns all registered workflows. The serialized option (default: false) returns simplified representations.",
|
|
188
|
-
example: "const workflows = mastra.getWorkflows();",
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: "getVector(name)",
|
|
192
|
-
type: "MastraVector",
|
|
193
|
-
description:
|
|
194
|
-
"Returns a vector store instance by name. Throws if not found.",
|
|
195
|
-
example: 'const vectorStore = mastra.getVector("myVectorStore");',
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
name: "getVectors()",
|
|
199
|
-
type: "Record<string, MastraVector>",
|
|
200
|
-
description:
|
|
201
|
-
"Returns all registered vector stores as a key-value object.",
|
|
202
|
-
example: "const vectorStores = mastra.getVectors();",
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
name: "getDeployer()",
|
|
206
|
-
type: "MastraDeployer | undefined",
|
|
207
|
-
description: "Returns the configured deployer instance, if any.",
|
|
208
|
-
example: "const deployer = mastra.getDeployer();",
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: "getStorage()",
|
|
212
|
-
type: "MastraStorage | undefined",
|
|
213
|
-
description: "Returns the configured storage instance.",
|
|
214
|
-
example: "const storage = mastra.getStorage();",
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: "getMemory()",
|
|
218
|
-
type: "MastraMemory | undefined",
|
|
219
|
-
description:
|
|
220
|
-
"Returns the configured memory instance. Note: This is deprecated, memory should be added to agents directly.",
|
|
221
|
-
example: "const memory = mastra.getMemory();",
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: "getServer()",
|
|
225
|
-
type: "ServerConfig | undefined",
|
|
226
|
-
description:
|
|
227
|
-
"Returns the server configuration including port, timeout, API routes, middleware, CORS settings, and build options.",
|
|
228
|
-
example: "const serverConfig = mastra.getServer();",
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
name: "setStorage(storage)",
|
|
232
|
-
type: "void",
|
|
233
|
-
description: "Sets the storage instance for the Mastra instance.",
|
|
234
|
-
example: "mastra.setStorage(new DefaultStorage());",
|
|
235
|
-
},
|
|
236
|
-
{
|
|
237
|
-
name: "setLogger({ logger })",
|
|
238
|
-
type: "void",
|
|
239
|
-
description:
|
|
240
|
-
"Sets the logger for all components (agents, workflows, etc.).",
|
|
241
|
-
example:
|
|
242
|
-
'mastra.setLogger({ logger: new PinoLogger({ name: "MyLogger" }) });',
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
name: "setTelemetry(telemetry)",
|
|
246
|
-
type: "void",
|
|
247
|
-
description: "Sets the telemetry configuration for all components.",
|
|
248
|
-
example: 'mastra.setTelemetry({ export: { type: "console" } });',
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
name: "getLogger()",
|
|
252
|
-
type: "Logger",
|
|
253
|
-
description: "Gets the configured logger instance.",
|
|
254
|
-
example: "const logger = mastra.getLogger();",
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
name: "getTelemetry()",
|
|
258
|
-
type: "Telemetry | undefined",
|
|
259
|
-
description: "Gets the configured telemetry instance.",
|
|
260
|
-
example: "const telemetry = mastra.getTelemetry();",
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
name: "getLogsByRunId({ runId, transportId })",
|
|
264
|
-
type: "Promise<any>",
|
|
265
|
-
description: "Retrieves logs for a specific run ID and transport ID.",
|
|
266
|
-
example:
|
|
267
|
-
'const logs = await mastra.getLogsByRunId({ runId: "123", transportId: "456" });',
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
name: "getLogs(transportId)",
|
|
271
|
-
type: "Promise<any>",
|
|
272
|
-
description: "Retrieves all logs for a specific transport ID.",
|
|
273
|
-
example: 'const logs = await mastra.getLogs("transportId");',
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
name: "getMCPServers()",
|
|
277
|
-
type: "Record<string, MCPServerBase> | undefined",
|
|
278
|
-
description: "Retrieves all registered MCP server instances.",
|
|
279
|
-
example: "const mcpServers = mastra.getMCPServers();",
|
|
280
|
-
},
|
|
281
|
-
]}
|
|
282
|
-
/>
|
|
283
|
-
|
|
284
|
-
## Error Handling
|
|
285
|
-
|
|
286
|
-
The Mastra class methods throw typed errors that can be caught:
|
|
287
135
|
|
|
288
|
-
```typescript {8} filename="example.ts" showLineNumbers
|
|
289
|
-
import { mastra } from "./mastra";
|
|
290
136
|
|
|
291
|
-
try {
|
|
292
|
-
const agent = mastra.getAgent("weatherAgent");
|
|
293
|
-
const result = await agent.generate("What's the weather like in London?");
|
|
294
|
-
|
|
295
|
-
} catch (error) {
|
|
296
|
-
if (error instanceof Error) {
|
|
297
|
-
console.log(error.message);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.setLogger() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.setLogger()` method in Mastra, which sets the logger for all components (agents, workflows, etc.)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.setLogger()
|
|
7
|
+
|
|
8
|
+
The `.setLogger()` method is used to set the logger for all components (agents, workflows, etc.) in the Mastra instance. This method accepts a single object parameter with a logger property.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.setLogger({ logger: new PinoLogger({ name: "testLogger" }) });
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "options",
|
|
22
|
+
type: "{ logger: TLogger }",
|
|
23
|
+
description: "An object containing the logger instance to set for all components.",
|
|
24
|
+
},
|
|
25
|
+
]}
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
### Options
|
|
29
|
+
|
|
30
|
+
<PropertiesTable
|
|
31
|
+
content={[
|
|
32
|
+
{
|
|
33
|
+
name: "logger",
|
|
34
|
+
type: "TLogger",
|
|
35
|
+
description: "The logger instance to set for all components (agents, workflows, etc.).",
|
|
36
|
+
},
|
|
37
|
+
]}
|
|
38
|
+
/>
|
|
39
|
+
|
|
40
|
+
## Returns
|
|
41
|
+
|
|
42
|
+
This method does not return a value.
|
|
43
|
+
|
|
44
|
+
## Related
|
|
45
|
+
|
|
46
|
+
- [Logging overview](../../docs/observability/logging.mdx)
|
|
47
|
+
- [Logger reference](../../reference/observability/logger.mdx)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.setStorage() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.setStorage()` method in Mastra, which sets the storage instance for the Mastra instance."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.setStorage()
|
|
7
|
+
|
|
8
|
+
The `.setStorage()` method is used to set the storage instance for the Mastra instance. This method accepts a single `MastraStorage` parameter.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.setStorage(
|
|
14
|
+
new LibSQLStore({
|
|
15
|
+
url: ":memory:"
|
|
16
|
+
})
|
|
17
|
+
);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
<PropertiesTable
|
|
23
|
+
content={[
|
|
24
|
+
{
|
|
25
|
+
name: "storage",
|
|
26
|
+
type: "MastraStorage",
|
|
27
|
+
description: "The storage instance to set for the Mastra instance.",
|
|
28
|
+
},
|
|
29
|
+
]}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
## Returns
|
|
33
|
+
|
|
34
|
+
This method does not return a value.
|
|
35
|
+
|
|
36
|
+
## Related
|
|
37
|
+
|
|
38
|
+
- [Storage overview](../../docs/server-db/storage.mdx)
|
|
39
|
+
- [Storage reference](../../reference/storage/libsql.mdx)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Mastra.setTelemetry() | Core | Mastra Docs"
|
|
3
|
+
description: "Documentation for the `Mastra.setTelemetry()` method in Mastra, which sets the telemetry configuration for all components."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Mastra.setTelemetry()
|
|
7
|
+
|
|
8
|
+
The `.setTelemetry()` method is used to set the telemetry configuration for all components in the Mastra instance. This method accepts a single telemetry configuration object.
|
|
9
|
+
|
|
10
|
+
## Usage example
|
|
11
|
+
|
|
12
|
+
```typescript copy
|
|
13
|
+
mastra.setTelemetry({ export: { type: "console" } });
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Parameters
|
|
17
|
+
|
|
18
|
+
<PropertiesTable
|
|
19
|
+
content={[
|
|
20
|
+
{
|
|
21
|
+
name: "telemetry",
|
|
22
|
+
type: "OtelConfig",
|
|
23
|
+
description: "The telemetry configuration object to set for all components.",
|
|
24
|
+
},
|
|
25
|
+
]}
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
This method does not return a value.
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Telemetry overview](../../docs/observability/telemetry.mdx)
|
|
35
|
+
- [Telemetry reference](../../reference/observability/telemetry.mdx)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Arize AX Integration | Mastra Observability Docs"
|
|
3
|
+
description: Documentation for integrating Arize AX with Mastra, a comprehensive AI observability platform for monitoring and evaluating LLM applications.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Arize AX
|
|
7
|
+
|
|
8
|
+
Arize AX is a comprehensive AI observability platform designed specifically for monitoring, evaluating, and improving LLM applications in production.
|
|
9
|
+
|
|
10
|
+
## Configuration
|
|
11
|
+
|
|
12
|
+
To use Arize AX with Mastra, you can configure it using either environment variables or directly in your Mastra configuration.
|
|
13
|
+
|
|
14
|
+
### Using Environment Variables
|
|
15
|
+
|
|
16
|
+
Set the following environment variables:
|
|
17
|
+
|
|
18
|
+
```env
|
|
19
|
+
ARIZE_SPACE_ID="your-space-id"
|
|
20
|
+
ARIZE_API_KEY="your-api-key"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Getting Your Credentials
|
|
24
|
+
|
|
25
|
+
1. Sign up for an Arize AX account at [app.arize.com](https://app.arize.com)
|
|
26
|
+
2. Navigate to your space settings to find your Space ID and API Key
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
First, install the OpenInference instrumentation package for Mastra:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @arizeai/openinference-mastra
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Implementation
|
|
37
|
+
|
|
38
|
+
Here's how to configure Mastra to use Arize AX with OpenTelemetry:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { Mastra } from "@mastra/core";
|
|
42
|
+
import {
|
|
43
|
+
isOpenInferenceSpan,
|
|
44
|
+
OpenInferenceOTLPTraceExporter,
|
|
45
|
+
} from "@arizeai/openinference-mastra";
|
|
46
|
+
|
|
47
|
+
export const mastra = new Mastra({
|
|
48
|
+
// ... other config
|
|
49
|
+
telemetry: {
|
|
50
|
+
serviceName: "your-mastra-app",
|
|
51
|
+
enabled: true,
|
|
52
|
+
export: {
|
|
53
|
+
type: "custom",
|
|
54
|
+
exporter: new OpenInferenceOTLPTraceExporter({
|
|
55
|
+
url: "https://otlp.arize.com/v1/traces",
|
|
56
|
+
headers: {
|
|
57
|
+
"space_id": process.env.ARIZE_SPACE_ID!,
|
|
58
|
+
"api_key": process.env.ARIZE_API_KEY!,
|
|
59
|
+
},
|
|
60
|
+
spanFilter: isOpenInferenceSpan,
|
|
61
|
+
}),
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## What Gets Automatically Traced
|
|
68
|
+
|
|
69
|
+
Mastra's comprehensive tracing captures:
|
|
70
|
+
|
|
71
|
+
- **Agent Operations**: All agent generation, streaming, and interaction calls
|
|
72
|
+
- **LLM Interactions**: Complete model calls with input/output messages and metadata
|
|
73
|
+
- **Tool Executions**: Function calls made by agents with parameters and results
|
|
74
|
+
- **Workflow Runs**: Step-by-step workflow execution with timing and dependencies
|
|
75
|
+
- **Memory Operations**: Agent memory queries, updates, and retrieval operations
|
|
76
|
+
|
|
77
|
+
All traces follow OpenTelemetry standards and include relevant metadata such as model parameters, token usage, execution timing, and error details.
|
|
78
|
+
|
|
79
|
+
## Dashboard
|
|
80
|
+
|
|
81
|
+
Once configured, you can view your traces and analytics in the Arize AX dashboard at [app.arize.com](https://app.arize.com)
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Reference: Arize Phoenix Integration | Mastra Observability Docs"
|
|
3
|
+
description: Documentation for integrating Arize Phoenix with Mastra, an open-source AI observability platform for monitoring and evaluating LLM applications.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Arize Phoenix
|
|
7
|
+
|
|
8
|
+
Arize Phoenix is an open-source AI observability platform designed for monitoring, evaluating, and improving LLM applications. It can be self-hosted or used via Phoenix Cloud.
|
|
9
|
+
|
|
10
|
+
## Configuration
|
|
11
|
+
|
|
12
|
+
### Phoenix Cloud
|
|
13
|
+
|
|
14
|
+
If you're using Phoenix Cloud, configure these environment variables:
|
|
15
|
+
|
|
16
|
+
```env
|
|
17
|
+
PHOENIX_API_KEY="your-phoenix-api-key"
|
|
18
|
+
PHOENIX_COLLECTOR_ENDPOINT="your-phoenix-hostname"
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
#### Getting Your Credentials
|
|
22
|
+
|
|
23
|
+
1. Sign up for an Arize Phoenix account at [app.phoenix.arize.com](https://app.phoenix.arize.com/login)
|
|
24
|
+
2. Grab your API key from the Keys option on the left bar
|
|
25
|
+
3. Note your Phoenix hostname for the collector endpoint
|
|
26
|
+
|
|
27
|
+
### Self-Hosted Phoenix
|
|
28
|
+
|
|
29
|
+
If you're running a self-hosted Phoenix instance, configure:
|
|
30
|
+
|
|
31
|
+
```env
|
|
32
|
+
PHOENIX_COLLECTOR_ENDPOINT="http://localhost:6006"
|
|
33
|
+
# Optional: If authentication enabled
|
|
34
|
+
PHOENIX_API_KEY="your-api-key"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Installation
|
|
38
|
+
|
|
39
|
+
Install the necessary packages:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install @arizeai/openinference-mastra@^2.2.0
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Implementation
|
|
46
|
+
|
|
47
|
+
Here's how to configure Mastra to use Phoenix with OpenTelemetry:
|
|
48
|
+
|
|
49
|
+
### Phoenix Cloud Configuration
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
import { Mastra } from "@mastra/core";
|
|
53
|
+
import {
|
|
54
|
+
OpenInferenceOTLPTraceExporter,
|
|
55
|
+
isOpenInferenceSpan,
|
|
56
|
+
} from "@arizeai/openinference-mastra";
|
|
57
|
+
|
|
58
|
+
export const mastra = new Mastra({
|
|
59
|
+
// ... other config
|
|
60
|
+
telemetry: {
|
|
61
|
+
serviceName: "my-mastra-app",
|
|
62
|
+
enabled: true,
|
|
63
|
+
export: {
|
|
64
|
+
type: "custom",
|
|
65
|
+
exporter: new OpenInferenceOTLPTraceExporter({
|
|
66
|
+
url: process.env.PHOENIX_COLLECTOR_ENDPOINT!,
|
|
67
|
+
headers: {
|
|
68
|
+
Authorization: `Bearer ${process.env.PHOENIX_API_KEY}`,
|
|
69
|
+
},
|
|
70
|
+
spanFilter: isOpenInferenceSpan,
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Self-Hosted Phoenix Configuration
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
import { Mastra } from "@mastra/core";
|
|
81
|
+
import {
|
|
82
|
+
OpenInferenceOTLPTraceExporter,
|
|
83
|
+
isOpenInferenceSpan,
|
|
84
|
+
} from "@arizeai/openinference-mastra";
|
|
85
|
+
|
|
86
|
+
export const mastra = new Mastra({
|
|
87
|
+
// ... other config
|
|
88
|
+
telemetry: {
|
|
89
|
+
serviceName: "my-mastra-app",
|
|
90
|
+
enabled: true,
|
|
91
|
+
export: {
|
|
92
|
+
type: "custom",
|
|
93
|
+
exporter: new OpenInferenceOTLPTraceExporter({
|
|
94
|
+
url: process.env.PHOENIX_COLLECTOR_ENDPOINT!,
|
|
95
|
+
spanFilter: isOpenInferenceSpan,
|
|
96
|
+
}),
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## What Gets Automatically Traced
|
|
103
|
+
|
|
104
|
+
Mastra's comprehensive tracing captures:
|
|
105
|
+
|
|
106
|
+
- **Agent Operations**: All agent generation, streaming, and interaction calls
|
|
107
|
+
- **LLM Interactions**: Complete model calls with input/output messages and metadata
|
|
108
|
+
- **Tool Executions**: Function calls made by agents with parameters and results
|
|
109
|
+
- **Workflow Runs**: Step-by-step workflow execution with timing and dependencies
|
|
110
|
+
- **Memory Operations**: Agent memory queries, updates, and retrieval operations
|
|
111
|
+
|
|
112
|
+
All traces follow OpenTelemetry standards and include relevant metadata such as model parameters, token usage, execution timing, and error details.
|
|
113
|
+
|
|
114
|
+
## Dashboard
|
|
115
|
+
|
|
116
|
+
Once configured, you can view your traces and analytics in Phoenix:
|
|
117
|
+
- **Phoenix Cloud**: [app.phoenix.arize.com](https://app.phoenix.arize.com)
|
|
118
|
+
- **Self-hosted**: Your Phoenix instance URL (e.g., `http://localhost:6006`)
|
|
119
|
+
|
|
120
|
+
For self-hosting options, see the [Phoenix self-hosting documentation](https://arize.com/docs/phoenix/self-hosting).
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: "Reference: Provider List | Observability | Mastra Docs"
|
|
3
|
-
description: Overview of observability providers supported by Mastra, including Dash0, SigNoz, Braintrust, Langfuse, and more.
|
|
3
|
+
description: Overview of observability providers supported by Mastra, including Arize AX, Arize Phoenix, Dash0, SigNoz, Braintrust, Langfuse, and more.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Observability Providers
|
|
7
7
|
|
|
8
8
|
Observability providers include:
|
|
9
9
|
|
|
10
|
+
- [Arize AX](./providers/arize-ax.mdx)
|
|
11
|
+
- [Arize Phoenix](./providers/arize-phoenix.mdx)
|
|
10
12
|
- [Braintrust](./providers/braintrust.mdx)
|
|
11
13
|
- [Dash0](./providers/dash0.mdx)
|
|
12
14
|
- [Laminar](./providers/laminar.mdx)
|