import { Mastra } from '@mastra/core/mastra';
import { PinoLogger } from '@mastra/loggers';
import { LibSQLStore } from '@mastra/libsql';
import { weatherWorkflow } from './workflows/weather-workflow';
import { analyticsWorkflow } from './workflows/anaylitcs-workflow';
import { weatherAgent } from './agents/weather-agent';
import { toolCallAppropriatenessScorer, completenessScorer, translationScorer } from './scorers/weather-scorer';
import { myMcpServer } from '../mcp/weather-mcp';
import { analyticsAgent } from './agents/analytics-agent';
export const mastra = new Mastra({
workflows: { weatherWorkflow, analyticsWorkflow },
agents: { weatherAgent, analyticsAgent },
scorers: { toolCallAppropriatenessScorer, completenessScorer, translationScorer },
bundler: {
externals: ['supports-color', 'difflib'],
},
storage: new LibSQLStore({
// stores observability, scores, ... into memory storage, if it needs to persist, change to file:../mastra.db
url: ":memory:",
}),
logger: new PinoLogger({
name: 'Mastra',
level: 'info',
}),
telemetry: {
// Telemetry is deprecated and will be removed in the Nov 4th release
enabled: false,
},
observability: {
// Enables DefaultExporter and CloudExporter for AI tracing
default: { enabled: true },
},
mcpServers: { myMcpServer }
});