Neocortex
IntegrationsUnreal SDK

API Reference

Detailed reference for Neocortex Unreal SDK components

All Neocortex components are Blueprint-accessible. This reference covers the main components of the plugin; every function and event shown here can be used from both C++ and Blueprints.

Neocortex Smart Agent

UNeocortexSmartAgent is the primary component for AI character interactions. Add it to an actor, set the Project ID, and call its send functions. It automatically manages session state and service connections.

Properties

PropertyDescription
Project IDThe Neocortex project (character) this agent represents.
Include All InteractablesWhether to automatically include all registered interactables in API requests.
Use Radius FilterOnly include interactables within Search Radius of this agent's owner.
Search RadiusRadius in world units to search for nearby interactables.
LanguageISO 639-1 code (e.g. en, ar, fr) to lock speech transcription for this agent. Overrides the project-level default in Neocortex settings; leave empty to use the global default or auto-detect.
Beats ModeHow replies are delivered: Off, TextAndEmotion, or ExpressiveAudio. See Chat Beats.
Audio ComponentRequired for ExpressiveAudio mode; per-beat clips play here.

Functions

SendMessage

Sends a text message to the agent and receives a text response via OnChat.

  • Parameters:
    • Message: The message to send.

SendMessageForAudio

Sends a text message to the agent and receives both text (OnChat) and audio (OnAudio) responses.

  • Parameters:
    • Message: The message to send.

TranscribeBytes

Transcribes audio data to text, delivered via OnTranscribed.

  • Parameters:
    • Data: Audio data in WAV format.

SendAudioForAudio

Transcribes audio, then sends the result as a message, receiving both text and audio responses, the full voice-in / voice-out flow. Equivalent to Unity's AudioToAudio.

  • Parameters:
    • WavData: Audio data in WAV format.

GetChatHistory

Retrieves the chat history for this agent's character via OnChatHistory.

  • Parameters:
    • Limit: Maximum number of messages to retrieve (default 10).

ClearSessionId

Clears the session ID to start a new conversation.

IsRequestPending

Returns true while a request is in flight or a beats reply is still playing.

IsSpeaking

Returns true while a reply is pending or its beats are still being played back (beats modes).

Events

EventDescription
OnChatFired when a text chat response is received, with the chat response data (message, action, emotion, flow state).
OnAudioFired when an audio response is received, with a USoundWave ready to play.
OnTranscribedFired when audio transcription completes, with the transcribed text.
OnChatHistoryFired when chat history is retrieved, with an array of past messages.
OnErrorFired when an error occurs during any agent operation.
OnBeatStartedFired when a beat starts (its text is ready to show). Only in a beats mode.
OnEmotionChangedFired with each beat's emotion when the beat starts. Drive character animation here. Only in a beats mode.
OnReplyFinishedFired once the whole reply has finished playing. Only in a beats mode.

Chat Beats

Set Beats Mode to have replies delivered as ordered per-emotion "beats" instead of one block of text:

| Mode | Behavior | | ---- | -------- | ---- | | Off | Normal single reply. Default. | Unchanged | | TextAndEmotion | Reveal each beat as its own message and change emotion per beat. | | ExpressiveAudio | Also voice each beat in its own emotion. |

Expressive Audio needs an Audio Component

ExpressiveAudio requires an Audio Component assigned on the Smart Agent, and degrades automatically to a single clip, and then to text only, so the scene keeps working.

In a beats mode, input arriving while the character is still speaking is queued and submitted once the current reply finishes, there is no barge-in.

Emotions

The Emotion values received in chat responses and beat events cover 16 states, organized by intensity quadrants (calm/energetic and positive/negative):

Neutral, Happy, Pleased, Disappointed, Upset, Amazed, Curious, Confused, Alarmed, Fascinated, Impressed, Annoyed, Angry, Confident, Reassured, Concerned, Scared


Neocortex Microphone Recorder

UNeocortexMicrophoneRecorderComponent is a Blueprint-accessible component for capturing microphone input and optionally transcribing speech. It can automatically send recordings to a Smart Agent for transcription.

Properties

PropertyDescription
Smart AgentOptional Smart Agent reference for automatic transcription when recording stops.
Sample RateTarget sample rate in Hz (default 16000, tuned for speech recognition).
Num ChannelsNumber of audio channels (1 = mono, 2 = stereo; default 1).

Functions

StartRecording

Begins capturing audio from the default microphone device. Returns true if recording started successfully, false if permission was denied or the device is unavailable.

StopRecording

Stops capturing audio and optionally sends the result to the Smart Agent for transcription.

  • Parameters:
    • bAutoTranscribe: If true and Smart Agent is set, automatically transcribe the recording (default true).

IsRecording

Returns true if currently capturing audio.

GetAmplitude

Returns the RMS amplitude of the most recent audio chunk (0–1). Useful for driving amplitude UI.

GetAvailableDeviceNames

Returns display names of all available audio input devices.

SetPreferredDevice

Sets the preferred input device by name (must match a name from GetAvailableDeviceNames). Takes effect immediately, stops and restarts the capture device if recording.

Events

EventDescription
OnPcmChunkFired periodically during recording as new PCM audio chunks are captured.
OnWavReadyFired once when recording stops, with the complete WAV file.

Neocortex Interactable

UNeocortexInteractableComponent marks an actor as interactable within the Neocortex world state. It automatically registers with the subsystem on BeginPlay and unregisters on EndPlay, providing contextual information to AI agents about objects in the world.

Properties

PropertyDescription
TypeType classification of this interactable (e.g. "Character", "Object", "Item").
NameDisplay name of this interactable.
Is SubjectWhether this interactable is the subject of agent focus.
PropertiesCustom properties providing additional context about this interactable.

Enable Include All Interactables on the Smart Agent to send registered interactables (optionally filtered by Search Radius) with each chat request.


Neocortex Event Logger

UNeocortexEventLogger is a Blueprint function library for recording game events that give the character context about what recently happened in your game. The event log is sent with each chat request and consumed (cleared) automatically when sent.

Storage lives in the Neocortex subsystem, so it is isolated per GameInstance (PIE-safe). It holds at most 20 events with a maximum of 64 characters each, sorted by priority (High first, newest-first within a priority).

Functions

PushEvent

Records a game event. Content is silently truncated to 64 characters; ignored when the log is full.

  • Parameters:
    • Priority: Low, Medium, or High.
    • Content: A short description of the event.

ClearEvents

Clears all recorded events.


Neocortex Session Manager

UNeocortexSessionManager manages persistent session IDs for characters across gameplay sessions. Session data is cached in memory, persisted to configuration files, and thread-safe for concurrent access.

Functions

Get

Retrieves the session ID for a given character. Returns the stored session ID, or an empty string if not found.

  • Parameters:
    • ProjectId: Unique identifier for the Neocortex Smart NPC character.

Set

Stores or updates the session ID for a character.

  • Parameters:
    • ProjectId: Unique identifier for the character.
    • SessionId: Session ID to associate with the character.

Clear

Removes the session ID for a character, effectively starting a new conversation history.

  • Parameters:
    • ProjectId: Unique identifier for the character.

UI Widgets

The plugin ships with ready-made UMG widgets used by the sample maps, which you can reuse in your own UI:

WidgetDescription
Neocortex Chat PanelScrollable panel displaying the chat messages between the user and the agent.
Neocortex Chat MessageA single chat message entry, aligned and colored by sender.
Neocortex Text Chat InputText input field with a send button.
Neocortex Audio Chat InputVoice input button with recording feedback.
Neocortex Microphone SelectDropdown to select the microphone device.
Neocortex Thinking IndicatorLoading animation shown while the agent is processing a request.

Sample Maps

Sample maps are located at Plugins/Neocortex/Content/Samples:

MapDescription
SampleChatText chat with a Smart NPC.
SampleAudioVoice chat using the microphone recorder.
SampleChatHistoryFetching and displaying chat history.
SampleInteractablesMaking the NPC aware of interactable objects in the level.

On this page