Package-level declarations

Types

Link copied to clipboard
class AgentContextData(messageHistory: List<Message>, nodeId: String, lastInput: JsonElement, rollbackStrategy: RollbackStrategy, additionalRollbackActions: suspend (AIAgentContext) -> Unit = {})
Link copied to clipboard
interface AIAgentContext

The AIAgentContext interface represents the context of an AI agent in the lifecycle. It provides access to the environment, configuration, LLM context, state management, storage, and other metadata necessary for the operation of the agent. Additionally, it supports features for custom workflows and extensibility.

Link copied to clipboard
class AIAgentFunctionalContext(val environment: AIAgentEnvironment, val agentId: String, val runId: String, val agentInput: Any?, val config: AIAgentConfig, val llm: AIAgentLLMContext, val stateManager: AIAgentStateManager, val storage: AIAgentStorage, val strategyName: String, val pipeline: AIAgentFunctionalPipeline, val parentContext: AIAgentContext? = null) : AIAgentContext

Represents the execution context for an AI agent operating in a loop. It provides access to critical parts such as the environment, configuration, large language model (LLM) context, state management, and storage. Additionally, it enables the agent to store, retrieve, and manage context-specific data during its execution lifecycle.

Link copied to clipboard
class AIAgentGraphContext(val environment: AIAgentEnvironment, val agentId: String, val agentInputType: KType, val agentInput: Any?, val config: AIAgentConfig, llm: AIAgentLLMContext, stateManager: AIAgentStateManager, storage: AIAgentStorage, val runId: String, val strategyName: String, val pipeline: AIAgentGraphPipeline, val parentContext: AIAgentGraphContextBase? = null) : AIAgentGraphContextBase

Implements the AIAgentGraphContext interface, providing the context required for an AI agent's execution. This class encapsulates configurations, the execution pipeline, agent environment, and tools for handling agent lifecycles and interactions.

Link copied to clipboard

The AIAgentGraphContextBase interface extends the AIAgentContextBase interface to provide a foundational context specifically tailored for AI agents operating within a graph structure.

Link copied to clipboard
class AIAgentLLMContext(tools: List<ToolDescriptor>, val toolRegistry: ToolRegistry = ToolRegistry.EMPTY, prompt: Prompt, model: LLModel, val promptExecutor: PromptExecutor, environment: AIAgentEnvironment, config: AIAgentConfig, clock: Clock)

Represents the context for an AI agent LLM, managing tools, prompt handling, and interaction with the environment and execution layers. It provides mechanisms for concurrent read and write operations through sessions, ensuring thread safety.

Link copied to clipboard
annotation class DetachedPromptExecutorAPI

Annotation for marking APIs as detached prompt executors within the AIAgentLLMContext.

Link copied to clipboard

Properties

Link copied to clipboard

A storage key used for associating and retrieving AgentContextData within the AI agent's storage system.

Functions

Link copied to clipboard
inline fun <T> AIAgentContext.agentInput(): T

Utility function to get AIAgentContext.agentInput and try to cast it to some expected type.

Link copied to clipboard

Retrieves a feature from the AIAgentContext.pipeline associated with this context using the specified key.

Link copied to clipboard

Retrieves a feature from the AIAgentContext.pipeline associated with this context using the specified key or throws an exception if it is not available.

Link copied to clipboard

Retrieves the agent-specific context data associated with the current instance.

Link copied to clipboard

Removes the agent-specific context data associated with the current context.

Link copied to clipboard

Provides the root context of the current agent. If the root context is not defined, this function defaults to returning the current instance.

Link copied to clipboard

Stores the given agent context data within the current AI agent context.