Interface AgentContext
- All Superinterfaces:
Context
,MetadataContext
Provides access to session information and tracing capabilities for agents. The context is only available during command processing and will throw an exception if accessed from the agent constructor.
Session Management: The session id identifies the contextual context for the agent. Multiple agents can share the same session id to collaborate on a common goal, sharing session memory and contextual history.
Tracing: Custom tracing can be added for observability and debugging purposes.
-
Method Summary
Methods inherited from interface akka.javasdk.Context
selfRegion
Methods inherited from interface akka.javasdk.MetadataContext
metadata
-
Method Details
-
sessionId
String sessionId()Returns the session identifier for this agent interaction.The agent participates in a session, which is used for the agent's contextual memory. Session memory is shared between all agents that use the same session id, enabling multi-agent collaboration and maintaining context across interactions.
- Returns:
- the session id for this agent interaction
-
tracing
Tracing tracing()Provides access to tracing for custom application-specific tracing.Use this to add custom spans and trace information for observability and debugging of agent interactions.
- Returns:
- tracing interface for custom tracing
-