Neocortex
IntegrationsGodot SDK

Quick Start

Learn about the Godot integration in Neocortex

The Neocortex Godot SDK is an editor plugin that allows you to easily integrate Neocortex Smart NPCs and Virtual Assistants into your Godot project. It provides GDScript nodes and classes that mirror the Unity SDK's API, including chat, voice, chat history, event logging, and usage endpoints.

Beta

The Godot SDK is currently in beta. Follow Neocortex on GitHub for the public release announcement.

Requirements

Talking to Your First Character

Installation

  • Copy the addons/neocortex-godot-sdk folder into your project's addons directory
  • Go to Project > Project Settings > Plugins
  • Enable the Neocortex Godot SDK plugin

After enabling the plugin, a Neocortex dock will appear in the editor.

API Key Setup

To start using the Neocortex SDK, you need to initialize it with your Neocortex API key. You can create a new API key from the Neocortex web platform by going to the API Keys page.

  • Create a new API key and copy it
  • Open the Neocortex dock in the Godot editor
  • Paste the API key into the API Key field, it is saved automatically

Add a Smart Agent

  • Add a NeocortexSmartAgent node to your scene
  • Create a new project in the Neocortex web platform and copy the project ID from the URL
  • Paste the project ID into the agent's Character Id property in the Inspector

Create a Control Script

Connect to the agent's signals and send your first message:

extends Node

@onready var agent: NeocortexSmartAgent = $NeocortexSmartAgent

func _ready() -> void:
    agent.chat_response_received.connect(_on_chat_response)
    agent.request_failed.connect(_on_request_failed)

    agent.text_to_text("Hello, Neocortex!")

func _on_chat_response(response) -> void:
    print("NPC: ", response.message)

func _on_request_failed(error: String) -> void:
    push_error(error)

Add Voice (Optional)

For voice output, use text_to_audio and play the returned stream:

@onready var player: AudioStreamPlayer = $AudioStreamPlayer

func _ready() -> void:
    agent.audio_response_received.connect(_on_audio_response)
    agent.text_to_audio("Hello, Neocortex!")

func _on_audio_response(audio) -> void:
    player.stream = audio
    player.play()

For voice input, record the microphone into an AudioStreamWAV (see Godot's AudioEffectRecord) and send it with audio_to_text or audio_to_audio.

Congratulations! You have successfully set up the Neocortex Godot SDK and interacted with your first Smart NPC.

UI Nodes

The plugin ships with ready-made UI scenes under addons/neocortex-godot-sdk/nodes that you can instance in your own scenes:

SceneDescription
NeocortexChatPanelScrollable panel displaying the chat messages between the user and the agent.
NeocortexMessageA single chat message entry, aligned and colored by sender.
NeocortexMicrophoneDropdownDropdown to select the microphone device.

On this page