Back to Prompt Library
planning
Mastra AI Project Setup and Agent Definition
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Autonomous Market Intelligence Agent Swarm with Mastra AI and GPT-5 Pro
Format
Code-aware
Lines
7
Sections
1
Linked challenge
Autonomous Market Intelligence Agent Swarm with Mastra AI and GPT-5 Pro
Prompt source
Original prompt text with formatting preserved for inspection.
7 lines
1 sections
No variables
1 code block
Initialize a new Mastra AI project. Define two initial agents: a 'MarketResearcher' and an 'Analyst'. The MarketResearcher should be responsible for data gathering (simulated via tools or direct data access), and the Analyst for synthesizing findings. Configure GPT-5 Pro as the underlying LLM for both agents. Provide TypeScript code snippets for agent definition. ```typescript
import { MastraAgent, MastraCore } from '@mastra-ai/core'; const core = new MastraCore({ apiKey: process.env.MASTRA_API_KEY }); const marketResearcher = new MastraAgent({ name: 'MarketResearcher', description: 'Gathers raw market data and competitive intelligence.', model: 'gpt-5-pro', // ... add tool definitions here later
}); const analyst = new MastraAgent({ name: 'Analyst', description: 'Synthesizes market data into actionable insights and reports.', model: 'gpt-5-pro', // ... add tool definitions here later
}); // Register agents with core (example, actual API might differ)
// core.registerAgent(marketResearcher);
// core.registerAgent(analyst);
```Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Preserve the role framing, objective, and reporting structure so comparison runs stay coherent.
Tune next
Swap in your own domain constraints, anomaly thresholds, and examples before you branch variants.
Verify after
Check whether the prompt asks for the right evidence, confidence signal, and escalation path.