Aktor
Aktors are the building blocks of Operaide. An Aktor is a functional, asynchronous building block of the Reaktor system, akin to an implementation of the Interpreter Pattern or an executable Abstract Syntax Tree (AST). Aktors are the foundation for composing Reaktors. They are either used as the root entry point, serving as a Reaktor of composed Aktors, or as inner building blocks of a Reaktor. Aktors can be nested, executing either inner Aktors, which in turn are also nested, or AktorFunctions, which are the leaf nodes of the tree.
Aktors are the smallest executable units in the Reaktor, defined in TypeScript. They serve as functional, asynchronous building blocks with the following properties:
- Composition: Aktors are composed into directed graphs, where each Aktor may have input Aktors (dependencies) and child Aktors. The root Aktor is a executed by a Reaktor. These graphs may contain cycles. The Graph contains a tree of Aktors.
- Execution: Each Aktor returns a JSON-serializable object via an asynchronous .get() method or a Stream of JSON-serializable objects via an asynchronous .stream() method.
- Monitoring: Aktors can be tracked using a Reaktor-Trace.
IMPORTANT: Each building block of Operaide is an Aktor. Reaktors return an Aktor, Aktors themselves return Aktors, AktorFunctions return Aktors.
This section sets the theoretical background for Aktors. To see how to create an Aktor, please refer to the Building Reaktors and Aktors documentation, which provides a comprehensive guide on creating and using Aktors.
Aktor Structure
Aktors are created with the defineAktor function. This function takes a name, a tree of functions, and inputs.
It is important to understand, that ther is only one implementation of the Aktor interface but they can be configured with different AktorOptions. The AktorOptions allow to specify the inputs and the id of the Aktor as well as some functions to get the value of the Aktor.
Here is a visual representation of the Aktor structure:

As you can see, an Aktor is a tree that is executed like a run around the tree, following it's branches, executing the AktorFunctions, and returning a final Aktor value. You will find further explanation in the Guide.
An Aktor has the following properties:
name: The name of the AktorcreateAktor: The function that creates the Aktor tree, returning a final Aktor valueinput: The inputs for the Aktor
See this example of an Aktor:
defineAktor(
// Name of the Aktor
'aktorDocumentChat',
{
// The Aktor tree of multiple Aktors chained
createAktor({ content, system, documentGroupId }) {
// Logic happens here, returns an Aktor value
return answer;
},
},
// uses the inputs for Aktors
input
);
Aktor Tree
The Aktor tree is a tree of functions that are executed in order. The tree is defined in the createAktor function. This function takes the inputs for the Aktor and returns an Aktor value.
Think of this tree as a run around the tree branches, starting at the root Aktor and going down the branches, executing the leaf nodes (AktorFunctions) and returning a final Aktor value.
Here is a visual representation of an Aktor as tree structure:

as you can see, the Aktor is executed by following the inner Aktors as branches in order, running the AktorFunctions and returning each Aktor after it's functons have been executed. This results in a clear schema that provides a final Aktor value.
Aktor-Library
The Aktor-Library is a set of stable reusable Aktors maintained by the Operaide Team.
They are strictly backward compatible. Backward incompatible changes require a new version of the Aktor.