|
1 | | - |
2 | | -import { Mastra } from '@mastra/core/mastra'; |
3 | | -import { PinoLogger } from '@mastra/loggers'; |
4 | | -import { LibSQLStore } from '@mastra/libsql'; |
5 | | -import { weatherWorkflow } from './workflows/weather-workflow'; |
6 | | -import { weatherAgent } from './agents/weather-agent'; |
7 | | -import { toolCallAppropriatenessScorer, completenessScorer, translationScorer } from './scorers/weather-scorer'; |
| 1 | +import { Mastra } from "@mastra/core/mastra"; |
| 2 | +import { PinoLogger } from "@mastra/loggers"; |
| 3 | +import { PostgresStore } from "@mastra/pg"; |
| 4 | +import { weatherWorkflow } from "./workflows/weather-workflow"; |
| 5 | +import { weatherAgent } from "./agents/weather-agent"; |
| 6 | +import { |
| 7 | + toolCallAppropriatenessScorer, |
| 8 | + completenessScorer, |
| 9 | + translationScorer, |
| 10 | +} from "./scorers/weather-scorer"; |
8 | 11 |
|
9 | 12 | export const mastra = new Mastra({ |
10 | 13 | workflows: { weatherWorkflow }, |
11 | 14 | agents: { weatherAgent }, |
12 | | - scorers: { toolCallAppropriatenessScorer, completenessScorer, translationScorer }, |
13 | | - storage: new LibSQLStore({ |
| 15 | + scorers: { |
| 16 | + toolCallAppropriatenessScorer, |
| 17 | + completenessScorer, |
| 18 | + translationScorer, |
| 19 | + }, |
| 20 | + storage: new PostgresStore({ |
14 | 21 | // stores observability, scores, ... into memory storage, if it needs to persist, change to file:../mastra.db |
15 | | - url: ":memory:", |
| 22 | + connectionString: process.env.DATABASE_URL!, |
16 | 23 | }), |
17 | 24 | logger: new PinoLogger({ |
18 | | - name: 'Mastra', |
19 | | - level: 'info', |
| 25 | + name: "Mastra", |
| 26 | + level: "info", |
20 | 27 | }), |
21 | 28 | telemetry: { |
22 | 29 | // Telemetry is deprecated and will be removed in the Nov 4th release |
23 | | - enabled: false, |
| 30 | + enabled: false, |
24 | 31 | }, |
25 | 32 | observability: { |
26 | 33 | // Enables DefaultExporter and CloudExporter for AI tracing |
27 | | - default: { enabled: true }, |
| 34 | + default: { enabled: true }, |
28 | 35 | }, |
29 | 36 | }); |
0 commit comments