> For the complete documentation index, see [llms.txt](https://thebitcave.gitbook.io/ai-brain-extensions-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://thebitcave.gitbook.io/ai-brain-extensions-docs/aibrain-graph/node-reference.md).

# Node Reference

The *AI Brain Graph* comes packed with four main type  of nodes:

* *AI Brain State Node*
* *AI Transition Node*
* *AI Action Node*
* *AI Decision Node*

Additionally, you'll get some helper nodes:

* *Comment Node*
* *AI Brain State Alias Node*
* *AI Brain Any State Node*

Finally, when you work with a Subgraph, you have access to:

* *AI Brain Subgraph Nodes*
* *AI State In Nodes*
* *AI Transition Out Nodes*

## Main Nodes

### AI Brain State Node

A **State** node represents a single state in the MMTools *AIBrain*.

{% hint style="warning" %}
Each state should be given a unique name by right-clicking the header and choosing *Rename.*
{% endhint %}

The *Set as starting state* button will set the state as the first one in the MMTools *AIBrain* states list.

#### Attributes

* **Can Transition To Self**: if set to false, self referencing transitions will be removed (for instance *Idle > Idle*)

#### Inputs

* **States In** (multiple *State* connections): a list of entry points from other states transitions
* **Actions** (multiple *Action* connections): a list of actions that should be performed when entering the state itself

#### Outputs

* **Transitions** (multiple *Transition* connections): a list of transitions that will let the system exit from this state&#x20;

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxKVhHW-L0mUwbseTIK%2F-LxLwgem4Y4lBmkPEuQr%2Fnode_reference_001.png?alt=media\&token=d7f2a7ae-90a5-48d2-bcd3-4a559ad01154)

### AI Transition Node

A **Transition** node represents a single transition from a state in the MMTools *AI Brain*: a state can have more than one transition.

If you wish, you can rename the node by right-clicking the header and choosing *Rename* but this won't affect the AI generation.

{% hint style="warning" %}
A Transition node should always have a connected *AIDecision* node
{% endhint %}

#### Attributes

This node has no attributes.

#### Inputs

* **Decision** (single *Decision* connection): a single *AI Decision Node* that will let the AI Brain exit from the actual state
* **Input** (single *Transition* connection): a single connection from the *AI Brain State*

#### Outputs

* **True State** (single *State* connection): a connection to the state that should be activated when the decision is true
* **False State** (single *State* connection): a connection to the state that should be activated when the decision is false

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxKVhHW-L0mUwbseTIK%2F-LxLwXS13sQLRDzlZvQK%2Fnode_reference_002.png?alt=media\&token=e263ec1c-3ac8-425c-9fb4-acca76032281)

### AI Action Node

**Action** nodes are graph representations of *AIAction* components. They come with a single output element that should be connected to the state. This will tell the state itself that this action should be executed.

A node may have some parameters, corresponding with the Corgi/TopDown engine *AIAction* components.

If you wish, you can rename the node by right-clicking the header and choosing *Rename* but this won't affect the AI generation.

#### Attributes

* **Label**: corresponds to the regular *AIAction* label
* Depending on the corresponding *AIAction*, you'll have access to a list of paramenters

#### Inputs

This node has no input connections.

#### Outputs

* **Output** (multiple *Action* connections): a single *AI Decision Node* that will let the AI Brain exit from the actual state

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxKVhHW-L0mUwbseTIK%2F-LxLx-L_NsTAiM0ktVij%2Fnode_reference_003.png?alt=media\&token=843536bc-135e-4bd9-8b5b-77810178de90)

### AI Decision Node

**Decision** nodes are a graph representation of *AIDecision* components. They come with a single output element that should be connected to a state transition. This will define the condition to exit the state.

If you wish, you can rename the node by right-clicking the header and choosing *Rename* but this won't affect the AI generation.

#### Attributes

* **Label**: corresponds to the regular *AIDecision* label
* Depending on the corresponding *AIDecision*, you'll have access to a list of paramenters

#### Inputs

This node has no input connections.

#### Outputs

* **Output** (multiple *Decision* connections): a single *AIDecision Node* that will let the AI Brain exit from the actual state

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxKVhHW-L0mUwbseTIK%2F-LxLxCF_Mi-7k1LL3qOc%2Fnode_reference_004.png?alt=media\&token=9562e2a3-23a3-4b82-aa73-ffaaf3b18948)

## Helper Nodes

### Comment Node

Comment nodes have the only purpose of letting you add notes in your graph. They won't generate anything in the character AI Brain System.

{% hint style="info" %}
Clicking on the header will let you enter edit note.
{% endhint %}

#### Attributes

This node has no input attributes.

#### Inputs

This node has no input connections.

#### Outputs

This node has no output connections.

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxRespjHaJpvCGSRQXQ%2F-LxRgBkol0a9UULBUhsA%2Fnode_reference_008.png?alt=media\&token=7f098ca5-43fd-4dd1-bea7-cff397907584)

### AI Brain State Alias Node

The **AI Brain State Alias Node** will let you create alias elements for your states: this will avoid main spaghetti like brains when things get complicated.

#### Attributes

* **Available States**: the node will show a list of nodes:
  * In the main graph all nodes and subgraph-exposed nodes will be shown
  * In a subgraph, only inner nodes will be shown

#### Inputs

* **States In** (multiple *State* connections): a list of entry points from other states transitions

#### Outputs

This node has no output connections.

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxM1MYxZeMbfHdzt33B%2F-LxM4C9oxmU73sZR6MO9%2Fnode_reference_010.png?alt=media\&token=94625449-4a54-4231-be1b-045d2bac9d32)

### AI Brain Any State Node

The **AI Brain Any State** node will let you generate Decision/Transition logic for all nodes in your graph:

* If added in a main Graph, also subgraph States will be affected
* If added in a subgraph, only subgraph States will be affected

#### Attributes

This node has no input attributes.

#### Inputs

This node has no input connections.

#### Outputs

* **Transitions** (multiple *Transition* connections): a list of transitions that will let the system exit all included states

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxM1MYxZeMbfHdzt33B%2F-LxM2iTf1VGiFoKyQRgz%2Fnode_reference_009.png?alt=media\&token=5ae34968-479b-42dc-8af6-7f45dc1a18eb)

## Subgraph Nodes

### AI Brain Subgraph Node

A **Subgraph** node is a special state node, that lets you create a inner state/decision/action logic.&#x20;

It can be set as a starting node (in this case its inner starting node will be used).

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxKVhHW-L0mUwbseTIK%2F-LxLxetBbhhTbIB498qS%2Fnode_reference_.png?alt=media\&token=1a583d4e-14c4-4cad-9c5f-0a787102396e)

You can create a subgraph asset and assign it to the *Subgraph* field.

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxKVhHW-L0mUwbseTIK%2F-LxLxsBWWmYoidbbA_IG%2Fnode_reference_005.png?alt=media\&token=4f3b521c-a3f3-4f6e-82f9-3d6553b86ac8)

{% hint style="warning" %}
You cannot create nested subgraphs (i.e.: you cannot add a subgraph inside a subgraph)
{% endhint %}

#### Attributes

* **Subgraph**: the subgraph data

#### Inputs

* **State In** (list of multiple *State* connections): a dynamically generated list of state connections (see *AI State In Nodes*)

**Outputs**

* **Transition Out** (list of single *Transition* connections): a dynamically generated list of transition connections (see *AI Transition Out Nodes*)

### AI State In Node

The **AI State In** node exposes an *AI Brain State* node inside a subgraph to the parent brain graph.

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxLybSuOAMDBruLb__o%2F-LxLzKIh_KfPQqO8H-15%2Fnode_reference_006.png?alt=media\&token=1e3c435c-5ba0-43c7-90a7-884dde5a5b4d)

{% hint style="warning" %}
*State In* nodes are only available in a subgraph.
{% endhint %}

#### Attributes

This node has no attributes

#### Inputs

This node has no input connections.

#### Outputs

* **Input** (single *State* connection): this node will generate a *State In* connection in the subgraph node of the parent graph

### AI Transition Out Node

The **AI Transition Out** node exposes an *AI Transition* node connection inside a subgraph to the parent brain graph.

![](https://1480578063-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LwY4qXRelZyML_CLwPb%2F-LxLybSuOAMDBruLb__o%2F-LxLzTmM9roZQpk8FZcA%2Fnode_reference_007.png?alt=media\&token=50ef821f-b2d8-4bbf-a4a9-d9068552c466)

{% hint style="warning" %}
*Transition Out* nodes are only available in a subgraph.
{% endhint %}

#### Attributes

This node has no attributes

#### Inputs

* **Output** (single *Transition* connection): this node will generate a *Transition Out* connection in the subgraph node of the parent graph

#### Outputs

This node has no output connections.
