AIAgentRunSession
Represents a session for running an ai.koog.agents.core.agent.AIAgent.
An AIAgentRunSession encapsulates a single execution lifecycle of an AI agent, providing a controlled environment for running the agent's strategy with specific input and context. Each session is independent and manages its own execution state, pipeline coordination, and resource lifecycle.
Sessions are typically created through ai.koog.agents.core.agent.AIAgentBase.createSession and can be reused for multiple sequential executions. The session handles:
Pipeline preparation and feature initialization
Strategy execution with proper error handling
Event notifications at each execution stage
Resource cleanup after execution completes
Parameters
the type of input data required by the agent's strategy.
the type of output data produced by the agent's strategy.
the type of context used during execution, extending AIAgentContext.
See also
Functions
Retrieves a feature from the AIAgentRunSession.pipeline associated with this session using the specified key.
Retrieves a feature from the AIAgentRunSession.pipeline associated with this session using the specified key or throws an exception if it is not available.
Returns the pipeline associated with this session. The pipeline becomes available after the first call to run with a pipeline parameter.