# The AIBrain Graph System

The **AI Brain Graph** editor is a tool used to create Corgi/TopDown Engines AI logic through a visual node editor.

{% hint style="info" %}
The tool is built on top of [xNode](https://github.com/Siccity/xNode) by Thor Brigsted.
{% endhint %}

## Working with the Graph

### Creating a Graph

A graph is an asset stored in your project *Assets* folder. To create one:

1. Right click anywhere in the Assets folder
2. Select Create > The Bit Cave > AI Brain Graph
3. Rename the brain asset
4. Double click on it to show the editor window

### Creating a SubGraph

Like the graph, a subgraph is an asset stored in your project *Assets* folder. To create one:

1. Right click anywhere in the Assets folder
2. Select Create > The Bit Cave > AI Brain Graph
3. Rename the brain asset
4. Double click on it to show the editor window

### Adding Nodes

To add nodes to the graph (or subgraph) simply right click on any free space and select the desired node.

{% hint style="info" %}
Please check the [Node Reference](/ai-brain-extensions-docs/aibrain-graph/node-reference.md) page for a list of available nodes.
{% endhint %}

## Using a Graph on a Character

When you add a graph to a Corgi/TopDown character, the system will parse your nodes and will translate them to *AIBrain*/*AIAction*/*AIDecision* components.

To achieve this, all you have to do is to add one of these components:

* AI Brain Generator: this component will generate all needed elements to the character&#x20;
* AI Brain Pluggable: similar to the previous component, but the generation will be at runtime

{% hint style="info" %}
Please check the [Corgi](/ai-brain-extensions-docs/aibrain-graph/corgi-engine-getting-started-tutorial.md) and [TopDown](/ai-brain-extensions-docs/aibrain-graph/topdown-engine-getting-started-tutorial.md) getting stated tutorials for an example on how to use these components.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://thebitcave.gitbook.io/ai-brain-extensions-docs/aibrain-graph/the-aibrain-graph-system.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
