You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by da...@apache.org on 2026/04/28 16:51:39 UTC

(beam) branch master updated: Enhance documentation for stateful conversations (#38247)

This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d1d2476795 Enhance documentation for stateful conversations (#38247)
0d1d2476795 is described below

commit 0d1d2476795f9327a10d055e5c99ab4ee795fc6c
Author: Danny McCormick <da...@google.com>
AuthorDate: Tue Apr 28 12:51:29 2026 -0400

    Enhance documentation for stateful conversations (#38247)
    
    Add recommendation for session_service_factory in stateful conversations.
---
 sdks/python/apache_beam/ml/inference/agent_development_kit.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/ml/inference/agent_development_kit.py b/sdks/python/apache_beam/ml/inference/agent_development_kit.py
index 8f3f046c7f2..1130598f06f 100644
--- a/sdks/python/apache_beam/ml/inference/agent_development_kit.py
+++ b/sdks/python/apache_beam/ml/inference/agent_development_kit.py
@@ -96,7 +96,12 @@ class ADKAgentModelHandler(ModelHandler[str | genai_Content,
   batch. By default every invocation uses a fresh, isolated session (stateless).
   Stateful multi-turn conversations can be achieved by passing a ``session_id``
   key inside ``inference_args``; elements sharing the same ``session_id`` will
-  continue the same conversation history.
+  continue the same conversation history. When using stateful conversations,
+  it is recommended to use a custom session_service_factory to provide a session
+  service implementation which can be managed across multiple workers (e.g.
+  :class:`~google.adk.sessions.DatabaseSessionService`). The default
+  :class:`~google.adk.sessions.InMemorySessionService` will not correctly track
+  the same session across multiple workers.
 
   Args:
     agent: A pre-constructed :class:`~google.adk.agents.Agent` instance, or a