From 90ebf7babbc4c9a98ccbe696c9a7519031c35d2d Mon Sep 17 00:00:00 2001 From: Matthias Schur <107557548+MattSchur@users.noreply.github.com> Date: Tue, 20 Oct 2026 10:26:43 +0200 Subject: [PATCH] Java: Persistent Agent Memory --- java/ai.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/java/ai.md b/java/ai.md index 867df248d3..dc3f48e212 100644 --- a/java/ai.md +++ b/java/ai.md @@ -27,10 +27,8 @@ client can talk to them. For compatibility reasons with Joule and Agent Gateway, version 0.3.0 of the A2A protocol is used by default. ::: - -::: warning In-Memory Chat History Only -CAP Java doesn't yet have a persistent chat history. Instead, it stores conversation history in volatile memory. Hence, you need to send all follow-up prompts to the same server instance. -::: +> [!warning] Alpha — Not for Production +> CAP Java agents are under active development. The data model and APIs may change. ### Adding the Dependency @@ -43,6 +41,23 @@ Add the agent adapter to your `srv/pom.xml`: ``` +Add the `agent-memory` model to your project's `package.json`: + +```json +{ + "cds": { + "requires": { + "agent-memory": { + "model": "com.sap.cds/ai/agent-memory" + } + } + } +} +``` + +> [!warning] Persistent Agent Memory +> There is no automatic cleanup yet. Clear the session table periodically. + ### Defining an Agent Annotate a service with `@agent` to expose it as an agent: