File tree Expand file tree Collapse file tree 3 files changed +620
-67
lines changed Expand file tree Collapse file tree 3 files changed +620
-67
lines changed Original file line number Diff line number Diff line change 27
27
"@copilotkit/shared" : " 1.8.14-next.4" ,
28
28
"@mastra/client-js" : " ^0.10.9" ,
29
29
"@mastra/core" : " ^0.10.10" ,
30
+ "@mastra/dynamodb" : " ^0.13.0" ,
30
31
"@mastra/libsql" : " ^0.11.0" ,
31
32
"@mastra/loggers" : " ^0.10.3" ,
32
33
"@mastra/memory" : " ^0.11.1" ,
Original file line number Diff line number Diff line change @@ -2,10 +2,24 @@ import { openai } from "@ai-sdk/openai";
2
2
import { Agent } from "@mastra/core/agent" ;
3
3
import { Memory } from "@mastra/memory" ;
4
4
import { LibSQLStore } from "@mastra/libsql" ;
5
+ import { DynamoDBStore } from "@mastra/dynamodb" ;
6
+
5
7
import { Mastra } from "@mastra/core" ;
6
8
import { z } from "zod" ;
7
9
8
- // import { weatherTool } from "../tools/weather-tool";
10
+
11
+ let storage : LibSQLStore | DynamoDBStore
12
+
13
+ if ( process . env . DYNAMODB_TABLE_NAME ) {
14
+ storage = new DynamoDBStore ( {
15
+ name : "dynamodb" ,
16
+ config : {
17
+ tableName : process . env . DYNAMODB_TABLE_NAME
18
+ } ,
19
+ } ) ;
20
+ } else {
21
+ storage = new LibSQLStore ( { url : "file::memory:" } ) ;
22
+ }
9
23
10
24
export const mastra = new Mastra ( {
11
25
agents : {
@@ -24,9 +38,8 @@ export const mastra = new Mastra({
24
38
Use the weatherTool to fetch current weather data.
25
39
` ,
26
40
model : openai ( "gpt-4o" ) ,
27
- // tools: { weatherTool },
28
41
memory : new Memory ( {
29
- storage : new LibSQLStore ( { url : "file::memory:" } ) ,
42
+ storage : storage ,
30
43
options : {
31
44
workingMemory : {
32
45
enabled : true ,
@@ -53,7 +66,7 @@ export const mastra = new Mastra({
53
66
` ,
54
67
model : openai ( "gpt-4o" ) ,
55
68
memory : new Memory ( {
56
- storage : new LibSQLStore ( { url : "file::memory:" } ) ,
69
+ storage : storage ,
57
70
options : {
58
71
workingMemory : {
59
72
enabled : true ,
You can’t perform that action at this time.
0 commit comments