Graph#

Core#

OrkesGraph(state[, name, description, traced])

A class to represent a stateful graph for orchestrating multi-agent workflows.

Runner#

GraphRunner(graph_name, graph_description, ...)

Executes a compiled OrkesGraph, managing state and tracing the execution.

Schema#

NodePoolItem

Represents an item in the node pool, which is a collection of nodes and their associated edges within the graph.

NodeTrace

Represents the trace of a single node's execution within the graph.

LLMTraceSchema

Represents the input and output of an LLM interaction for tracking purposes.

FunctionTraceSchema

Represents the trace of a single function's execution, capturing its inputs, output, and timing.

EdgeTrace

Represents the trace of a single edge traversal during a graph execution.

TracesSchema

Represents the complete execution trace of a graph run.

Units#

Node(name, func, graph_state)

Represents a node in the computational graph.

Edge(from_node[, to_node, max_passes])

Represents a directed connection between two nodes in the graph.

ForwardEdge(from_node, to_node[, max_passes])

An edge that unconditionally forwards data and control from a source node to a destination node.

ConditionalEdge(from_node, gate_function, ...)

An edge that determines the next node based on the outcome of a gate function.

ParallelEdge(from_node, to_nodes, ...[, ...])

An edge that creates multiple parallel branches of execution.

Utilities#

orkes_tracable(func)

A decorator that traces the input, output, and execution time of a function and records it in the current edge's trace.

function_assertion(func, expected_type)

Asserts that a function has at least one parameter with the expected type annotation.

is_typeddict_class(obj)

Checks if an object is a TypedDict class.

check_dict_values_type(d, cls)

Checks if all values in a dictionary are of a certain type.

randomize_color_hex()

Generates a random hex color code.