11<!-- AGENTS-META {"title":"Mastra Root","version":"2.3.0","applies_to":"/","last_updated":"2025-12-11T00:00:00Z","status":"stable"} -->
2+
23# AGENTS
34
45## Project Overview
56
6- Mastra is a production-grade multi-agent framework for building agent-driven applications and RAG (retrieval-augmented generation) workflows. It provides ** 40 + enterprise tools** , ** 30 + specialized agents** , ** 14 + workflows** , ** 4 agent networks** , ** A2A/MCP orchestration** , and a ** complete UI component library** (64 components: 30 AI Elements + 34 base UI) for scalable AI systems. Key capabilities include ** financial intelligence** , ** RAG pipelines** , ** observability** , ** secure governance** , and ** AI chat interfaces** .
7+ Mastra is a production-grade multi-agent framework for building agent-driven applications and RAG (retrieval-augmented generation) workflows. It provides ** 60 + enterprise tools** , ** 31 + specialized agents** , ** 15 + workflows** , ** 13 agent networks** , ** A2A/MCP orchestration** , and a ** complete UI component library** (65 components: 30 AI Elements + 35 base UI) for scalable AI systems. Key capabilities include ** financial intelligence** , ** RAG pipelines** , ** observability** , ** secure governance** , and ** AI chat interfaces** .
78
89This repo is structured to keep tools, agents, workflows, networks, UI components, and configs separated, with strict Zod schemas for tool inputs/outputs and strong environment-based configuration in ` src/mastra/config ` .
910
@@ -90,10 +91,10 @@ NEXT_PUBLIC_MASTRA_API_URL=http://localhost:4111
9091## Architecture & conventions
9192
9293- ** Frontend** (` app/ ` , ` ui/ ` , ` src/components/ai-elements/ ` ): Next.js 16 App Router with React 19. AI Elements (30 components) for chat/reasoning/canvas UIs. shadcn/ui base (34 components) in ` ui/ ` . Tailwind CSS 4 with oklch color variables.
93- - ** Tools** (` src/mastra/tools ` ): 40 + tools implementing ` createTool({ id, inputSchema, outputSchema, execute }) ` with strict Zod schemas. Categories: Financial (Polygon, Finnhub, AlphaVantage), Research (SerpAPI, ArXiv), Data (CSV, JSON, PDF), RAG (chunking, embeddings), Code (search, analysis, chunking), Browser automation, Calendar, JWT auth, GitHub integration.
94- - ** Agents** (` src/mastra/agents ` ): 30 + agents composing tools into specialized behaviors (research, stock analysis, content creation, data processing, business/legal, charting, image processing, coding, calendar, document processing, knowledge indexing).
95- - ** Networks** (` src/mastra/networks ` ): 4 agent networks for routing and orchestration (agentNetwork, dataPipelineNetwork, reportGenerationNetwork, researchPipelineNetwork ).
96- - ** Workflows** (` src/mastra/workflows ` ): 14 + multi-step workflows using Mastra DSL (weather, content, financial reports, document processing, research synthesis, governed RAG, learning extraction, repo ingestion, stock analysis, telephone game, spec generation).
94+ - ** Tools** (` src/mastra/tools ` ): 60 + tools implementing ` createTool({ id, inputSchema, outputSchema, execute }) ` with strict Zod schemas. Categories: Financial (Polygon, Finnhub, AlphaVantage), Research (SerpAPI, ArXiv), Data (CSV, JSON, PDF), RAG (chunking, embeddings), Code (search, analysis, chunking), Browser automation, Calendar, JWT auth, GitHub integration.
95+ - ** Agents** (` src/mastra/agents ` ): 31 + agents composing tools into specialized behaviors (research, stock analysis, content creation, data processing, business/legal, charting, image processing, coding, calendar, document processing, knowledge indexing, social media, SEO, translation, customer support, project management ).
96+ - ** Networks** (` src/mastra/networks ` ): 13 agent networks for routing and orchestration (primary routing, data pipeline, report generation, research pipeline, content creation, financial intelligence, learning, marketing automation, DevOps, business intelligence, security ).
97+ - ** Workflows** (` src/mastra/workflows ` ): 15 + multi-step workflows using Mastra DSL (weather, content, financial reports, document processing, research synthesis, governed RAG, learning extraction, repo ingestion, stock analysis, telephone game, spec generation, marketing campaign ).
9798- ** Config** (` src/mastra/config ` ): Centralized provider clients (Google, OpenAI, Anthropic, OpenRouter, Vertex), pg-storage with PgVector, and role hierarchy.
9899- ** Scorers** (` src/mastra/scorers ` ): Custom evaluation metrics for automated quality assessment.
99100- ** MCP/A2A** (` src/mastra/mcp ` , ` src/mastra/a2a ` ): Model Context Protocol server and Agent-to-Agent coordination.
@@ -142,12 +143,12 @@ NEXT_PUBLIC_MASTRA_API_URL=http://localhost:4111
142143- ` app/tools/AGENTS.md ` : Tool documentation and execution
143144- ` app/workflows/AGENTS.md ` : Interactive workflow visualization with AI Elements (Canvas, Node, Edge, Panel)
144145- ` lib/ ` : Shared utilities
145- - ` hooks/ ` : React hooks for data fetching and state management
146- - ` use-dashboard-queries.ts ` : TanStack Query hooks for agents, workflows, tools, traces, threads, messages
147- - ` use-mastra.ts ` : Generic fetch hook with loading/error states for MastraClient data
148- - ` types/ ` : TypeScript type definitions
149- - ` mastra-api.ts ` : Zod schemas and types for Agent, Workflow, Tool, MemoryThread, Message, VectorQueryResult
150- - Core utilities: ` a2a.ts ` (agent coordination), ` auth.ts ` (authentication), ` client-stream-to-ai-sdk.ts ` (streaming), ` mastra-client.ts ` (client), ` utils.ts `
146+ - ` hooks/ ` : React hooks for data fetching and state management
147+ - ` use-dashboard-queries.ts ` : TanStack Query hooks for agents, workflows, tools, traces, threads, messages
148+ - ` use-mastra.ts ` : Generic fetch hook with loading/error states for MastraClient data
149+ - ` types/ ` : TypeScript type definitions
150+ - ` mastra-api.ts ` : Zod schemas and types for Agent, Workflow, Tool, MemoryThread, Message, VectorQueryResult
151+ - Core utilities: ` a2a.ts ` (agent coordination), ` auth.ts ` (authentication), ` client-stream-to-ai-sdk.ts ` (streaming), ` mastra-client.ts ` (client), ` utils.ts `
151152- ` ui/AGENTS.md ` : shadcn/ui base components (34 components)
152153- ` src/components/ai-elements/AGENTS.md ` : AI Elements library (30 components)
153154- ` src/mastra/AGENTS.md ` : top-level code-agent focused docs (this file is mirrored to subfolders)
@@ -173,21 +174,21 @@ graph TB
173174 LandingUI[app/ - Landing Pages]
174175 ComponentsUI[app/components/ - Public]
175176 end
176-
177+
177178 subgraph AI["AI Components"]
178179 AIElements["AI Elements (30)"]
179180 ShadcnUI["shadcn/ui (34)"]
180181 SDK["@ai-sdk/react"]
181182 end
182-
183+
183184 subgraph Core["Mastra Core"]
184185 Agents["Agents (30+)"]
185186 Tools["Tools (40+)"]
186187 Workflows["Workflows (14+)"]
187188 Networks["Networks (4)"]
188189 Scorers["Scorers"]
189190 end
190-
191+
191192 subgraph Infrastructure["Infrastructure"]
192193 Config[Config]
193194 Storage[PostgreSQL + PgVector]
@@ -196,7 +197,7 @@ graph TB
196197 A2A[A2A Coordination]
197198 CLI[CLI Tools]
198199 end
199-
200+
200201 Frontend --> AI
201202 AI --> Core
202203 Core --> Infrastructure
@@ -216,10 +217,10 @@ graph TB
216217
217218### Core Components
218219
219- - ** 40 + Tools** : Financial, Research, Data, RAG, Code, Browser, Calendar, Auth, GitHub
220- - ** 30 + Agents** : Specialized behaviors composing tools for research, analysis, content
221- - ** 14 + Workflows** : Multi-step DSL workflows for complex orchestration
222- - ** 4 Networks** : Routing and orchestration between agents and workflows
220+ - ** 60 + Tools** : Financial, Research, Data, RAG, Code, Browser, Calendar, Auth, GitHub
221+ - ** 31 + Agents** : Specialized behaviors composing tools for research, analysis, content, social media, SEO, translation, customer support, project management
222+ - ** 15 + Workflows** : Multi-step DSL workflows for complex orchestration
223+ - ** 13 Networks** : Routing and orchestration between agents and workflows
223224
224225### Infrastructure
225226
@@ -244,10 +245,11 @@ graph TB
244245- ` .eslintignore ` : ESLint ignore patterns for node_modules, build artifacts, memory-bank, docs, and other non-source directories
245246- ` .markdownlint.json ` : Markdown linting configuration with relaxed rules for line length, headings, and formatting
246247- ` src/cli/ ` : CLI tooling for Governed RAG
247- - ` index.ts ` : CLI commands for document indexing, querying RAG, and usage statistics
248- - ` AGENTS.md ` : CLI documentation and usage patterns
248+ - ` index.ts ` : CLI commands for document indexing, querying RAG, and usage statistics
249+ - ` AGENTS.md ` : CLI documentation and usage patterns
249250
250251If you need more details for a subdirectory, open the folder-specific ` AGENTS.md ` which contains persona, purpose, and actionable commands.
251252
252253---
253- Last updated: 2025-12-11
254+
255+ Last updated: 2025-12-15
0 commit comments