StartNode

Represents the base node for starting a subgraph in an AI agent strategy graph. This node acts as an entry point for executing subgraphs.

This node effectively passes its input as-is to the next node in the execution pipeline, allowing downstream nodes to transform or handle the data further.

The name property of the node reflects a uniquely identifiable pattern using the prefix "start" and the optional subgraph name, enabling traceability of execution flow in multi-subgraph setups.

Parameters

Input

The type of input data this node processes and produces as output.

subgraphName

The name of the related subgraph

type

KType representing Input

Properties

Link copied to clipboard

Represents the directed edges connecting the current node in the AI agent strategy graph to other nodes. Each edge defines the flow and transformation of output data from this node to another.

Link copied to clipboard
val execute: suspend AIAgentContextBase.(input: Input) -> Input

A suspending function that defines the execution logic for the node. It processes the provided input within the given execution context and produces an output.

Link copied to clipboard
val id: String

Represents the unique identifier of the AI agent node.

Link copied to clipboard
open override val inputType: KType

The KType of the Input

Link copied to clipboard
open override val name: String

The name of the node, used for identification and debugging.

Link copied to clipboard
open override val outputType: KType

The KType of the Output

Functions

Link copied to clipboard
open fun addEdge(edge: AIAgentEdge<Input, *>)

Adds a directed edge from the current node, enabling connections between this node and other nodes in the AI agent strategy graph.

Link copied to clipboard
open suspend override fun execute(context: AIAgentContextBase, input: Input): Input

Executes a specific operation based on the given context and input.

Link copied to clipboard
suspend fun executeUnsafe(context: AIAgentContextBase, input: Any?): Any?

Executes the node operation using the provided execution context and input, bypassing type safety checks. This method internally calls the type-safe execute method after casting the input. The lifecycle hooks onBeforeNode and onAfterNode are invoked before and after the execution respectively.

Link copied to clipboard

Creates a directed edge from this AIAgentNodeBase to another AIAgentNodeBase, allowing data to flow from the output of the current node to the input of the specified node.

Link copied to clipboard

Resolves the edge associated with the provided node output and execution context. Iterates through available edges and identifies the first edge that can successfully process the given node output within the provided context. If a resolvable edge is found, it returns a ResolvedEdge containing the edge and its output. Otherwise, returns null.