Skip to main content
The Primitive demos call the runtime APIs directly to interact with individual modules.

InworldController

InworldController is the main GameObject in the Unity scene. Each primitive module is organized as a child under this object. At runtime, InworldController executes modules in batches according to the configured loading process.

Loading Process

Some modules depend on others having already started. For example, Knowledge, Safety, and Intent require TextEmbedder to be initialized first. To handle this, InworldController maintains a list of loading batches. A batch only starts once the previous batch has fully completed. After all batches have finished, the controller raises the event OnFrameworkInitialized?.Invoke(). Any objects subscribed to this event can then proceed with their own initialization.

Primitive Modules

Each module has a prefab stored at Assets/InworldRuntime/Prefabs/Primitives. These modules expose API methods for you to call, and they communicate directly with our graph system through DLL interop.
Primitive modules are also required in Graph/Node templates.Make sure to include the relevant primitives when working with graph or node-based setups.

Structure

Each module class includes a Factory, an Interface, and at least one Config. When InworldController starts, each module creates its Factory. The factory then creates the appropriate Interface based on the active Config (for example, Local vs. Remote, whether to use CUDA, etc.). The Interface is the surface that ultimately interacts with the user or with the Graph. For example, when you call InworldController.LLM.GenerateTextAsync(), the controller first verifies that the LLM module exists and that its interface is initialized, then it calls LLMInterface.GenerateText. The same is true for the Node System. Each node (for example, LLMNode) requires an LLMInterface when CreateRuntime() is called to instantiate its runtime handle.