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/embedded-docs.md
1# Embedded Docs Reference23Look up API signatures from embedded docs in `node_modules/@mastra/*/dist/docs/` - these match the installed version.45**Use this FIRST** when Mastra packages are installed locally. Embedded docs are always accurate for the installed version.67## Why use embedded docs89- **Version accuracy**: Embedded docs match the exact installed version10- **No network required**: All docs are local in `node_modules/`11- **Mastra evolves quickly**: APIs change rapidly, embedded docs stay in sync12- **TypeScript definitions**: Includes JSDoc, type signatures, and examples13- **Training data may be outdated**: Claude's knowledge cutoff may not reflect latest APIs1415## Documentation structure1617```18node_modules/@mastra/core/dist/docs/19├── SKILL.md # Package overview, exports20├── assets/21│ └── SOURCE_MAP.json # Export -> file mappings22└── references/ # Individual topic docs23```2425## Lookup process2627### 1. Check if packages are installed2829```bash30ls node_modules/@mastra/31```3233If you see packages like `core`, `memory`, `rag`, etc., proceed with embedded docs lookup.3435### 2. Look through topic docs3637Use `grep` to find relevant docs in `references/`:3839```bash40grep -r "Agent" node_modules/@mastra/core/dist/docs/references41```4243### Naming convention4445Documents are typically formatted as `<category>-<topic>.md` where category is one of: `"docs", "reference", "guides", "models"`.4647### Optional: Check source code for type definitions / additional details4849Look at the `SOURCE_MAP.json` to find the file path for the export:5051```bash52cat node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json | grep '"Agent"'53```5455Returns: `{ "Agent": { "types": "dist/agent/agent.d.ts", ... } }`5657Read the type definition for exact constructor parameters, types, and JSDoc:5859```bash60cat node_modules/@mastra/core/dist/agent/agent.d.ts61```6263## Common packages6465| Package | Path | Contains |66| ---------------- | ---------------------------------------- | ----------------------------------------- |67| `@mastra/core` | `node_modules/@mastra/core/dist/docs/` | Agents, Workflows, Tools, Mastra instance |68| `@mastra/memory` | `node_modules/@mastra/memory/dist/docs/` | Memory systems, conversation history |69| `@mastra/rag` | `node_modules/@mastra/rag/dist/docs/` | RAG features, vector stores |70| `@mastra/pg` | `node_modules/@mastra/pg/dist/docs/` | PostgreSQL storage |71| `@mastra/libsql` | `node_modules/@mastra/libsql/dist/docs/` | LibSQL/SQLite storage |7273## Quick commands reference7475```bash76# List installed @mastra packages77ls node_modules/@mastra/7879# List available topic documentation80ls node_modules/@mastra/core/dist/docs/references/8182# Find specific export in SOURCE_MAP83cat node_modules/@mastra/core/dist/docs/assets/SOURCE_MAP.json | grep '"ExportName"'8485# Read type definition from path86cat node_modules/@mastra/core/dist/[path-from-source-map]8788# View package overview89cat node_modules/@mastra/core/dist/docs/SKILL.md90```9192## When embedded docs are not available9394If packages aren't installed or `dist/docs/` doesn't exist:95961. **Recommend installation**: Suggest installing packages to access embedded docs972. **Fall back to remote docs**: See `references/remote-docs.md`9899## Best Practices1001011. **Check topic docs** for conceptual understanding and patterns1022. **Search source code** if docs don't answer the question1033. **Verify imports** match what's exported in the type definitions104