> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Mastra.listMemory() `.listMemory()` メソッドは、Mastra インスタンスに登録されているすべての Memory インスタンスを返します。 ## 使用例 ```typescript const memoryInstances = mastra.listMemory() for (const [key, memory] of Object.entries(memoryInstances)) { console.log(`Memory "${key}": ${memory.id}`) } ``` ## パラメーター このメソッドはパラメーターを受け取りません。 ## 戻り値 **memory** (`Record`): 登録済みのすべての Memory インスタンスを含むオブジェクト。レジストリキーでキー付けされています。 ## 例: 登録済み Memory の確認 ```typescript import { Mastra } from '@mastra/core' import { Memory } from '@mastra/memory' import { LibSQLStore } from '@mastra/libsql' const conversationMemory = new Memory({ id: 'conversation-memory', storage: new LibSQLStore({ id: 'conversation-store', url: ':memory:' }), }) const analyticsMemory = new Memory({ id: 'analytics-memory', storage: new LibSQLStore({ id: 'analytics-store', url: ':memory:' }), }) const mastra = new Mastra({ memory: { conversationMemory, analyticsMemory, }, }) // List all registered memory instances const allMemory = mastra.listMemory() console.log(Object.keys(allMemory)) // ["conversationMemory", "analyticsMemory"] ``` ## 関連項目 - [Mastra.getMemory()](https://mastra.zisheng.pro/ja/reference/core/getMemory) - [Memory の概要](https://mastra.zisheng.pro/ja/docs/memory/overview)