### Guides Overview Source: https://mastra.ai/docs/getting-started/installation Overview of available guides for using Mastra, including agent, tool, and workflow examples. ```APIDOC ## Guides Overview ### Description Overview of available guides for using Mastra, including agent, tool, and workflow examples. ### Endpoints - **GET /en/guides** - Description: General overview of Mastra guides. ``` -------------------------------- ### Initialize Mastra Project with CLI (Bun) Source: https://mastra.ai/docs/getting-started/installation Starts the Mastra CLI wizard for project setup using Bun. ```bash bun create mastra@latest ``` -------------------------------- ### Install Mastra using CLI Source: https://mastra.ai/docs/getting-started/installation Use the create-mastra CLI for the quickest setup. This command can be run from any location on your machine. ```bash npx create mastra ``` -------------------------------- ### Initialize Mastra Project with CLI (PNPM) Source: https://mastra.ai/docs/getting-started/installation Starts the Mastra CLI wizard for project setup using PNPM. ```bash pnpm create mastra@latest ``` -------------------------------- ### Initialize Mastra Project with CLI (Yarn) Source: https://mastra.ai/docs/getting-started/installation Starts the Mastra CLI wizard for project setup using Yarn. ```bash yarn dlx create-mastra@latest ``` -------------------------------- ### Install Assistant UI with a Template Source: https://mastra.ai/docs/getting-started/installation Command to install Assistant UI using a specific pre-built template for demonstrating use cases. ```bash npx create-mastra@latest --template template-name ``` -------------------------------- ### Specific Guides Source: https://mastra.ai/docs/getting-started/installation Detailed guides on specific Mastra use cases, such as agents, tools, workflows, RAG, and MCP servers. ```APIDOC ## Specific Guides ### Description Detailed guides on specific Mastra use cases, such as agents, tools, workflows, RAG, and MCP servers. ### Guides - **GET /en/guides/guide/chef-michel** - Description: Guide on using the Chef Michel agent. - **GET /en/guides/guide/stock-agent** - Description: Guide on using the Stock Agent tool. - **GET /en/guides/guide/ai-recruiter** - Description: Guide on building an AI Recruiter workflow. - **GET /en/guides/guide/research-assistant** - Description: Guide on creating a Research Assistant with RAG. - **GET /en/guides/guide/notes-mcp-server** - Description: Guide on setting up a Notes MCP Server. ``` -------------------------------- ### Install Mastra via `create-mastra` CLI Source: https://mastra.ai/docs/getting-started/installation Installs Mastra using the command-line interface. This is the recommended method for quickly setting up a new project. ```bash npx create-mastra@latest ``` -------------------------------- ### Run Commands for LangGraph Example Source: https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-langgraph Provides the necessary commands to install dependencies and run the LangGraph example. It involves a standard npm install followed by starting the development server. ```shell npm install npm run dev ``` -------------------------------- ### Reference to Weather Tool Example Documentation (Markdown) Source: https://mastra.ai/docs/getting-started/installation This snippet provides a link to the full weather tool example documentation, guiding users on how to give an agent a tool. It's presented within a blockquote. ```markdown See the full weatherTool example in [Giving an Agent a Tool](/examples/agents/using-a-tool). ``` -------------------------------- ### Install Cohere SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating Cohere models with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/cohere ``` -------------------------------- ### Install Assistant UI Packages with npm Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary Assistant UI packages for your project using npm. Ensure you have Node.js and npm installed. ```bash npm install "@assistant-ui/react" "@assistant-ui/react-markdown" "@assistant-ui/styles" ``` -------------------------------- ### Install OpenAI SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating OpenAI with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/openai ``` -------------------------------- ### Initialize TypeScript Project and Install Dependencies (Bun) Source: https://mastra.ai/docs/getting-started/installation Initializes a TypeScript project and installs necessary Mastra and AI SDK packages using Bun. ```bash bun init -y bun add typescript tsx @types/node mastra@latest --dev bun add @mastra/core@latest zod@^3 @ai-sdk/openai@^1 ``` -------------------------------- ### Install Assistant UI Manually Source: https://www.assistant-ui.com/docs/getting-started This section provides instructions for manually installing Assistant UI, which may be useful for developers who prefer more control over the installation process or are integrating it into existing projects. It involves cloning the repository and installing dependencies. ```bash git clone https://github.com/assistant-ui/assistant-ui.git cd assistant-ui npm install cd apps/docs npm run dev ``` -------------------------------- ### Setup Backend Endpoint for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started This guide explains how to set up a backend endpoint, which is crucial for the Assistant UI to communicate with a language model. The backend handles requests and responses, enabling the UI to function as intended. ```bash cd apps/web npm install OPENAI_API_KEY= npm run dev ``` -------------------------------- ### Install AssistantModal Component with NPX Source: https://www.assistant-ui.com/docs/getting-started This command installs the AssistantModal component from a specified URL using npx. It requires npx to be installed and configured. The component is added to the project. ```bash npx shadcn@latest add \"https://r.assistant-ui.com/assistant-modal\" ``` -------------------------------- ### Install Ollama SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating Ollama with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk ollama-ai-provider ``` -------------------------------- ### Install Project Dependencies (npm) Source: https://github.com/assistant-ui/assistant-ui/tree/main/examples/with-ai-sdk-v5 Installs all necessary project dependencies using npm. This is the first step to get the project running. ```shell npm install ``` -------------------------------- ### Install @ai-sdk/openai for ai-sdk v5 (bun) Source: https://mastra.ai/docs/getting-started/installation Installs the latest version of the `@ai-sdk/openai` package using bun, a prerequisite for ai-sdk v5 compatibility. ```bash bun add @ai-sdk/openai@latest ``` -------------------------------- ### Initialize TypeScript Project and Install Dependencies (NPM) Source: https://mastra.ai/docs/getting-started/installation Initializes a TypeScript project and installs necessary Mastra and AI SDK packages using npm. ```bash npm init -y npm install typescript tsx @types/node mastra@latest --save-dev npm install @mastra/core@latest zod@^3 @ai-sdk/openai@^1 ``` -------------------------------- ### Install Azure SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating Azure OpenAI services with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/azure ``` -------------------------------- ### Agent.getInstructions() Source: https://mastra.ai/docs/getting-started/installation Retrieves the instructions that guide the agent's behavior using the `Agent.getInstructions()` method. ```APIDOC ## GET /api/agents/getInstructions ### Description This endpoint returns the specific instructions or guidelines the agent follows. ### Method GET ### Endpoint /api/agents/getInstructions ### Response #### Success Response (200) - **instructions** (string) - The set of instructions for the agent. #### Response Example ```json { "instructions": "Always be polite and helpful. Prioritize user satisfaction." } ``` ``` -------------------------------- ### Install Google Gemini SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating Google Gemini models with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/google ``` -------------------------------- ### Initialize TypeScript Project and Install Dependencies (Yarn) Source: https://mastra.ai/docs/getting-started/installation Initializes a TypeScript project and installs necessary Mastra and AI SDK packages using Yarn. ```bash yarn init -y yarn add typescript tsx @types/node mastra@latest --dev yarn add @mastra/core@latest zod@^3 @ai-sdk/openai@^1 ``` -------------------------------- ### Install Ollama Assistant UI SDK Source: https://www.assistant-ui.com/docs/getting-started Installs the Ollama SDK for Assistant UI and the AI SDK. This facilitates integration with Ollama for local LLM deployments. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/ollama ``` -------------------------------- ### Initialize TypeScript Project and Install Dependencies (PNPM) Source: https://mastra.ai/docs/getting-started/installation Initializes a TypeScript project and installs necessary Mastra and AI SDK packages using PNPM. ```bash pnpm init pnpm add typescript tsx @types/node mastra@latest --save-dev pnpm add @mastra/core@latest zod@^3 @ai-sdk/openai@^1 ``` -------------------------------- ### Install Google Vertex AI SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating Google Vertex AI services with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/google-vertex ``` -------------------------------- ### Initialize TypeScript Project Source: https://mastra.ai/docs/getting-started/installation Sets up a new project with TypeScript. This involves creating a `tsconfig.json` file and potentially installing TypeScript dependencies. ```bash npx tsc --init ``` -------------------------------- ### Provide Getting Started Instructions (JavaScript) Source: https://www.assistant-ui.com/docs/cloud/overview Instructs users to create an account on the Assistant Cloud Dashboard and follow walkthroughs for their chosen backend. Includes links to specific backend documentation. ```javascript self.__next_f.push([1,"42:[\"$\",\"p\",null,{\"children\":[\"To get started, create an account at \",[\"$\",\"$Le\",null,{\"href\":\"https://cloud.assistant-ui.com/\",\"children\":\"Assistant Cloud Dashboard\"}],\" and follow one of the walkthroughs for your preferred backend:\"]}]\n"]) ``` -------------------------------- ### Getting Started with Assistant UI Attachments Source: https://www.assistant-ui.com/docs/guides/Attachments Provides guidance on how to get started with the attachments feature in Assistant UI. This section typically includes installation, configuration, and basic usage examples to enable file uploads in the chat interface. ```markdown ## Getting Started [Instructions for setup and basic usage would typically follow here.] ``` -------------------------------- ### Install AI SDK packages with npm Source: https://www.assistant-ui.com/docs/getting-started These npm commands are used to install the Assistant UI React AI SDK and specific AI provider SDKs. The examples show installation for Azure and AWS Bedrock, indicating how to integrate different AI services with the Assistant UI. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/azure ``` ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/amazon-bedrock ``` -------------------------------- ### Launch Mastra Development Server (Bun) Source: https://mastra.ai/docs/getting-started/installation Starts the Mastra development server using Bun. ```bash bun run dev ``` -------------------------------- ### Create Mastra Project with CLI Flags (NPM) Source: https://mastra.ai/docs/getting-started/installation Creates a Mastra project with specified options like project name, components, and LLM provider using npm. ```bash npx create-mastra@latest --project-name hello-mastra --example --components tools,agents,workflows --llm openai ``` -------------------------------- ### Deployment API Reference Source: https://mastra.ai/docs/getting-started/installation Documentation for deploying Mastra applications, including middleware configurations and server deployment. ```APIDOC ## Deployment API Reference ### Description Documentation for deploying Mastra applications, including middleware configurations and server deployment. ### Endpoints - **GET /en/examples/deployment** - Description: Overview of deployment options. - **GET /en/examples/deployment/auth-middleware** - Description: Configure authentication middleware. - **GET /en/examples/deployment/cors-middleware** - Description: Configure CORS middleware. - **GET /en/examples/deployment/logging-middleware** - Description: Configure logging middleware. - **GET /en/examples/deployment/custom-api-route** - Description: Define custom API routes. - **GET /en/examples/deployment/deploying-mastra-server** - Description: Guide for deploying a Mastra server. ``` -------------------------------- ### Start with Assistant UI Examples Source: https://www.assistant-ui.com/docs/runtimes/pick-a-runtime Developers can begin by exploring the example projects available in the Assistant UI GitHub repository. These examples provide practical starting points for implementing various features and functionalities. ```markdown Start with an example from our [examples repository](https://github.com/assistant-ui/assistant-ui/tree/main/examples) ``` -------------------------------- ### Create Project Directory Source: https://mastra.ai/docs/getting-started/installation Creates a new directory for the Mastra project and navigates into it. ```bash mkdir hello-mastra && cd hello-mastra ``` -------------------------------- ### Launch Mastra Development Server (Yarn) Source: https://mastra.ai/docs/getting-started/installation Starts the Mastra development server using Yarn. ```bash yarn run dev ``` -------------------------------- ### Navigation Link: Examples Source: https://www.assistant-ui.com/docs/getting-started Defines a navigation link for 'Examples'. It includes an SVG icon (Sparkles) and the text label. The `href` attribute points to the examples page. This is part of the main navigation. ```javascript ("$","$L2b","2",{"href":"/examples","icon":["$","svg",null,{"ref":"$undefined","xmlns":"http://www.w3.org/2000/svg","width":24,"height":24,"viewBox":"0 0 24 24","fill":"none","stroke":"currentColor","strokeWidth":2,"strokeLinecap":"round","strokeLinejoin":"round","className":"lucide lucide-sparkles","aria-hidden":"true","children":[[("$","path","1s2grr",{"d":"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}),("$","path","1rf3ol",{"d":"M20 2v4"}),("$","path","gwowj6",{"d":"M22 4h-4"}),("$","circle","6kqj1y",{"cx":4,"cy":20,"r":2}],"$undefined"]}]},"external":"$undefined","className":"","children":"Examples"}) ``` -------------------------------- ### Launch Mastra Development Server (PNPM) Source: https://mastra.ai/docs/getting-started/installation Starts the Mastra development server using PNPM. ```bash pnpm run dev ``` -------------------------------- ### Install Dependencies with npm, yarn, or pnpm Source: https://mastra.ai/docs/getting-started/installation Commands to install project dependencies using different package managers. Ensure you have the respective package manager installed (npm, yarn, or pnpm). ```bash npm install typescript @types/node tsx --save-dev npm install npm run dev ``` ```bash yarn add typescript @types/node tsx --dev yarn install yarn run dev ``` ```bash pnpm add typescript @types/node tsx --save-dev pnpm install pnpm run dev ``` -------------------------------- ### Initialize Assistant UI Project Source: https://www.assistant-ui.com/docs/getting-started This command initializes a new Assistant UI project, setting up the necessary files and configurations to begin development. It is the first step in getting the project running. ```bash npx create-next-app@latest --example https://github.com/assistant-ui/assistant-ui/tree/main/examples/nextjs assistant-ui-app ``` -------------------------------- ### Launch Mastra Development Server Source: https://mastra.ai/docs/getting-started/installation Starts the Mastra development server, allowing you to run and test your AI applications locally. ```bash mastra dev ``` -------------------------------- ### Install @ai-sdk/openai for ai-sdk v5 (yarn) Source: https://mastra.ai/docs/getting-started/installation Installs the latest version of the `@ai-sdk/openai` package using yarn, essential for ai-sdk v5 compatibility. ```bash yarn add @ai-sdk/openai@latest ``` -------------------------------- ### Install @ai-sdk/openai for ai-sdk v5 (pnpm) Source: https://mastra.ai/docs/getting-started/installation Installs the latest version of the `@ai-sdk/openai` package using pnpm, a requirement for ai-sdk v5 compatibility. ```bash pnpm add @ai-sdk/openai@latest ``` -------------------------------- ### Install @ai-sdk/openai for ai-sdk v5 (npm) Source: https://mastra.ai/docs/getting-started/installation Installs the latest version of the `@ai-sdk/openai` package using npm, which is necessary for ai-sdk v5 compatibility. ```bash npm install @ai-sdk/openai@latest ``` -------------------------------- ### Install Mastra CLI with npm (non-interactive) Source: https://mastra.ai/docs/getting-started/installation This command installs the Mastra CLI globally using npm in a non-interactive mode. It requires all necessary flags to be passed to complete the installation and project creation. ```bash npm create mastra@latest -- --all-flags ``` -------------------------------- ### Initialize Project with Bun Source: https://mastra.ai/docs/getting-started/installation Initializes a new project using the Bun package manager. This command sets up the basic project structure and configuration. ```bash bun init -y ``` -------------------------------- ### Initialize Mastra Project (`mastra init`) Source: https://mastra.ai/docs/getting-started/installation Initializes a new Mastra project or adds Mastra to an existing one. This command sets up the necessary configuration files and structures. ```bash mastra init ``` -------------------------------- ### Install Chrome AI SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating Chrome AI services with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk chrome-ai ``` -------------------------------- ### Initialize Assistant UI Project Source: https://www.assistant-ui.com/docs/getting-started This snippet demonstrates how to initialize a new project with the default Assistant UI template. It requires a command-line interface. ```bash # Create a new project with the default template ``` -------------------------------- ### Memory and Storage Source: https://mastra.ai/docs/getting-started/installation APIs for managing memory and storage configurations. ```APIDOC ## GET /en/reference/core/getMemory ### Description Retrieves the configured memory instance. ### Method GET ### Endpoint `/en/reference/core/getMemory` ### Response #### Success Response (200) - **memoryConfig** (object) - The configuration details of the memory instance. ### Response Example ```json { "memoryConfig": { "type": "redis", "host": "localhost", "port": 6379 } } ``` ``` ```APIDOC ## POST /en/reference/core/setStorage ### Description Sets the storage instance for the Mastra instance. ### Method POST ### Endpoint `/en/reference/core/setStorage` ### Parameters #### Request Body - **storageConfig** (object) - Required - The configuration for the storage instance. - **type** (string) - Required - The type of storage (e.g., "file", "s3"). - **path** (string) - Optional - The path or connection details for the storage. ### Request Example ```json { "storageConfig": { "type": "file", "path": "/mnt/data" } } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful storage setup. ### Response Example ```json { "message": "Storage instance set successfully." } ``` ``` -------------------------------- ### Install AWS Bedrock SDK for Assistant UI Source: https://www.assistant-ui.com/docs/getting-started Installs the necessary SDKs for integrating AWS Bedrock services with Assistant UI. Requires Node.js and npm. ```bash npm install ai @assistant-ui/react-ai-sdk @ai-sdk/amazon-bedrock ```