Mastra RAG

Mastra RAG pipeline development - document processing, chunking, embedding, vector databases, retrieval, GraphRAG, and agent integration tools. Covers MDocument chunking strategies (recursive, markdown), AI SDK embed()/embedMany() and embedding model choice, vector stores (PgVector, Pinecone, Qdrant) and migrating between them, rerank()/rerankWithScorer(), and createVectorQueryTool().

artsmc Updated

File contents

Mastra RAG Pipeline Development

Comprehensive guide for building retrieval-augmented generation pipelines with Mastra. Covers document processing (MDocument), chunking strategies, embedding with AI SDK, 17+ vector database providers, retrieval patterns, reranking, GraphRAG, and agent integration tools.

Usage

/mastra-rag

Provides context for:

  • MDocument class (fromText, fromMarkdown, fromHTML)
  • Chunking with .chunk({ strategy, maxSize, overlap })
  • Embedding via AI SDK embed() from 'ai'
  • Vector store setup (PgVector, Pinecone, Qdrant, Chroma, etc.)
  • createVectorQueryTool(), createDocumentChunkerTool(), createGraphRAGTool()
  • Reranking with rerank() and rerankWithScorer()
  • Metadata filters

artsmc/claude-dev-agents/tree/main/skills/mastra-rag commit 71f4cb29de

Frequently asked questions

npx skillmds@latest add artsmc-claude-dev-agents/mastra-rag