Back to prompt library
Implement DataSynthesizer Agent with Claude 4 Opus and Gemini 3 Flash
Linked challenge: Strategic Market Intel
Prompt source
implementation6 lines1 sectionsNo variables1 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...
});
```