Back to Prompt Library
implementation
Implement DataSynthesizer Agent with Claude 4 Opus and Gemini 3 Flash
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Strategic Market Intel
Format
Code-aware
Lines
6
Sections
1
Linked challenge
Strategic Market Intel
Prompt source
Original prompt text with formatting preserved for inspection.
6 lines
1 sections
No variables
1 code block
Implement the 'DataSynthesizer' agent using Mastra AI. This agent should be responsible for consuming raw market data and using Gemini 3 Flash for initial summarization and Claude 4 Opus for deeper trend analysis. Provide Mastra AI agent definition code and demonstrate how to call these models via its framework. ```typescript
import { Agent, Task, Tool } from '@mastra-ai/core';
import { LLM } from '@mastra-ai/llm'; const claude4Opus = new LLM('anthropic', { model: 'claude-4-opus' });
const gemini3Flash = new LLM('google', { model: 'gemini-3-flash' }); const dataSynthesizerAgent = new Agent({ name: 'DataSynthesizer', description: 'Synthesizes raw market data into coherent insights.', tools: [ new Tool('summarizeWithGemini', async (data: string) => { const response = await gemini3Flash.run(data, { prompt: 'Summarize the following data:' }); return response.output; }), new Tool('analyzeTrendsWithClaude', async (summary: string) => { const response = await claude4Opus.run(summary, { prompt: 'Analyze key trends and implications:' }); return response.output; }), ], // Further implementation for tasks and reactions...
});
```Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.