> Discover all available pages from the documentation index: https://mastra.zisheng.pro/ja/llms.txt # Agent.getMemory() `.getMemory()` メソッドは、Agent に関連付けられた Memory システムを取得します。このメソッドは、会話をまたいで情報を保存、取得する Agent の Memory 機能へアクセスするために使います。 ## 使用例 ```typescript await agent.getMemory() ``` ## パラメータ **options** (`{ requestContext?: RequestContext }`): リクエストコンテキストを含む任意の設定オブジェクト。 (Default: `{}`) **options.requestContext** (`RequestContext`): 依存性注入とコンテキスト情報に使う Request Context。 ## 戻り値 **memory** (`Promise`): Agent に設定された Memory システムへ解決される Promise。Memory システムが設定されていない場合は undefined へ解決されます。 ## 詳細な使用例 ```typescript await agent.getMemory({ requestContext: new RequestContext(), }) ``` ## 関連項目 - [Memory](https://mastra.zisheng.pro/ja/docs/memory/overview) - [Request Context](https://mastra.zisheng.pro/ja/docs/server/request-context)