Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build Mastra AI agents and workflows with guidance on current API lookup, tools, memory, and RAG patterns.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/remote-docs.md
1# Remote Docs Reference23How to look up current documentation from https://mastra.ai when local packages aren't available or you need conceptual guidance.45**Use this when:**67- Mastra packages aren't installed locally8- You need conceptual explanations or guides9- You want the latest documentation (may be ahead of installed version)1011## Documentation site structure1213Mastra docs are organized at **https://mastra.ai**:1415- **Docs**: Core documentation covering concepts, features, and implementation details16- **Models**: Mastra provides a unified interface for working with LLMs across multiple providers17- **Guides**: Step-by-step tutorials for building specific applications18- **Reference**: API reference documentation1920## Finding relevant documentation2122### Method 1: Use llms.txt (Recommended)2324The main llms.txt file provides an agent-friendly overview of all documentation: https://mastra.ai/llms.txt2526This returns a structured markdown document with:2728- Documentation organization and hierarchy29- All available topics and sections30- Direct links to relevant documentation31- Agent-optimized content structure3233**Use this first** to understand what documentation is available and where to find specific topics.3435### Method 2: Direct URL patterns3637Documentation follows predictable URL patterns:3839- Overview pages: `https://mastra.ai/docs/{topic}/overview`40- API reference: `https://mastra.ai/reference/{topic}/`41- Guides: `https://mastra.ai/guides/{topic}/`4243**Examples:**4445- `https://mastra.ai/docs/agents/overview`46- `https://mastra.ai/docs/workflows/overview`47- `https://mastra.ai/reference/workflows/workflow-methods/`4849## Agent-friendly documentation5051**Critical feature**: Send the `text-markdown` request header or add `.md` to any documentation URL to get clean, agent-friendly markdown.5253### Standard URL:5455```56https://mastra.ai/reference/workflows/workflow-methods/then57```5859### Agent-friendly URL (Markdown):6061```62https://mastra.ai/reference/workflows/workflow-methods/then.md63```6465The `.md` version:6667- Removes navigation, headers, footers68- Returns pure markdown content69- Optimized for LLM consumption70- Includes all code examples and explanations7172## Lookup Workflow7374### 1. Check the main documentation index7576**Start here** to understand what's available:7778```79https://mastra.ai/llms.txt80```8182This provides:8384- Complete documentation structure85- Available topics and sections86- Links to relevant documentation pages8788### 2. Find relevant documentation8990**Option A: Use information from llms.txt**91The main llms.txt will guide you to the right section.9293**Option B: Construct URL directly**9495```96https://mastra.ai/docs/{topic}/overview97https://mastra.ai/reference/{topic}/98```99100### 3. Fetch agent-friendly version101102Add `.md` to the end of any documentation URL:103104```105https://mastra.ai/reference/workflows/workflow-methods/then.md106```107108### 4. Extract relevant information109110The markdown will include:111112- Function signatures113- Parameter descriptions114- Return types115- Usage examples116- Best practices117118## Common documentation paths119120### Agents121122- Overview: `https://mastra.ai/docs/agents/overview`123- Creating agents: `https://mastra.ai/docs/agents/creating-agents`124- Agent tools: `https://mastra.ai/docs/agents/tools`125- Memory: `https://mastra.ai/docs/agents/memory`126127### Workflows128129- Overview: `https://mastra.ai/docs/workflows/overview`130- Creating workflows: `https://mastra.ai/docs/workflows/creating-workflows`131- Workflow methods: `https://mastra.ai/reference/workflows/workflow-methods/`132133### Tools134135- Overview: `https://mastra.ai/docs/tools/overview`136- Creating tools: `https://mastra.ai/docs/tools/creating-tools`137138### Memory139140- Overview: `https://mastra.ai/docs/memory/overview`141- Configuration: `https://mastra.ai/docs/memory/configuration`142143### RAG144145- Overview: `https://mastra.ai/docs/rag/overview`146- Vector stores: `https://mastra.ai/docs/rag/vector-stores`147148## Example: Looking up workflow .then() method149150### 1. Check main documentation index151152```153WebFetch({154url: "https://mastra.ai/llms.txt",155prompt: "Where can I find documentation about workflow methods like .then()?"156})157```158159This will point you to the workflows reference section.160161### 2. Fetch specific method documentation162163```164https://mastra.ai/reference/workflows/workflow-methods/then.md165```166167### 3. Use WebFetch tool168169```170WebFetch({171url: "https://mastra.ai/reference/workflows/workflow-methods/then.md",172prompt: "What are the parameters for the .then() method and how do I use it?"173})174```175176## When to use remote vs embedded docs177178| Situation | Use |179| -------------------------- | --------------------------------------------------- |180| Packages installed locally | **Embedded docs** (guaranteed version match) |181| Packages not installed | **Remote docs** |182| Need conceptual guides | **Remote docs** |183| Need exact API signatures | **Embedded docs** (if available) |184| Exploring new features | **Remote docs** (may be ahead of installed version) |185| Need working examples | **Both** (embedded for types, remote for guides) |186187## Best practices1881891. **Always use .md** for fetching documentation1902. **Check sitemap.xml** when unsure about URL structure1913. **Prefer embedded docs** when packages are installed (version accuracy)1924. **Use remote docs** for conceptual understanding and guides1935. **Combine both** for comprehensive understanding194