@mastra/dynamodb
v1.4.2
Published
DynamoDB storage adapter for Mastra
Keywords
Readme
@mastra/dynamodb
Persist Mastra data in Amazon DynamoDB with a single-table ElectroDB design, configurable indexes, TTL support, credentials, and table initialization.
Installation
npm install @mastra/dynamodbUsage
Basic Usage
import { Memory } from '@mastra/memory';
import { DynamoDBStore } from '@mastra/dynamodb';
import { PineconeVector } from '@mastra/pinecone';
// Initialize the DynamoDB storage
const storage = new DynamoDBStore({
name: 'dynamodb',
config: {
region: 'us-east-1',
tableName: 'mastra-single-table', // Name of your DynamoDB table
},
});
// Initialize vector store (if using semantic recall)
const vector = new PineconeVector({
id: 'dynamodb-pinecone',
apiKey: process.env.PINECONE_API_KEY,
});
// Memory combines storage (like DynamoDBStore) with an optional vector store for recall
// Create memory with DynamoDB storage
const memory = new Memory({
storage,
vector,
options: {
lastMessages: 10,
semanticRecall: true,
},
});Documentation
Changelog
See the package changelog for version history and release notes.
Support
We have an open community Discord. Come and say hello and let us know if you have any questions or need any help getting things running.
