> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Primitives Overview

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

<CardGroup cols={2}>
  <Card title="LLM Demo" href="/Unity/runtime/demos/primitives/llm">
    Interact with the Large Language Model (LLM) primitive directly.
  </Card>

  <Card title="Speech-To-Text (STT) Demo" href="/Unity/runtime/demos/primitives/stt">
    Try out the Speech-to-Text primitive for transcribing audio input to text.
  </Card>

  <Card title="Text-To-Speech (TTS) Demo" href="/Unity/runtime/demos/primitives/tts">
    Generate audio output from text using the Text-to-Speech primitive.
  </Card>

  <Card title="AEC Demo" href="/Unity/runtime/demos/primitives/aec">
    Explore Acoustic Echo Cancellation with the AEC primitive module.
  </Card>

  <Card title="Knowledge Demo" href="/Unity/runtime/demos/primitives/knowledge">
    Query and interact with the Knowledge primitive.
  </Card>

  <Card title="Character Interaction Demo" href="/Unity/runtime/demos/primitives/character">
    Experience a full pipeline by combining primitives in the Character Interaction demo.
  </Card>
</CardGroup>

## 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.

<Note>
  Primitive modules are also required in Graph/Node templates.

  Make sure to include the relevant primitives when working with graph or node-based setups.
</Note>

### 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.
