@mastra/mcp-docs-server 1.2.17-alpha.9 → 1.2.18-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/course/02-agent-tools-mcp/32-conclusion.md +1 -1
- package/.docs/docs/agents/code-mode.md +3 -3
- package/.docs/docs/agents/guardrails.md +1 -1
- package/.docs/docs/agents/{agent-approval.md → human-in-the-loop.md} +5 -5
- package/.docs/docs/agents/networks.md +3 -3
- package/.docs/docs/agents/overview.md +7 -7
- package/.docs/docs/agents/processors.md +3 -3
- package/.docs/docs/agents/{using-tools.md → tools.md} +7 -7
- package/.docs/docs/{server/auth → auth}/custom-auth-provider.md +1 -1
- package/.docs/docs/{server/auth → auth}/fga.md +27 -1
- package/.docs/docs/{server/auth.md → auth/overview.md} +4 -4
- package/.docs/docs/{server/auth → auth}/simple-auth.md +1 -1
- package/.docs/docs/{server/auth → auth}/workers.md +2 -2
- package/.docs/docs/{capabilities/channels.md → channels.md} +2 -2
- package/.docs/docs/{agents → connections}/a2a.md +2 -2
- package/.docs/docs/{agents → connections}/acp.md +18 -6
- package/.docs/docs/{mcp/overview.md → connections/mcp.md} +1 -1
- package/.docs/docs/connections/overview.md +5 -5
- package/.docs/docs/{agents → connections}/sdk-agents.md +3 -1
- package/.docs/docs/deployment/cloud-providers.md +1 -0
- package/.docs/docs/deployment/mastra-server.md +2 -2
- package/.docs/docs/deployment/overview.md +2 -1
- package/.docs/docs/deployment/sandbox.md +3 -3
- package/.docs/docs/deployment/workers.md +4 -4
- package/.docs/docs/guides/context-engineering.md +297 -0
- package/.docs/docs/guides/multi-agent-systems.md +7 -7
- package/.docs/docs/guides/streaming.md +1 -1
- package/.docs/docs/harness/agent-controller.md +5 -3
- package/.docs/docs/{long-running-agents → harness}/background-tasks.md +5 -5
- package/.docs/docs/{long-running-agents → harness}/durable-agents.md +18 -2
- package/.docs/docs/{long-running-agents → harness}/goals.md +6 -6
- package/.docs/docs/harness/overview.md +11 -10
- package/.docs/docs/{long-running-agents → harness}/schedules.md +5 -5
- package/.docs/docs/{long-running-agents → harness}/signal-providers.md +4 -4
- package/.docs/docs/mastra-platform/deploy.md +1 -1
- package/.docs/docs/mastra-platform/overview.md +1 -1
- package/.docs/docs/mastra-platform/server.md +1 -1
- package/.docs/docs/memory/message-history.md +1 -1
- package/.docs/docs/memory/overview.md +4 -4
- package/.docs/docs/memory/working-memory.md +1 -1
- package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
- package/.docs/docs/{workspace → sandbox}/filesystem.md +2 -2
- package/.docs/docs/{workspace → sandbox}/lsp.md +3 -3
- package/.docs/docs/{workspace/sandbox.md → sandbox/overview.md} +4 -3
- package/.docs/docs/{workspace → sandbox}/search.md +2 -2
- package/.docs/docs/{workspace → sandbox}/skills.md +5 -5
- package/.docs/docs/server/custom-api-routes.md +2 -2
- package/.docs/docs/server/mastra-client.md +2 -2
- package/.docs/docs/server/{mastra-server.md → overview.md} +3 -3
- package/.docs/docs/server/pubsub.md +2 -2
- package/.docs/docs/server/server-adapters.md +4 -4
- package/.docs/docs/{agents/skills.md → skills.md} +4 -4
- package/.docs/docs/{storage/overview.md → storage.md} +2 -1
- package/.docs/docs/studio/auth.md +4 -4
- package/.docs/docs/studio/overview.md +2 -2
- package/.docs/docs/{capabilities/subagents.md → subagents.md} +35 -5
- package/.docs/docs/workflows/agents-and-tools.md +1 -1
- package/.docs/docs/workflows/control-flow.md +0 -4
- package/.docs/docs/workflows/human-in-the-loop.md +0 -4
- package/.docs/docs/workflows/overview.md +1 -1
- package/.docs/docs/workflows/scheduled-workflows.md +2 -2
- package/.docs/docs/workflows/snapshots.md +1 -1
- package/.docs/docs/workflows/suspend-and-resume.md +0 -4
- package/.docs/integrations/agentic-ui/ai-sdk-ui.md +1 -1
- package/.docs/integrations/agentic-ui/copilotkit.md +1 -1
- package/.docs/integrations/auth/google.md +2 -2
- package/.docs/integrations/auth/workos.md +1 -1
- package/.docs/integrations/browsers/agent-browser.md +2 -2
- package/.docs/integrations/browsers/browser-viewer.md +6 -6
- package/.docs/integrations/browsers/firecrawl.md +1 -1
- package/.docs/integrations/browsers/stagehand.md +2 -2
- package/.docs/integrations/channels/discord.md +2 -2
- package/.docs/integrations/channels/github.md +1 -1
- package/.docs/integrations/channels/imessage.md +4 -4
- package/.docs/integrations/channels/slack.md +5 -5
- package/.docs/integrations/channels/teams.md +2 -2
- package/.docs/integrations/channels/telegram.md +2 -2
- package/.docs/integrations/channels/whatsapp.md +2 -2
- package/.docs/integrations/databases/postgresql.md +1 -0
- package/.docs/integrations/deploy/amazon-ec2.md +2 -2
- package/.docs/integrations/deploy/aws-lambda.md +3 -3
- package/.docs/integrations/deploy/azure-app-services.md +2 -2
- package/.docs/integrations/deploy/cloudflare.md +2 -2
- package/.docs/integrations/deploy/digital-ocean.md +3 -3
- package/.docs/integrations/deploy/kubernetes.md +11 -11
- package/.docs/integrations/deploy/netlify.md +3 -3
- package/.docs/integrations/deploy/render.md +389 -0
- package/.docs/integrations/deploy/vercel.md +2 -2
- package/.docs/integrations/file-storage/amazon-s3.md +1 -1
- package/.docs/integrations/file-storage/azure-blob.md +1 -1
- package/.docs/integrations/file-storage/google-cloud-storage.md +1 -1
- package/.docs/integrations/file-storage/mesa.md +2 -2
- package/.docs/integrations/file-storage/vercel-files.md +1 -1
- package/.docs/integrations/frameworks/astro.md +6 -2
- package/.docs/integrations/frameworks/electron.md +1 -1
- package/.docs/integrations/frameworks/express.md +1 -1
- package/.docs/integrations/frameworks/hono.md +1 -1
- package/.docs/integrations/frameworks/nestjs.md +1 -1
- package/.docs/integrations/frameworks/next-js.md +6 -2
- package/.docs/integrations/frameworks/nuxt.md +1 -1
- package/.docs/integrations/frameworks/sveltekit.md +1 -1
- package/.docs/integrations/frameworks/vite-react.md +6 -2
- package/.docs/integrations/sandboxes/agentcore.md +1 -1
- package/.docs/integrations/sandboxes/apple-container.md +1 -1
- package/.docs/integrations/sandboxes/cloudflare-sandbox.md +118 -0
- package/.docs/integrations/sandboxes/daytona.md +1 -1
- package/.docs/integrations/sandboxes/docker.md +4 -3
- package/.docs/integrations/sandboxes/e2b.md +1 -1
- package/.docs/integrations/sandboxes/modal.md +1 -1
- package/.docs/integrations/sandboxes/railway.md +11 -0
- package/.docs/integrations.md +4 -0
- package/.docs/models/environment-variables.md +9 -2
- package/.docs/models/gateways/merge-gateway.md +212 -0
- package/.docs/models/gateways/openrouter.md +3 -1
- package/.docs/models/gateways/vercel.md +22 -1
- package/.docs/models/gateways.md +1 -0
- package/.docs/models/index.md +1 -1
- package/.docs/models/providers/alibaba-token-plan-cn.md +2 -1
- package/.docs/models/providers/alibaba-token-plan.md +2 -1
- package/.docs/models/providers/ambient.md +2 -2
- package/.docs/models/providers/amd.md +73 -0
- package/.docs/models/providers/arcee.md +79 -0
- package/.docs/models/providers/baseten.md +1 -1
- package/.docs/models/providers/cerebras.md +2 -3
- package/.docs/models/providers/chutes.md +2 -1
- package/.docs/models/providers/cloudflare-workers-ai.md +3 -2
- package/.docs/models/providers/cortecs.md +2 -1
- package/.docs/models/providers/crof.md +1 -1
- package/.docs/models/providers/crossmodel.md +3 -2
- package/.docs/models/providers/deepinfra.md +5 -1
- package/.docs/models/providers/digitalocean.md +3 -2
- package/.docs/models/providers/echo.md +73 -0
- package/.docs/models/providers/edenai.md +26 -11
- package/.docs/models/providers/empiriolabs.md +11 -1
- package/.docs/models/providers/hetzner.md +6 -8
- package/.docs/models/providers/huggingface.md +4 -1
- package/.docs/models/providers/hyper.md +8 -7
- package/.docs/models/providers/inferx.md +19 -13
- package/.docs/models/providers/jalapeno.md +89 -0
- package/.docs/models/providers/kilo.md +12 -11
- package/.docs/models/providers/kosmik.md +73 -0
- package/.docs/models/providers/llmgateway.md +3 -3
- package/.docs/models/providers/llmtr.md +35 -10
- package/.docs/models/providers/nano-gpt.md +13 -17
- package/.docs/models/providers/ofox.md +8 -4
- package/.docs/models/providers/opencode-go.md +23 -22
- package/.docs/models/providers/requesty.md +143 -53
- package/.docs/models/providers/runinfra.md +76 -0
- package/.docs/models/providers/sakana.md +3 -2
- package/.docs/models/providers/scnet-token-plan.md +85 -0
- package/.docs/models/providers/scx-ai.md +76 -0
- package/.docs/models/providers/togetherai.md +2 -1
- package/.docs/models/providers/umans-ai-coding-plan.md +2 -1
- package/.docs/models/providers/umans-ai.md +2 -1
- package/.docs/models/providers/vivgrid.md +2 -1
- package/.docs/models/providers/wandb.md +2 -1
- package/.docs/models/providers/xai.md +2 -1
- package/.docs/models/providers.md +8 -2
- package/.docs/reference/acp/acp-agent.md +2 -2
- package/.docs/reference/acp/create-acp-tool.md +1 -1
- package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
- package/.docs/reference/agents/agent.md +2 -2
- package/.docs/reference/agents/channels.md +2 -2
- package/.docs/reference/agents/createSkill.md +2 -2
- package/.docs/reference/agents/durable-agent.md +1 -1
- package/.docs/reference/agents/generate.md +3 -1
- package/.docs/reference/agents/getSkill.md +1 -1
- package/.docs/reference/agents/listSkills.md +1 -1
- package/.docs/reference/agents/listSuspendedRuns.md +6 -6
- package/.docs/reference/agents/listTools.md +2 -2
- package/.docs/reference/agents/network.md +3 -1
- package/.docs/reference/ai-sdk/chat-route.md +1 -1
- package/.docs/reference/ai-sdk/handle-chat-stream.md +1 -1
- package/.docs/reference/ai-sdk/handle-network-stream.md +2 -2
- package/.docs/reference/ai-sdk/handle-workflow-stream.md +1 -1
- package/.docs/reference/ai-sdk/network-route.md +2 -2
- package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +1 -1
- package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +1 -1
- package/.docs/reference/ai-sdk/workflow-route.md +1 -1
- package/.docs/reference/auth/fga.md +7 -5
- package/.docs/reference/auth/jwt.md +1 -1
- package/.docs/reference/browser/agent-browser.md +2 -2
- package/.docs/reference/browser/browser-viewer.md +2 -2
- package/.docs/reference/browser/firecrawl-browser.md +1 -1
- package/.docs/reference/browser/mastra-browser.md +1 -1
- package/.docs/reference/browser/stagehand-browser.md +2 -2
- package/.docs/reference/build-with-ai.md +2 -2
- package/.docs/reference/channels/channel-provider.md +1 -1
- package/.docs/reference/channels/slack-provider.md +1 -1
- package/.docs/reference/cli/mastra.md +2 -0
- package/.docs/reference/client-js/agents.md +24 -4
- package/.docs/reference/coding-agent/create-coding-agent.md +142 -13
- package/.docs/reference/configuration.md +6 -6
- package/.docs/reference/core/getEditor.md +1 -1
- package/.docs/reference/core/getMCPServer.md +1 -1
- package/.docs/reference/core/getMCPServerById.md +1 -1
- package/.docs/reference/core/getTool.md +1 -1
- package/.docs/reference/core/getToolById.md +1 -1
- package/.docs/reference/core/listMCPServers.md +1 -1
- package/.docs/reference/core/listTools.md +1 -1
- package/.docs/reference/core/removeWorkspace.md +1 -1
- package/.docs/reference/editor/mastra-editor.md +2 -2
- package/.docs/reference/editor/prompt-blocks.md +2 -2
- package/.docs/reference/editor/tool-provider.md +108 -1
- package/.docs/reference/editor/tools.md +1 -1
- package/.docs/reference/editor/versioning.md +3 -3
- package/.docs/reference/evals/prompt-alignment.md +18 -0
- package/.docs/reference/evals/rubric.md +1 -1
- package/.docs/reference/file-based-agents/memory.md +2 -2
- package/.docs/reference/file-based-agents/server.md +3 -3
- package/.docs/reference/file-based-agents/skills.md +1 -1
- package/.docs/reference/file-based-agents/storage.md +3 -3
- package/.docs/reference/file-based-agents/subagents.md +1 -1
- package/.docs/reference/file-based-agents/workspace.md +3 -3
- package/.docs/reference/index.md +1 -0
- package/.docs/reference/manual-install.md +3 -3
- package/.docs/reference/memory/memory-class.md +1 -0
- package/.docs/reference/memory/settled.md +57 -0
- package/.docs/reference/migrations/network-to-supervisor.md +2 -2
- package/.docs/reference/processors/provider-history-compat.md +6 -5
- package/.docs/reference/processors/skill-search-processor.md +3 -1
- package/.docs/reference/processors/token-limiter-processor.md +4 -0
- package/.docs/reference/processors/tool-call-filter.md +7 -7
- package/.docs/reference/processors/tool-search-processor.md +1 -1
- package/.docs/reference/project-structure.md +1 -1
- package/.docs/reference/pubsub/lease-provider.md +3 -3
- package/.docs/reference/pubsub/redis-streams.md +1 -1
- package/.docs/reference/rag/graph-rag.md +71 -8
- package/.docs/reference/rag/retrieval.md +26 -18
- package/.docs/reference/schedules/overview.md +1 -1
- package/.docs/reference/streaming/ChunkType.md +2 -2
- package/.docs/reference/streaming/agents/stream.md +29 -4
- package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
- package/.docs/reference/tools/ask-user-tool.md +1 -1
- package/.docs/reference/tools/create-code-mode.md +1 -1
- package/.docs/reference/tools/create-tool.md +4 -4
- package/.docs/reference/tools/mcp-client.md +2 -0
- package/.docs/reference/tools/mcp-server.md +97 -4
- package/.docs/reference/tools/submit-plan-tool.md +1 -1
- package/.docs/reference/tools/task-tools.md +2 -2
- package/.docs/reference/vectors/vectorize.md +12 -2
- package/.docs/reference/workers/overview.md +2 -2
- package/.docs/reference/workflows/run-methods/resume.md +21 -0
- package/.docs/reference/workspace/local-filesystem.md +1 -1
- package/.docs/reference/workspace/local-sandbox.md +4 -3
- package/.docs/reference/workspace/platform-sandbox.md +11 -0
- package/.docs/reference/workspace/process-manager.md +20 -4
- package/.docs/reference/workspace/sandbox.md +1 -1
- package/.docs/reference/workspace/workspace-class.md +5 -5
- package/CHANGELOG.md +81 -0
- package/package.json +6 -6
- package/.docs/models/providers/merge-gateway.md +0 -265
- /package/.docs/docs/{server/auth → auth}/composite-auth.md +0 -0
- /package/.docs/docs/{server/auth → auth}/jwt.md +0 -0
- /package/.docs/docs/{browser/overview.md → browser.md} +0 -0
- /package/.docs/docs/{getting-started/develop.md → develop.md} +0 -0
- /package/.docs/docs/{long-running-agents → harness}/signals.md +0 -0
- /package/.docs/docs/{editor/overview.md → studio/editor.md} +0 -0
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
> Discover all available pages from the documentation index: https://mastra.ai/llms.txt
|
|
2
|
+
|
|
3
|
+
# Render
|
|
4
|
+
|
|
5
|
+
Deploy Mastra applications on [Render](https://render.com/). Host the Mastra API as a [web service](https://render.com/docs/web-services), or use [Render Workflows](https://render.com/docs/workflows) for long-running tasks with independent retry policies.
|
|
6
|
+
|
|
7
|
+
Choose the deployment path that fits your application:
|
|
8
|
+
|
|
9
|
+
- **Mastra API**: Deploy Mastra's [server](https://mastra.ai/docs/server/overview) as a web service with a public endpoint. The [Web Services guide](https://render.com/docs/web-services) explains how to deploy custom code or a supported [server adapter](https://mastra.ai/docs/server/server-adapters).
|
|
10
|
+
- **Mastra workflow**: Run an entire Mastra workflow within one task. Render controls the outer run, while Mastra manages its steps and state. See [Defining Workflow Tasks](https://render.com/docs/workflows-defining) for configuration details.
|
|
11
|
+
- **Distributed agent operations**: Give each operation its own compute plan, timeout, and retry policy. Render Workflows handles the execution queue and provides run observability.
|
|
12
|
+
|
|
13
|
+
This guide builds an editorial pipeline that reviews a draft from three perspectives in parallel, then passes the feedback to an editor agent. Use the links above if you want to deploy a Mastra API or execute an entire Mastra workflow as one task.
|
|
14
|
+
|
|
15
|
+
## How Render Workflows integrates with Mastra
|
|
16
|
+
|
|
17
|
+
Mastra supplies the agents and application logic, while Render Workflows defines the execution boundaries. A typical pipeline has three layers:
|
|
18
|
+
|
|
19
|
+
1. A parent task coordinates the run.
|
|
20
|
+
2. Child tasks invoke Mastra agents for focused work.
|
|
21
|
+
3. A final task combines the results.
|
|
22
|
+
|
|
23
|
+
Calling one task from another creates a chained run in a separate instance, with its own compute plan, timeout, and retry policy.
|
|
24
|
+
|
|
25
|
+
## Setup
|
|
26
|
+
|
|
27
|
+
Create an empty Mastra project named `render-workflows`:
|
|
28
|
+
|
|
29
|
+
**npm**:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm create mastra@latest render-workflows -- --empty
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**pnpm**:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pnpm create mastra render-workflows --empty
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**Yarn**:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
yarn create mastra render-workflows --empty
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Bun**:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bunx create-mastra render-workflows --empty
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Install two additional dependencies:
|
|
54
|
+
|
|
55
|
+
**npm**:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npm install @renderinc/sdk tsx
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**pnpm**:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pnpm add @renderinc/sdk tsx
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Yarn**:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
yarn add @renderinc/sdk tsx
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Bun**:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bun add @renderinc/sdk tsx
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Add your API key to an `.env` file. This example uses OpenAI, but any supported [model provider](https://mastra.ai/models) works.
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
OPENAI_API_KEY=your_openai_api_key
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Install the [Render CLI](https://render.com/docs/cli) to run workflow commands from your terminal.
|
|
86
|
+
|
|
87
|
+
## Distributed agent pipeline
|
|
88
|
+
|
|
89
|
+
### Create the agents
|
|
90
|
+
|
|
91
|
+
In `src/mastra`, create an `agents` directory with `reviewer-agent.ts` and `editor-agent.ts`. Define both agents:
|
|
92
|
+
|
|
93
|
+
```ts
|
|
94
|
+
import { Agent } from '@mastra/core/agent'
|
|
95
|
+
|
|
96
|
+
export const reviewerAgent = new Agent({
|
|
97
|
+
id: 'reviewer-agent',
|
|
98
|
+
name: 'Reviewer Agent',
|
|
99
|
+
model: 'openai/gpt-5.6-sol',
|
|
100
|
+
instructions: `
|
|
101
|
+
Review the supplied draft only from the requested perspective.
|
|
102
|
+
Identify concrete problems and recommend specific changes.
|
|
103
|
+
Do not rewrite the full draft.
|
|
104
|
+
`,
|
|
105
|
+
})
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
```ts
|
|
109
|
+
import { Agent } from '@mastra/core/agent'
|
|
110
|
+
|
|
111
|
+
export const editorAgent = new Agent({
|
|
112
|
+
id: 'editor-agent',
|
|
113
|
+
name: 'Editor Agent',
|
|
114
|
+
model: 'openai/gpt-5.6-sol',
|
|
115
|
+
instructions: `
|
|
116
|
+
Revise the supplied draft using the reviewers' feedback.
|
|
117
|
+
Return the complete revised draft and nothing else.
|
|
118
|
+
Preserve accurate details and do not introduce unsupported claims.
|
|
119
|
+
`,
|
|
120
|
+
})
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Configure the Mastra instance
|
|
124
|
+
|
|
125
|
+
Add both agents to the Mastra instance in `src/mastra/index.ts`:
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import { Mastra } from '@mastra/core/mastra'
|
|
129
|
+
import { editorAgent } from './agents/editor-agent.js'
|
|
130
|
+
import { reviewerAgent } from './agents/reviewer-agent.js'
|
|
131
|
+
|
|
132
|
+
export const mastra = new Mastra({
|
|
133
|
+
agents: {
|
|
134
|
+
editorAgent,
|
|
135
|
+
reviewerAgent,
|
|
136
|
+
},
|
|
137
|
+
})
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Create the tasks
|
|
141
|
+
|
|
142
|
+
In `src`, create a `tasks` directory with `review-task.ts`, `revision-task.ts`, and `editorial-task.ts`.
|
|
143
|
+
|
|
144
|
+
#### Review task
|
|
145
|
+
|
|
146
|
+
The reviewer agent handles one area of focus. Its compute plan, five-minute timeout, and retry policy apply only to that analysis. A temporary model-provider failure can trigger another attempt without restarting the other reviewers.
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
import { task } from '@renderinc/sdk/workflows'
|
|
150
|
+
import { mastra } from '../mastra/index.js'
|
|
151
|
+
|
|
152
|
+
type Review = {
|
|
153
|
+
focus: string
|
|
154
|
+
feedback: string
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export const reviewDraft = task(
|
|
158
|
+
{
|
|
159
|
+
name: 'review_draft',
|
|
160
|
+
plan: 'starter',
|
|
161
|
+
timeoutSeconds: 300,
|
|
162
|
+
retry: {
|
|
163
|
+
maxRetries: 2,
|
|
164
|
+
waitDurationMs: 1_000,
|
|
165
|
+
backoffScaling: 2,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
async function reviewDraft(draft: string, focus: string): Promise<Review> {
|
|
169
|
+
const reviewer = mastra.getAgentById('reviewer-agent')
|
|
170
|
+
const response = await reviewer.generate(`
|
|
171
|
+
Review this draft for ${focus}.
|
|
172
|
+
Draft: ${draft}
|
|
173
|
+
`)
|
|
174
|
+
if (!response.text) {
|
|
175
|
+
throw new Error(`The ${focus} review returned no text`)
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
focus,
|
|
179
|
+
feedback: response.text,
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
)
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
#### Revision task
|
|
186
|
+
|
|
187
|
+
This task combines the feedback and produces a revised draft. It uses a larger compute plan and a longer timeout than each reviewer.
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
import { task } from '@renderinc/sdk/workflows'
|
|
191
|
+
import { mastra } from '../mastra/index.js'
|
|
192
|
+
|
|
193
|
+
type Review = {
|
|
194
|
+
focus: string
|
|
195
|
+
feedback: string
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export const reviseDraft = task(
|
|
199
|
+
{
|
|
200
|
+
name: 'revise_draft',
|
|
201
|
+
plan: 'standard',
|
|
202
|
+
timeoutSeconds: 600,
|
|
203
|
+
retry: {
|
|
204
|
+
maxRetries: 2,
|
|
205
|
+
waitDurationMs: 1_000,
|
|
206
|
+
backoffScaling: 2,
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
async function reviseDraft(draft: string, reviews: Review[]): Promise<{ draft: string }> {
|
|
210
|
+
const editor = mastra.getAgentById('editor-agent')
|
|
211
|
+
const response = await editor.generate(`
|
|
212
|
+
Revise the draft using the review feedback.
|
|
213
|
+
Draft: ${draft}
|
|
214
|
+
Reviews: ${JSON.stringify(reviews, null, 2)}
|
|
215
|
+
`)
|
|
216
|
+
if (!response.text) {
|
|
217
|
+
throw new Error('The editor returned no text')
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
draft: response.text,
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
#### Editorial task
|
|
227
|
+
|
|
228
|
+
The parent dispatches three reviews in parallel with `Promise.all()`, then sends their combined feedback to the revision step. Retries are disabled at this level because each child defines its own policy. If you enable orchestration retries, ensure that another attempt can't duplicate external side effects or other non-idempotent work.
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
import { task } from '@renderinc/sdk/workflows'
|
|
232
|
+
import { reviewDraft } from './review-task.js'
|
|
233
|
+
import { reviseDraft } from './revision-task.js'
|
|
234
|
+
|
|
235
|
+
export const editorialPipeline = task(
|
|
236
|
+
{
|
|
237
|
+
name: 'editorial_pipeline',
|
|
238
|
+
plan: 'starter',
|
|
239
|
+
timeoutSeconds: 1_200,
|
|
240
|
+
retry: {
|
|
241
|
+
maxRetries: 0,
|
|
242
|
+
waitDurationMs: 1_000,
|
|
243
|
+
backoffScaling: 2,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
async function editorialPipeline(draft: string): Promise<{ draft: string }> {
|
|
247
|
+
const focuses = ['technical clarity', 'structure and flow', 'reader usefulness']
|
|
248
|
+
const reviews = await Promise.all(focuses.map(focus => reviewDraft(draft, focus)))
|
|
249
|
+
return reviseDraft(draft, reviews)
|
|
250
|
+
},
|
|
251
|
+
)
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
### Set up the entry point
|
|
255
|
+
|
|
256
|
+
Create `src/index.ts` and import the editorial task:
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
import './tasks/editorial-task.js'
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
In `package.json`, add scripts to build the TypeScript project and run the workflow:
|
|
263
|
+
|
|
264
|
+
```json
|
|
265
|
+
{
|
|
266
|
+
"scripts": {
|
|
267
|
+
"build": "tsc",
|
|
268
|
+
"dev:workflows": "tsx src/index.ts",
|
|
269
|
+
"start:workflows": "node dist/index.js"
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Configure `tsconfig.json` for the build:
|
|
275
|
+
|
|
276
|
+
```json
|
|
277
|
+
{
|
|
278
|
+
"compilerOptions": {
|
|
279
|
+
"target": "ES2022",
|
|
280
|
+
"module": "NodeNext",
|
|
281
|
+
"moduleResolution": "NodeNext",
|
|
282
|
+
"rootDir": "src",
|
|
283
|
+
"outDir": "dist",
|
|
284
|
+
"strict": true,
|
|
285
|
+
"esModuleInterop": true,
|
|
286
|
+
"skipLibCheck": true
|
|
287
|
+
},
|
|
288
|
+
"include": ["src/**/*"]
|
|
289
|
+
}
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
Build the project. The command compiles the JavaScript files into `dist`.
|
|
293
|
+
|
|
294
|
+
**npm**:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
npm run build
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**pnpm**:
|
|
301
|
+
|
|
302
|
+
```bash
|
|
303
|
+
pnpm run build
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
**Yarn**:
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
yarn build
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
**Bun**:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
bun run build
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Run the pipeline
|
|
319
|
+
|
|
320
|
+
### Locally
|
|
321
|
+
|
|
322
|
+
Start the local development server with the Render CLI:
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
render workflows dev -- npm run dev:workflows
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
The server lists the registered tasks:
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
➜ render workflows dev -- npm run dev:workflows
|
|
332
|
+
Workflow server listening on port 8120
|
|
333
|
+
Loaded environment variables from .env
|
|
334
|
+
3 tasks found in npm run dev:workflows
|
|
335
|
+
• editorial_pipeline
|
|
336
|
+
• review_draft
|
|
337
|
+
• revise_draft
|
|
338
|
+
|
|
339
|
+
To browse and run tasks, open another terminal and run:
|
|
340
|
+
render workflows tasks list --local
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
In another terminal, confirm that the tasks are available:
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
render workflows tasks list --local
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
The command displays each task's name, ID, and creation time. Press `Ctrl+C`, then start the editorial pipeline from the same terminal:
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
render workflows tasks runs start editorial_pipeline \
|
|
353
|
+
--local \
|
|
354
|
+
--input='["Render Workflows runs long-running tasks outside the request lifecycle."]'
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
The development server records the parent run, three parallel reviews, and the final revision.
|
|
358
|
+
|
|
359
|
+
### Production
|
|
360
|
+
|
|
361
|
+
Create a workflow service from the current repository:
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
render workflows create \
|
|
365
|
+
--name mastra-workflows \
|
|
366
|
+
--repo . \
|
|
367
|
+
--runtime node \
|
|
368
|
+
--build-command "npm install && npm run build" \
|
|
369
|
+
--run-command "npm run start:workflows"
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
Add `OPENAI_API_KEY`, or the key for your chosen model provider, to the service's environment variables.
|
|
373
|
+
|
|
374
|
+
After deployment, start a production run. If needed, replace `mastra-workflows/editorial_pipeline` with the task slug shown in the Render Dashboard.
|
|
375
|
+
|
|
376
|
+
```bash
|
|
377
|
+
render workflows tasks start mastra-workflows/editorial_pipeline \
|
|
378
|
+
--input='["Render Workflows runs long-running tasks outside the request lifecycle."]'
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
Open the workflow service in the Render Dashboard to inspect each task run, attempt, result, and log stream.
|
|
382
|
+
|
|
383
|
+
## Related
|
|
384
|
+
|
|
385
|
+
- [Render Workflows documentation](https://render.com/docs/workflows)
|
|
386
|
+
- [Defining Render workflow tasks](https://render.com/docs/workflows-defining)
|
|
387
|
+
- [Triggering task runs](https://render.com/docs/workflows-running)
|
|
388
|
+
- [Render Workflows TypeScript SDK](https://render.com/docs/workflows-sdk-typescript)
|
|
389
|
+
- [Render Workflows limits and pricing](https://render.com/docs/workflows-limits)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Use `@mastra/deployer-vercel` to deploy your Mastra server as serverless functions on Vercel. The deployer bundles your code and generates a `.vercel/output` directory conforming to Vercel's [Build Output API](https://vercel.com/docs/build-output-api/v3), ready to deploy with no additional configuration.
|
|
6
6
|
|
|
7
|
-
> **Note:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/
|
|
7
|
+
> **Note:** This guide covers deploying the [Mastra server](https://mastra.ai/docs/server/overview). If you're using a [server adapter](https://mastra.ai/docs/server/server-adapters) or [web framework](https://mastra.ai/docs/deployment/web-framework), deploy the way you normally would for that framework.
|
|
8
8
|
|
|
9
9
|
## Before you begin
|
|
10
10
|
|
|
@@ -67,7 +67,7 @@ export const mastra = new Mastra({
|
|
|
67
67
|
|
|
68
68
|
4. You can now call your Mastra endpoints over HTTP.
|
|
69
69
|
|
|
70
|
-
> **Warning:** Set up [authentication](https://mastra.ai/docs/
|
|
70
|
+
> **Warning:** Set up [authentication](https://mastra.ai/docs/auth/overview) before exposing your endpoints publicly.
|
|
71
71
|
|
|
72
72
|
## Studio
|
|
73
73
|
|
|
@@ -271,4 +271,4 @@ See [E2BSandbox reference](https://mastra.ai/integrations/sandboxes/e2b) for mor
|
|
|
271
271
|
- [GCSFilesystem reference](https://mastra.ai/integrations/file-storage/google-cloud-storage)
|
|
272
272
|
- [AzureBlobFilesystem reference](https://mastra.ai/integrations/file-storage/azure-blob)
|
|
273
273
|
- [E2BSandbox reference](https://mastra.ai/integrations/sandboxes/e2b)
|
|
274
|
-
- [Filesystem](https://mastra.ai/docs/
|
|
274
|
+
- [Filesystem](https://mastra.ai/docs/sandbox/filesystem)
|
|
@@ -217,4 +217,4 @@ const config = filesystem.getMountConfig()
|
|
|
217
217
|
- [WorkspaceFilesystem interface](https://mastra.ai/reference/workspace/filesystem)
|
|
218
218
|
- [S3Filesystem reference](https://mastra.ai/integrations/file-storage/amazon-s3)
|
|
219
219
|
- [GCSFilesystem reference](https://mastra.ai/integrations/file-storage/google-cloud-storage)
|
|
220
|
-
- [Filesystem](https://mastra.ai/docs/
|
|
220
|
+
- [Filesystem](https://mastra.ai/docs/sandbox/filesystem)
|
|
@@ -194,4 +194,4 @@ See [E2BSandbox reference](https://mastra.ai/integrations/sandboxes/e2b) for mor
|
|
|
194
194
|
- [S3Filesystem reference](https://mastra.ai/integrations/file-storage/amazon-s3)
|
|
195
195
|
- [AzureBlobFilesystem reference](https://mastra.ai/integrations/file-storage/azure-blob)
|
|
196
196
|
- [E2BSandbox reference](https://mastra.ai/integrations/sandboxes/e2b)
|
|
197
|
-
- [Filesystem](https://mastra.ai/docs/
|
|
197
|
+
- [Filesystem](https://mastra.ai/docs/sandbox/filesystem)
|
|
@@ -316,6 +316,6 @@ Read operations still work. Write operations throw `WorkspaceReadOnlyError`.
|
|
|
316
316
|
## Related
|
|
317
317
|
|
|
318
318
|
- [WorkspaceFilesystem interface](https://mastra.ai/reference/workspace/filesystem)
|
|
319
|
-
- [Filesystem docs](https://mastra.ai/docs/
|
|
320
|
-
- [Sandbox](https://mastra.ai/docs/
|
|
319
|
+
- [Filesystem docs](https://mastra.ai/docs/sandbox/filesystem)
|
|
320
|
+
- [Sandbox](https://mastra.ai/docs/sandbox/overview)
|
|
321
321
|
- [Mesa documentation](https://docs.mesa.dev/content/getting-started/introduction)
|
|
@@ -184,5 +184,5 @@ const url = await filesystem.files.url('reports/q3.pdf')
|
|
|
184
184
|
- [S3Filesystem reference](https://mastra.ai/integrations/file-storage/amazon-s3)
|
|
185
185
|
- [GCSFilesystem reference](https://mastra.ai/integrations/file-storage/google-cloud-storage)
|
|
186
186
|
- [AzureBlobFilesystem reference](https://mastra.ai/integrations/file-storage/azure-blob)
|
|
187
|
-
- [Filesystem](https://mastra.ai/docs/
|
|
187
|
+
- [Filesystem](https://mastra.ai/docs/sandbox/filesystem)
|
|
188
188
|
- [FilesSDK documentation](https://files-sdk.dev)
|
|
@@ -153,7 +153,7 @@ yarn add @mastra/ai-sdk@latest @ai-sdk/react ai
|
|
|
153
153
|
bun add @mastra/ai-sdk@latest @ai-sdk/react ai
|
|
154
154
|
```
|
|
155
155
|
|
|
156
|
-
Next, initialize AI Elements. When prompted, choose the
|
|
156
|
+
Next, initialize AI Elements. When prompted to select a component library, choose **Radix UI**, then accept the defaults for the remaining prompts:
|
|
157
157
|
|
|
158
158
|
**npm**:
|
|
159
159
|
|
|
@@ -179,6 +179,10 @@ yarn dlx ai-elements@latest
|
|
|
179
179
|
bun x ai-elements@latest
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
+
> **Note:** The `ai-elements` command runs `shadcn add` against the AI Elements registry, which currently publishes Radix UI components only. Installing them into a Base UI project produces TypeScript errors, tracked in [vercel/ai-elements#383](https://github.com/vercel/ai-elements/issues/383).
|
|
183
|
+
>
|
|
184
|
+
> The component library prompt only appears when your project has no `components.json`. If you already have one, check that its `style` is a Radix option, such as `new-york` or a `radix-*` style, and not a `base-*` style, before running the command.
|
|
185
|
+
|
|
182
186
|
This downloads the entire AI Elements UI component library into a `@/components/ai-elements` folder.
|
|
183
187
|
|
|
184
188
|
## Create a chat route
|
|
@@ -391,7 +395,7 @@ Congratulations on building your Mastra agent with Astro! 🎉
|
|
|
391
395
|
From here, you can extend the project with your own tools and logic:
|
|
392
396
|
|
|
393
397
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
394
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
398
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
395
399
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
396
400
|
|
|
397
401
|
When you're ready, read more about how Mastra integrates with AI SDK UI and how to deploy your agent anywhere:
|
|
@@ -497,7 +497,7 @@ Congratulations on building your Mastra agent with Electron! 🎉
|
|
|
497
497
|
From here, you can extend the project with your own tools and logic:
|
|
498
498
|
|
|
499
499
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
500
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
500
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
501
501
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
502
502
|
|
|
503
503
|
When you're ready, read more about how Mastra integrates with AI SDK UI and React, and how to deploy your agent anywhere:
|
|
@@ -245,7 +245,7 @@ Congratulations on building your Mastra agent with Express! 🎉
|
|
|
245
245
|
From here, you can extend the project with your own tools and logic:
|
|
246
246
|
|
|
247
247
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
248
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
248
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
249
249
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
250
250
|
|
|
251
251
|
When you're ready, read more about how Mastra integrates with Express:
|
|
@@ -184,7 +184,7 @@ Congratulations on building your Mastra agent with Hono! 🎉
|
|
|
184
184
|
From here, you can extend the project with your own tools and logic:
|
|
185
185
|
|
|
186
186
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
187
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
187
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
188
188
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
189
189
|
|
|
190
190
|
When you're ready, read more about how Mastra integrates with Hono:
|
|
@@ -232,7 +232,7 @@ Both approaches use the same singleton `Mastra` instance registered by `MastraMo
|
|
|
232
232
|
You now have a working Mastra agent running inside NestJS. To extend the project:
|
|
233
233
|
|
|
234
234
|
- [Agents overview](https://mastra.ai/docs/agents/overview)
|
|
235
|
-
- [Using tools](https://mastra.ai/docs/agents/
|
|
235
|
+
- [Using tools](https://mastra.ai/docs/agents/tools)
|
|
236
236
|
- [Agent memory](https://mastra.ai/docs/memory/overview)
|
|
237
237
|
|
|
238
238
|
For details on the NestJS integration:
|
|
@@ -121,7 +121,7 @@ yarn add @mastra/ai-sdk@latest @ai-sdk/react ai
|
|
|
121
121
|
bun add @mastra/ai-sdk@latest @ai-sdk/react ai
|
|
122
122
|
```
|
|
123
123
|
|
|
124
|
-
Next, initialize AI Elements. When prompted, choose the
|
|
124
|
+
Next, initialize AI Elements. When prompted to select a component library, choose **Radix UI**, then accept the defaults for the remaining prompts:
|
|
125
125
|
|
|
126
126
|
**npm**:
|
|
127
127
|
|
|
@@ -147,6 +147,10 @@ yarn dlx ai-elements@latest
|
|
|
147
147
|
bun x ai-elements@latest
|
|
148
148
|
```
|
|
149
149
|
|
|
150
|
+
> **Note:** The `ai-elements` command runs `shadcn add` against the AI Elements registry, which currently publishes Radix UI components only. Installing them into a Base UI project produces TypeScript errors, tracked in [vercel/ai-elements#383](https://github.com/vercel/ai-elements/issues/383).
|
|
151
|
+
>
|
|
152
|
+
> The component library prompt only appears when your project has no `components.json`. If you already have one, check that its `style` is a Radix option, such as `new-york` or a `radix-*` style, and not a `base-*` style, before running the command.
|
|
153
|
+
|
|
150
154
|
This downloads the entire AI Elements UI component library into a `@/components/ai-elements` folder.
|
|
151
155
|
|
|
152
156
|
## Create a chat route
|
|
@@ -335,7 +339,7 @@ Congratulations on building your Mastra agent with Next.js! 🎉
|
|
|
335
339
|
From here, you can extend the project with your own tools and logic:
|
|
336
340
|
|
|
337
341
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
338
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
342
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
339
343
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
340
344
|
|
|
341
345
|
When you're ready, read more about how Mastra integrates with AI SDK UI and Next.js, and how to deploy your agent anywhere, including Vercel:
|
|
@@ -490,7 +490,7 @@ Congratulations on building your Mastra agent with Nuxt! 🎉
|
|
|
490
490
|
From here, you can extend the project with your own tools and logic:
|
|
491
491
|
|
|
492
492
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
493
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
493
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
494
494
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
495
495
|
|
|
496
496
|
When you're ready, read more about how Mastra integrates with AI SDK UI and Nuxt, and how to deploy your agent anywhere:
|
|
@@ -288,7 +288,7 @@ Congratulations on building your Mastra agent with SvelteKit! 🎉
|
|
|
288
288
|
From here, you can extend the project with your own tools and logic:
|
|
289
289
|
|
|
290
290
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
291
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
291
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
292
292
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
293
293
|
|
|
294
294
|
When you're ready, read more about how Mastra integrates with AI SDK UI and SvelteKit, and how to deploy your agent anywhere:
|
|
@@ -196,7 +196,7 @@ yarn add @mastra/ai-sdk@latest @ai-sdk/react ai
|
|
|
196
196
|
bun add @mastra/ai-sdk@latest @ai-sdk/react ai
|
|
197
197
|
```
|
|
198
198
|
|
|
199
|
-
Next, initialize AI Elements. When prompted, choose the
|
|
199
|
+
Next, initialize AI Elements. When prompted to select a component library, choose **Radix UI**, then accept the defaults for the remaining prompts:
|
|
200
200
|
|
|
201
201
|
**npm**:
|
|
202
202
|
|
|
@@ -222,6 +222,10 @@ yarn dlx ai-elements@latest
|
|
|
222
222
|
bun x ai-elements@latest
|
|
223
223
|
```
|
|
224
224
|
|
|
225
|
+
> **Note:** The `ai-elements` command runs `shadcn add` against the AI Elements registry, which currently publishes Radix UI components only. Installing them into a Base UI project produces TypeScript errors, tracked in [vercel/ai-elements#383](https://github.com/vercel/ai-elements/issues/383).
|
|
226
|
+
>
|
|
227
|
+
> The component library prompt only appears when your project has no `components.json`. If you already have one, check that its `style` is a Radix option, such as `new-york` or a `radix-*` style, and not a `base-*` style, before running the command.
|
|
228
|
+
|
|
225
229
|
This downloads the entire AI Elements UI component library into a `@/components/ai-elements` folder.
|
|
226
230
|
|
|
227
231
|
## Create a chat route
|
|
@@ -418,7 +422,7 @@ Congratulations on building your Mastra agent with React! 🎉
|
|
|
418
422
|
From here, you can extend the project with your own tools and logic:
|
|
419
423
|
|
|
420
424
|
- Learn more about [agents](https://mastra.ai/docs/agents/overview)
|
|
421
|
-
- Give your agent its own [tools](https://mastra.ai/docs/agents/
|
|
425
|
+
- Give your agent its own [tools](https://mastra.ai/docs/agents/tools)
|
|
422
426
|
- Add human-like [memory](https://mastra.ai/docs/memory/overview) to your agent
|
|
423
427
|
|
|
424
428
|
When you're ready, read more about how Mastra integrates with AI SDK UI and React, and how to deploy your agent anywhere:
|
|
@@ -199,5 +199,5 @@ Returns: `Promise<SandboxInfo>`.
|
|
|
199
199
|
|
|
200
200
|
- [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox)
|
|
201
201
|
- [Workspace class](https://mastra.ai/reference/workspace/workspace-class)
|
|
202
|
-
- [Sandbox overview](https://mastra.ai/docs/
|
|
202
|
+
- [Sandbox overview](https://mastra.ai/docs/sandbox/overview)
|
|
203
203
|
- [AWS Bedrock AgentCore Runtime command execution](https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/runtime-execute-command.html)
|
|
@@ -254,4 +254,4 @@ const editor = new MastraEditor({
|
|
|
254
254
|
- [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox)
|
|
255
255
|
- [DockerSandbox reference](https://mastra.ai/integrations/sandboxes/docker)
|
|
256
256
|
- [LocalSandbox reference](https://mastra.ai/reference/workspace/local-sandbox)
|
|
257
|
-
- [Sandbox](https://mastra.ai/docs/
|
|
257
|
+
- [Sandbox](https://mastra.ai/docs/sandbox/overview)
|