# Reference The Reference section provides documentation of Mastra's API, including parameters, types and usage examples. - [Agent Class](https://mastra.ai/reference/agents/agent) - [.generate()](https://mastra.ai/reference/agents/generate) - [.generateLegacy()](https://mastra.ai/reference/agents/generateLegacy) - [.getDefaultGenerateOptionsLegacy()](https://mastra.ai/reference/agents/getDefaultGenerateOptions) - [.getDefaultOptions()](https://mastra.ai/reference/agents/getDefaultOptions) - [.getDefaultStreamOptionsLegacy()](https://mastra.ai/reference/agents/getDefaultStreamOptions) - [.getDescription()](https://mastra.ai/reference/agents/getDescription) - [.getInstructions()](https://mastra.ai/reference/agents/getInstructions) - [.getLLM()](https://mastra.ai/reference/agents/getLLM) - [.getMemory()](https://mastra.ai/reference/agents/getMemory) - [.getModel()](https://mastra.ai/reference/agents/getModel) - [.getVoice()](https://mastra.ai/reference/agents/getVoice) - [.getTools()](https://mastra.ai/reference/agents/getTools) - [.listAgents()](https://mastra.ai/reference/agents/listAgents) - [.listScorers()](https://mastra.ai/reference/agents/listScorers) - [.listTools()](https://mastra.ai/reference/agents/listTools) - [.listWorkflows()](https://mastra.ai/reference/agents/listWorkflows) - [.network()](https://mastra.ai/reference/agents/network) - [chatRoute()](https://mastra.ai/reference/ai-sdk/chat-route) - [handleChatStream()](https://mastra.ai/reference/ai-sdk/handle-chat-stream) - [handleNetworkStream()](https://mastra.ai/reference/ai-sdk/handle-network-stream) - [handleWorkflowStream()](https://mastra.ai/reference/ai-sdk/handle-workflow-stream) - [networkRoute()](https://mastra.ai/reference/ai-sdk/network-route) - [toAISdkStream()](https://mastra.ai/reference/ai-sdk/to-ai-sdk-stream) - [toAISdkV4Messages()](https://mastra.ai/reference/ai-sdk/to-ai-sdk-v4-messages) - [toAISdkV5Messages()](https://mastra.ai/reference/ai-sdk/to-ai-sdk-v5-messages) - [withMastra()](https://mastra.ai/reference/ai-sdk/with-mastra) - [workflowRoute()](https://mastra.ai/reference/ai-sdk/workflow-route) - [Auth0](https://mastra.ai/reference/auth/auth0) - [Better Auth](https://mastra.ai/reference/auth/better-auth) - [Clerk](https://mastra.ai/reference/auth/clerk) - [Firebase](https://mastra.ai/reference/auth/firebase) - [JSON Web Token](https://mastra.ai/reference/auth/jwt) - [Supabase](https://mastra.ai/reference/auth/supabase) - [WorkOS](https://mastra.ai/reference/auth/workos) - [create-mastra](https://mastra.ai/reference/cli/create-mastra) - [mastra](https://mastra.ai/reference/cli/mastra) - [Agents API](https://mastra.ai/reference/client-js/agents) - [Error Handling](https://mastra.ai/reference/client-js/error-handling) - [Logs API](https://mastra.ai/reference/client-js/logs) - [Mastra Client SDK](https://mastra.ai/reference/client-js/mastra-client) - [Memory API](https://mastra.ai/reference/client-js/memory) - [Observability API](https://mastra.ai/reference/client-js/observability) - [Telemetry API](https://mastra.ai/reference/client-js/telemetry) - [Tools API](https://mastra.ai/reference/client-js/tools) - [Vectors API](https://mastra.ai/reference/client-js/vectors) - [Workflows API](https://mastra.ai/reference/client-js/workflows) - [Mastra Class](https://mastra.ai/reference/core/mastra-class) - [MastraModelGateway](https://mastra.ai/reference/core/mastra-model-gateway) - [.addGateway()](https://mastra.ai/reference/core/addGateway) - [.getAgent()](https://mastra.ai/reference/core/getAgent) - [.getAgentById()](https://mastra.ai/reference/core/getAgentById) - [.getDeployer()](https://mastra.ai/reference/core/getDeployer) - [.getGateway()](https://mastra.ai/reference/core/getGateway) - [.getGatewayById()](https://mastra.ai/reference/core/getGatewayById) - [.getLogger()](https://mastra.ai/reference/core/getLogger) - [.getMCPServer()](https://mastra.ai/reference/core/getMCPServer) - [.getMCPServerById()](https://mastra.ai/reference/core/getMCPServerById) - [.getMemory()](https://mastra.ai/reference/core/getMemory) - [.getScorer()](https://mastra.ai/reference/core/getScorer) - [.getScorerById()](https://mastra.ai/reference/core/getScorerById) - [.getServer()](https://mastra.ai/reference/core/getServer) - [.getStorage()](https://mastra.ai/reference/core/getStorage) - [.getStoredAgentById()](https://mastra.ai/reference/core/getStoredAgentById) - [.getTelemetry()](https://mastra.ai/reference/core/getTelemetry) - [.getVector()](https://mastra.ai/reference/core/getVector) - [.getWorkflow()](https://mastra.ai/reference/core/getWorkflow) - [.listAgents()](https://mastra.ai/reference/core/listAgents) - [.listGateways()](https://mastra.ai/reference/core/listGateways) - [.listLogs()](https://mastra.ai/reference/core/listLogs) - [.listLogsByRunId()](https://mastra.ai/reference/core/listLogsByRunId) - [.listMCPServers()](https://mastra.ai/reference/core/listMCPServers) - [.listMemory()](https://mastra.ai/reference/core/listMemory) - [.listScorers()](https://mastra.ai/reference/core/listScorers) - [.listStoredAgents()](https://mastra.ai/reference/core/listStoredAgents) - [.listVectors()](https://mastra.ai/reference/core/listVectors) - [.listWorkflows()](https://mastra.ai/reference/core/listWorkflows) - [.setLogger()](https://mastra.ai/reference/core/setLogger) - [.setStorage()](https://mastra.ai/reference/core/setStorage) - [Cloudflare](https://mastra.ai/reference/deployer/cloudflare) - [Deployer](https://mastra.ai/reference/deployer) - [Netlify](https://mastra.ai/reference/deployer/netlify) - [Vercel](https://mastra.ai/reference/deployer/vercel) - [Answer Relevancy Scorer](https://mastra.ai/reference/evals/answer-relevancy) - [Answer Similarity Scorer](https://mastra.ai/reference/evals/answer-similarity) - [Bias](https://mastra.ai/reference/evals/bias) - [Completeness](https://mastra.ai/reference/evals/completeness) - [Content Similarity Scorer](https://mastra.ai/reference/evals/content-similarity) - [Context Precision Scorer](https://mastra.ai/reference/evals/context-precision) - [Context Relevance Scorer](https://mastra.ai/reference/evals/context-relevance) - [createScorer](https://mastra.ai/reference/evals/create-scorer) - [Faithfulness](https://mastra.ai/reference/evals/faithfulness) - [Hallucination](https://mastra.ai/reference/evals/hallucination) - [Keyword Coverage Scorer](https://mastra.ai/reference/evals/keyword-coverage) - [MastraScorer](https://mastra.ai/reference/evals/mastra-scorer) - [Noise Sensitivity Scorer](https://mastra.ai/reference/evals/noise-sensitivity) - [Prompt Alignment Scorer](https://mastra.ai/reference/evals/prompt-alignment) - [runEvals](https://mastra.ai/reference/evals/run-evals) - [Scorer Utils](https://mastra.ai/reference/evals/scorer-utils) - [Textual Difference Scorer](https://mastra.ai/reference/evals/textual-difference) - [Tone Consistency Scorer](https://mastra.ai/reference/evals/tone-consistency) - [Tool Call Accuracy Scorers](https://mastra.ai/reference/evals/tool-call-accuracy) - [Toxicity](https://mastra.ai/reference/evals/toxicity) - [Memory Class](https://mastra.ai/reference/memory/memory-class) - [Observational Memory](https://mastra.ai/reference/memory/observational-memory) - [Cloned Thread Utilities](https://mastra.ai/reference/memory/clone-utilities) - [.cloneThread()](https://mastra.ai/reference/memory/cloneThread) - [.createThread()](https://mastra.ai/reference/memory/createThread) - [.deleteMessages()](https://mastra.ai/reference/memory/deleteMessages) - [.getThreadById()](https://mastra.ai/reference/memory/getThreadById) - [.listThreads()](https://mastra.ai/reference/memory/listThreads) - [.recall()](https://mastra.ai/reference/memory/recall) - [PinoLogger](https://mastra.ai/reference/logging/pino-logger) - [Configuration](https://mastra.ai/reference/observability/tracing/configuration) - [Instances](https://mastra.ai/reference/observability/tracing/instances) - [Interfaces](https://mastra.ai/reference/observability/tracing/interfaces) - [Spans](https://mastra.ai/reference/observability/tracing/spans) - [BatchPartsProcessor](https://mastra.ai/reference/processors/batch-parts-processor) - [LanguageDetector](https://mastra.ai/reference/processors/language-detector) - [MessageHistory](https://mastra.ai/reference/processors/message-history-processor) - [ModerationProcessor](https://mastra.ai/reference/processors/moderation-processor) - [PIIDetector](https://mastra.ai/reference/processors/pii-detector) - [Processor Interface](https://mastra.ai/reference/processors/processor-interface) - [PromptInjectionDetector](https://mastra.ai/reference/processors/prompt-injection-detector) - [SemanticRecall](https://mastra.ai/reference/processors/semantic-recall-processor) - [SystemPromptScrubber](https://mastra.ai/reference/processors/system-prompt-scrubber) - [TokenLimiterProcessor](https://mastra.ai/reference/processors/token-limiter-processor) - [ToolCallFilter](https://mastra.ai/reference/processors/tool-call-filter) - [ToolSearchProcessor](https://mastra.ai/reference/processors/tool-search-processor) - [UnicodeNormalizer](https://mastra.ai/reference/processors/unicode-normalizer) - [WorkingMemory](https://mastra.ai/reference/processors/working-memory-processor) - [DatabaseConfig](https://mastra.ai/reference/rag/database-config) - [Embed](https://mastra.ai/reference/rag/embeddings) - [ExtractParams](https://mastra.ai/reference/rag/extract-params) - [GraphRAG](https://mastra.ai/reference/rag/graph-rag) - [MDocument](https://mastra.ai/reference/rag/document) - [Metadata Filters](https://mastra.ai/reference/rag/metadata-filters) - [.chunk()](https://mastra.ai/reference/rag/chunk) - [rerank()](https://mastra.ai/reference/rag/rerank) - [rerankWithScorer()](https://mastra.ai/reference/rag/rerankWithScorer) - [createRoute()](https://mastra.ai/reference/server/create-route) - [Express Adapter](https://mastra.ai/reference/server/express-adapter) - [Fastify Adapter](https://mastra.ai/reference/server/fastify-adapter) - [Hono Adapter](https://mastra.ai/reference/server/hono-adapter) - [Koa Adapter](https://mastra.ai/reference/server/koa-adapter) - [MastraServer](https://mastra.ai/reference/server/mastra-server) - [registerApiRoute()](https://mastra.ai/reference/server/register-api-route) - [Server Routes](https://mastra.ai/reference/server/routes) - [Overview](https://mastra.ai/reference/storage/overview) - [Composite Storage](https://mastra.ai/reference/storage/composite) - [Cloudflare D1 Storage](https://mastra.ai/reference/storage/cloudflare-d1) - [Cloudflare KV Storage](https://mastra.ai/reference/storage/cloudflare) - [Convex Storage](https://mastra.ai/reference/storage/convex) - [DynamoDB Storage](https://mastra.ai/reference/storage/dynamodb) - [LanceDB Storage](https://mastra.ai/reference/storage/lance) - [libSQL Storage](https://mastra.ai/reference/storage/libsql) - [MongoDB Storage](https://mastra.ai/reference/storage/mongodb) - [MSSQL Storage](https://mastra.ai/reference/storage/mssql) - [PostgreSQL Storage](https://mastra.ai/reference/storage/postgresql) - [Upstash Storage](https://mastra.ai/reference/storage/upstash) - [Workspace Class](https://mastra.ai/reference/workspace/workspace-class) - [LocalFilesystem](https://mastra.ai/reference/workspace/local-filesystem) - [S3Filesystem](https://mastra.ai/reference/workspace/s3-filesystem) - [GCSFilesystem](https://mastra.ai/reference/workspace/gcs-filesystem) - [LocalSandbox](https://mastra.ai/reference/workspace/local-sandbox) - [E2BSandbox](https://mastra.ai/reference/workspace/e2b-sandbox) - [WorkspaceFilesystem](https://mastra.ai/reference/workspace/filesystem) - [WorkspaceSandbox](https://mastra.ai/reference/workspace/sandbox) - [.stream()](https://mastra.ai/reference/streaming/agents/stream) - [.streamLegacy()](https://mastra.ai/reference/streaming/agents/streamLegacy) - [MastraModelOutput](https://mastra.ai/reference/streaming/agents/MastraModelOutput) - [ChunkType](https://mastra.ai/reference/streaming/ChunkType) - [.observeStream()](https://mastra.ai/reference/streaming/workflows/observeStream) - [.resumeStream()](https://mastra.ai/reference/streaming/workflows/resumeStream) - [.stream()](https://mastra.ai/reference/streaming/workflows/stream) - [.timeTravelStream()](https://mastra.ai/reference/streaming/workflows/timeTravelStream) - [Overview](https://mastra.ai/reference/templates/overview) - [createDocumentChunkerTool()](https://mastra.ai/reference/tools/document-chunker-tool) - [createGraphRAGTool()](https://mastra.ai/reference/tools/graph-rag-tool) - [createTool()](https://mastra.ai/reference/tools/create-tool) - [createVectorQueryTool()](https://mastra.ai/reference/tools/vector-query-tool) - [MCPClient](https://mastra.ai/reference/tools/mcp-client) - [MCPServer](https://mastra.ai/reference/tools/mcp-server) - [Amazon S3 Vectors Store](https://mastra.ai/reference/vectors/s3vectors) - [Astra Vector Store](https://mastra.ai/reference/vectors/astra) - [Chroma Vector Store](https://mastra.ai/reference/vectors/chroma) - [Cloudflare Vector Store](https://mastra.ai/reference/vectors/vectorize) - [Convex Vector Store](https://mastra.ai/reference/vectors/convex) - [Couchbase Vector Store](https://mastra.ai/reference/vectors/couchbase) - [DuckDB Vector Store](https://mastra.ai/reference/vectors/duckdb) - [ElasticSearch Vector Store](https://mastra.ai/reference/vectors/elasticsearch) - [Lance Vector Store](https://mastra.ai/reference/vectors/lance) - [libSQL Vector Store](https://mastra.ai/reference/vectors/libsql) - [MongoDB Vector Store](https://mastra.ai/reference/vectors/mongodb) - [OpenSearch Vector Store](https://mastra.ai/reference/vectors/opensearch) - [PG Vector Store](https://mastra.ai/reference/vectors/pg) - [Pinecone Vector Store](https://mastra.ai/reference/vectors/pinecone) - [Qdrant Vector Store](https://mastra.ai/reference/vectors/qdrant) - [Turbopuffer Vector Store](https://mastra.ai/reference/vectors/turbopuffer) - [Upstash Vector Store](https://mastra.ai/reference/vectors/upstash) - [.addInstructions()](https://mastra.ai/reference/voice/voice.addInstructions) - [.addTools()](https://mastra.ai/reference/voice/voice.addTools) - [.answer()](https://mastra.ai/reference/voice/voice.answer) - [.close()](https://mastra.ai/reference/voice/voice.close) - [.connect()](https://mastra.ai/reference/voice/voice.connect) - [.getSpeakers()](https://mastra.ai/reference/voice/voice.getSpeakers) - [.listen()](https://mastra.ai/reference/voice/voice.listen) - [.off()](https://mastra.ai/reference/voice/voice.off) - [.on()](https://mastra.ai/reference/voice/voice.on) - [.send()](https://mastra.ai/reference/voice/voice.send) - [.speak()](https://mastra.ai/reference/voice/voice.speak) - [.updateConfig()](https://mastra.ai/reference/voice/voice.updateConfig) - [Azure](https://mastra.ai/reference/voice/azure) - [Cloudflare](https://mastra.ai/reference/voice/cloudflare) - [Composite Voice](https://mastra.ai/reference/voice/composite-voice) - [Deepgram](https://mastra.ai/reference/voice/deepgram) - [ElevenLabs](https://mastra.ai/reference/voice/elevenlabs) - [Events](https://mastra.ai/reference/voice/voice.events) - [Google](https://mastra.ai/reference/voice/google) - [Google Gemini Live](https://mastra.ai/reference/voice/google-gemini-live) - [Mastra Voice](https://mastra.ai/reference/voice/mastra-voice) - [Murf](https://mastra.ai/reference/voice/murf) - [OpenAI](https://mastra.ai/reference/voice/openai) - [OpenAI Realtime](https://mastra.ai/reference/voice/openai-realtime) - [PlayAI](https://mastra.ai/reference/voice/playai) - [Sarvam](https://mastra.ai/reference/voice/sarvam) - [Speechify](https://mastra.ai/reference/voice/speechify) - [.branch()](https://mastra.ai/reference/workflows/workflow-methods/branch) - [.commit()](https://mastra.ai/reference/workflows/workflow-methods/commit) - [.createRun()](https://mastra.ai/reference/workflows/workflow-methods/create-run) - [.dountil()](https://mastra.ai/reference/workflows/workflow-methods/dountil) - [.dowhile()](https://mastra.ai/reference/workflows/workflow-methods/dowhile) - [.foreach()](https://mastra.ai/reference/workflows/workflow-methods/foreach) - [.map()](https://mastra.ai/reference/workflows/workflow-methods/map) - [.parallel()](https://mastra.ai/reference/workflows/workflow-methods/parallel) - [.sleep()](https://mastra.ai/reference/workflows/workflow-methods/sleep) - [.sleepUntil()](https://mastra.ai/reference/workflows/workflow-methods/sleepUntil) - [.then()](https://mastra.ai/reference/workflows/workflow-methods/then) - [Run Class](https://mastra.ai/reference/workflows/run) - [.cancel()](https://mastra.ai/reference/workflows/run-methods/cancel) - [.restart()](https://mastra.ai/reference/workflows/run-methods/restart) - [.resume()](https://mastra.ai/reference/workflows/run-methods/resume) - [.start()](https://mastra.ai/reference/workflows/run-methods/start) - [.startAsync()](https://mastra.ai/reference/workflows/run-methods/startAsync) - [.timeTravel()](https://mastra.ai/reference/workflows/run-methods/timeTravel) - [Step Class](https://mastra.ai/reference/workflows/step) - [Workflow Class](https://mastra.ai/reference/workflows/workflow)