@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
27 lines (18 loc) • 606 B
Markdown
# Mastra.setStorage()
The `.setStorage()` method is used to set the storage instance for the Mastra instance. This method accepts a single `MastraCompositeStore` parameter.
## Usage example
```typescript
mastra.setStorage(
new LibSQLStore({
id: 'mastra-storage',
url: ':memory:',
}),
)
```
## Parameters
**storage** (`MastraCompositeStore`): The storage instance to set for the Mastra instance.
## Returns
This method doesn't return a value.
## Related
- [Storage overview](https://mastra.ai/reference/storage/overview)
- [Storage reference](https://mastra.ai/reference/storage/libsql)