Package-level declarations
Types
A concrete implementation of the HistoryCompressionStrategy that splits the session's prompt into chunks of a predefined size and generates summaries (TL;DR) for each chunk.
Represents a distinct piece of knowledge that an agent can remember and recall. Concepts are the fundamental building blocks of the agent's memory system, allowing structured storage and retrieval of information across different contexts and time periods.
Represents stored information about a specific concept at a point in time. Facts are the actual data points stored in the memory system, always associated with their originating concept and creation timestamp for temporal reasoning.
A history compression strategy that extracts structured facts about predefined concepts from the current conversation history using an LLM, then replaces the full history with a compact assistant message containing those extracted facts.
Defines how information should be stored and retrieved for a concept in the memory system. This type system helps organize and structure the knowledge representation in the agent's memory.
A strategy for compressing history by retaining only the last n messages in a session.
A strategy for compressing message histories using a specified timestamp as a reference point. This strategy removes messages that occurred before a given timestamp and creates a summarized context for further interactions.
Represents an abstract strategy for compressing the history of messages in a AIAgentLLMWriteSession. Different implementations define specific approaches to reducing the context size while maintaining key information.
Represents a message that has undergone moderation and the result of the moderation.
Wraps a list of ReceivedToolResult values returned by the agent environment after tool execution.
Stores a single piece of information about a concept. Used when the concept represents a singular, atomic piece of knowledge that doesn't need to be broken down into multiple components.
Wraps a list of pending tool calls produced by an LLM response.
Wraps a list of tool results ready to be sent back to the LLM.
WholeCompressionStrategyWithMultipleSystemMessages is a concrete implementation of the HistoryCompressionStrategy that handles scenarios where the conversation history contains multiple system messages.
WholeHistory is a concrete implementation of the HistoryCompressionStrategy that encapsulates the logic for compressing entire conversation history into a succinct summary (TL;DR) and composing the necessary messages to create a streamlined prompt suitable for language model interactions.
Functions
InternalAgentsApi method. Appends a prompt to the current LLM session.
Applies a transformation to the intermediate output of the edge builder and filters the received tool results based on the provided condition. This function is used to handle tool results as a part of the AI agent's edge flow within the DSL.
Creates an edge that transforms an intermediate output into a Message.User using the provided transform.
InternalAgentsApi method. Executes a single tool with the provided arguments and returns the result.
InternalAgentsApi method. Performs LLM history compression.
A node that adds messages to the LLM prompt using the provided prompt builder. The input is passed as it is to the output.
A pass-through node that does nothing and returns input as output
A node that executes a single MessagePart.Tool.Call and returns the ReceivedToolResult without writing anything into the LLM session.
A node that calls a specific tool directly using the provided arguments.
A node that executes the tool calls in a ToolCalls input and returns the raw ReceivedToolResults without writing them into the LLM session.
A node that compresses the current LLM prompt (message history) into a summary, replacing messages with a TLDR.
A node that runs content moderation on an incoming Message using the LLM.
A node that runs content moderation on an incoming text using the LLM.
A node that appends a user text message to the prompt and requests a response from the LLM.
A node that appends a user text message to the prompt and requests a response from the LLM, forcing it to call exactly the specified tool.
A node that appends a user text message to the prompt and requests multiple completion choices from the LLM, returning them as an LLMChoice.
A node that appends a user text message to the prompt and requests a response from the LLM, forcing it to call one of the available tools (no plain-text replies allowed).
A node that appends a user text message to the prompt and requests a streaming response from the LLM, returning raw StreamFrame elements.
A node that appends a user text message to the prompt and requests a streaming response from the LLM, applying transformStreamData to convert the raw StreamFrame flow into a flow of T.
A node that appends a user text message to the prompt and requests a structured response from the LLM using the provided config.
A node that appends a user text message to the prompt and requests a structured response from the LLM, inferring the output schema from the reified type T.
A node that appends a user text message to the prompt and requests a response from the LLM, without exposing any tools (pure text response only).
A node that appends a Message.User to the prompt and requests a response from the LLM.
A node that appends a Message.User to the prompt and requests a response from the LLM, forcing it to call exactly the specified tool.
A node that appends a Message.User to the prompt and requests multiple completion choices from the LLM, returning them as an LLMChoice.
A node that appends a Message.User to the prompt and requests a response from the LLM, forcing it to call one of the available tools (no plain-text replies allowed).
A node that appends a Message.User to the prompt and requests a streaming response from the LLM, returning raw StreamFrame elements.
A node that appends a Message.User to the prompt and requests a streaming response from the LLM, applying transformStreamData to convert the raw StreamFrame flow into a flow of T.
A node that appends a Message.User to the prompt and requests a structured response from the LLM using the provided config.
A node that appends a Message.User to the prompt and requests a structured response from the LLM, inferring the output schema from the reified type T.
A node that appends a Message.User to the prompt and requests a response from the LLM, without exposing any tools (pure text response only).
A node that appends tool results from ReceivedToolResults to the prompt as a user message and requests a follow-up response from the LLM.
A node that appends tool results from ReceivedToolResults to the prompt as a user message and requests a follow-up response from the LLM, forcing it to call exactly the specified tool.
A node that appends tool results from ReceivedToolResults to the prompt as a user message and requests multiple completion choices from the LLM, returning them as an LLMChoice.
A node that appends tool results from ReceivedToolResults to the prompt as a user message and requests a follow-up response from the LLM, forcing it to call one of the available tools.
A node that appends tool results to the prompt and requests a streaming response from the LLM, returning raw StreamFrame elements.
A node that appends tool results from ReceivedToolResults to the prompt as a user message and requests a follow-up response from the LLM, without exposing any tools (pure text response only).
Creates a node that sets up a structured output for an AI agent subgraph.
Defines a handler to process failure cases in a directed edge strategy by applying a condition to filter intermediate results of type SafeTool.Result.Failure. This method is used to specialize processing for failure results and to propagate or transform them based on the provided condition.
Creates an edge that filters outputs based on their type.
Creates an edge that filters outputs based on their MessagePart subtype.
Filters and transforms the intermediate outputs of the AI agent node based on the success results of a tool operation.
Creates an edge that transforms an intermediate output into a Message.User using the provided transform.
Creates an edge that filters tool call messages for a specific tool.
Creates an edge that filters tool call messages for a specific tool and arguments condition.
Creates an edge that filters assistant messages containing tool calls, based on a custom condition. The default condition onToolCalls { true } will create a conditional edge checking that there at list one tool call The custom condition onToolCalls { it.tool == "exit" } will create a conditional edge checking that there is tool call with the name "exit"
InternalAgentsApi method. Appends a Message.User with given text to the prompt and requests a streaming response from the LLM.
InternalAgentsApi method. Sets up structured output for an AI agent subgraph.