Vertex AI Agent Engine Memory Bank を使用すると、ユーザーとエージェントの会話に基づいて長期記憶を動的に生成できます。長期記憶は、特定のユーザーの複数のセッションでアクセスできるパーソナライズされた情報です。エージェントはメモリーを使用して、ユーザーへの回答をパーソナライズし、セッション間の継続性を実現できます。
Memory Bank の機能は次のとおりです。
複数の環境からアクセスできる思い出の永続ストレージ。Vertex AI Agent Engine セッションと Memory Bank は、Vertex AI Agent Engine ランタイムにデプロイされたエージェント、ローカル環境、または他のデプロイ オプションで使用できます。
Agent Development Kit で Vertex AI Agent Engine Memory Bank を使用すると、エージェントは Memory Bank を使用して長期記憶の読み取りと書き込みを行う呼び出しをオーケストレートできます。
Memory Bank を Vertex AI Agent Engine Sessions とともに使用して、次のプロセスで保存されたセッションから記憶を生成できます。
(セッション)CreateSession: 会話の開始時に新しいセッションを作成します。エージェントが使用する会話履歴は、このセッションに限定されます。セッションには、ユーザーとエージェント間のやり取りのメッセージとアクション(SessionEvents)の時系列順のシーケンスが含まれます。すべてのセッションにユーザー ID が必要です。このセッションで抽出されたメモリ(GenerateMemories を参照)はこのユーザーにマッピングされます。
REST API を使用したクイックスタート: REST API クイックスタートに沿って、Vertex AI Agent Engine のセッションとメモリバンクに API 呼び出しを直接行います。
エージェント開発キット(ADK)を使用したクイックスタート: ADK エージェントに Vertex AI Agent Engine Sessions と Memory Bank への呼び出しをオーケストレートする場合は、エージェント開発キット(ADK)のクイックスタートに従います。
プロンプト インジェクションのセキュリティ リスク
Vertex AI の共有責任で説明されているセキュリティ上の責任に加えて、長期記憶を使用する際にエージェントに影響を与える可能性のあるプロンプト インジェクションとメモリ汚染のリスクを考慮してください。メモリ ポイズニングは、誤った情報がメモリバンクに保存されたときに発生します。エージェントは、今後のセッションでこの誤った情報や悪意のある情報に基づいて動作する可能性があります。
メモリ汚染のリスクを軽減するには、次の操作を行います。
Model Armor: Model Armor を使用して、Memory Bank に送信されるプロンプトやエージェントから送信されるプロンプトを検査します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["# Vertex AI Agent Engine Memory Bank overview\n\n| **Preview**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nVertex AI Agent Engine Memory Bank lets you dynamically generate long-term memories based on users' conversations with your agent. Long-term memories are personalized information that can be accessed across multiple sessions for a particular user. The agent can use the memories to personalize responses to the user and create cross-session continuity.\n\nFeatures of Memory Bank include the following:\n\n- Persistent storage of memories that can be accessed from multiple environments. You can use Vertex AI Agent Engine Sessions and Memory Bank with your deployed agent on Vertex AI Agent Engine Runtime, from your local environment, or with other deployment options.\n\n- Large language model (LLM)-based extraction of memories from conversation history.\n\n- Memories are remotely generated asynchronously, so the agent doesn't need to wait for memories to be generated.\n\n- Similarity search-based retrieval of memories scoped to an identity ([`scope`](/vertex-ai/generative-ai/docs/agent-engine/memory-bank/fetch-memories#scope-based)).\n\n- If you use Vertex AI Agent Engine Memory Bank with Agent Development Kit, your agent can orchestrate calls to read and write long-term memories using Memory Bank.\n\nYou can use Memory Bank with Vertex AI Agent Engine Sessions to generate memories from stored sessions using the following process:\n\n1. **(Sessions) `CreateSession`** : At the start of each conversation, create a new session. The conversation history used by the agent is scoped to this session. A session contains the chronological sequence of messages and actions (`SessionEvents`) for an interaction between a user and your agent. All sessions must have a user ID; the extracted memories (see `GenerateMemories`) for this session are mapped to this user.\n\n2. **(Sessions) `AppendEvent`**: As the user interacts with the agent, events (such as user messages, agent responses, tool actions) are uploaded to Sessions. The events persist conversation history and create a record of the conversation that can be used to generate memories.\n\n3. **(Sessions) `ListEvents`**: As the user interacts with the agent, the agent retrieves the conversation history.\n\n4. **(Memory Bank)** Generate or create memories:\n\n - **`GenerateMemories`**: At a specified interval (such as the end of every session or the end of every turn), the agent can trigger memories to be generated using conversation history. Facts about the user are automatically extracted from the conversation history so that they're available for current or future sessions.\n\n - **`CreateMemory`** : Your agent can write memories directly to Memory Bank. For example, the agent can decide when a memory should be written and what information should be saved (memory-as-a-tool). Use `CreateMemory` when you want your agent to have more control over what facts are extracted.\n\n5. **(Memory Bank) `RetrieveMemories`**: As the user interacts with your agent, the agent can retrieve memories saved about that user. You can either retrieve all memories (simple retrieval) or only the most relevant memories to the current conversation (similarity search retrieval). Then you can insert the retrieved memories into your prompt.\n\nQuickstarts\n-----------\n\nGet started with Memory Bank using the following quickstarts:\n\n- [**Quickstart using REST API**](/vertex-ai/generative-ai/docs/agent-engine/memory-bank/quickstart-api): Follow the REST API quickstart to make API calls directly to Vertex AI Agent Engine Sessions and Memory Bank.\n\n- [**Quickstart using Agent Development Kit (ADK)**](/vertex-ai/generative-ai/docs/agent-engine/memory-bank/quickstart-adk): Follow the Agent Development Kit (ADK) quickstart if you want your ADK agent to orchestrate calls to Vertex AI Agent Engine Sessions and Memory Bank for you.\n\nSecurity risks of prompt injection\n----------------------------------\n\nIn addition to the security responsibilities outlined in [Vertex AI shared responsibility](/vertex-ai/docs/shared-responsibility), consider the risk of prompt injection and memory poisoning that can affect your agent when using long-term memories. Memory poisoning occurs when false information is stored in Memory Bank. The agent may then operate on this false or malicious information in future sessions.\n\nTo mitigate the risk of memory poisoning, you can do the following:\n\n- **Model Armor** : Use [Model Armor](/security-command-center/docs/model-armor-overview) to inspect prompts being sent to Memory Bank or from your agent.\n\n- **Adversarial testing**: Proactively test your LLM application for prompt injection vulnerabilities by simulating attacks. This is typically known as \"red teaming.\"\n\n- **Sandbox execution**: If the agent has the ability to execute or interact with external or critical systems, these actions should be performed in a sandboxed environment with strict access control and human review.\n\nFor more information, see [Google's Approach for Secure AI Agents](https://research.google/pubs/an-introduction-to-googles-approach-for-secure-ai-agents/).\n\nWhat's next\n-----------\n\n- [Set up Memory Bank](/vertex-ai/generative-ai/docs/agent-engine/memory-bank/set-up).\n- [Quickstart with Agent Development Kit](/vertex-ai/generative-ai/docs//agent-engine/memory-bank/quickstart-adk).\n- [Quickstart with Vertex AI Agent Engine SDK](/vertex-ai/generative-ai/docs//agent-engine/memory-bank/quickstart-api)."]]