Quick Start
Install the Neocortex Unreal Engine plugin and talk to an AI character in Unreal Engine 5 by text or voice, with ready chat widgets, seven sample maps and a few lines of C++ or Blueprint.
The Neocortex Unreal SDK brings the characters you build on Neocortex into your Unreal Engine game. They talk and listen, show an emotion on every line, act in your world, chat in groups and host quizzes, with lip sync and ready-made UI.
Requirements
- A Neocortex account
- Unreal Engine 5.0 or later
- A C++ project. The plugin ships as source and is compiled with your project. To turn a Blueprint-only project into a C++ project, add any class with
Tools>New C++ Class. - A C++ toolchain for your engine version: Visual Studio on Windows, Xcode on macOS
Setup
Get the plugin
Download Source code (zip) from the latest release, unzip it into your project's Plugins folder and rename the unzipped folder to Neocortex. Or clone it there:
cd YourProject/Plugins
git clone https://github.com/neocortex-link/neocortex-unreal-sdk NeocortexNeocortex.uplugin should end up directly in YourProject/Plugins/Neocortex/.
Open the project
Open your .uproject. The editor says the Neocortex modules are missing and asks to rebuild them: choose Yes. The first build takes a few minutes. A plugin in the project's Plugins folder is enabled on its own, and microphone input is turned on for you, so no file needs editing.

Paste your API key
Create a key on the API Keys page. Open Tools > Neocortex, paste the key and press Save and refresh. Your account, characters and question sets appear below it.

Your key ships with your game
The key is saved in Config/DefaultGame.ini, so a packaged game carries it. Keep it out of public repositories and set usage limits on it.
Try the samples
Press Open Samples in the Neocortex window, then press Play. Pick your character, question set and microphone above the cards. See Samples for what each one shows.

Add a chat to your game
Add a Neocortex Smart Agent component to an actor and pick your character with the Pick button next to its Project ID. Then show the ready chat widget for it:
#include "NeocortexSmartAgent.h"
#include "UI/NeocortexChatUI.h"
void AMyCharacter::BeginPlay()
{
Super::BeginPlay();
UNeocortexSmartAgent* Agent = FindComponentByClass<UNeocortexSmartAgent>();
UNeocortexChatUI* Chat = CreateWidget<UNeocortexChatUI>(GetWorld()->GetFirstPlayerController(), UNeocortexChatUI::StaticClass());
Chat->SetAgent(Agent);
Chat->AddToViewport();
}Run the game and say hello. In Blueprints, use Create Widget with NeocortexChatUI, then Set Agent and Add to Viewport.
To use the plugin from your own C++ code, add "Neocortex" to your module's dependencies in YourProject.Build.cs. Blueprints need nothing extra.
From code
Bind the agent's events and send it a message:
void AMyActor::BeginPlay()
{
Super::BeginPlay();
Agent->OnChatLineStarted.AddDynamic(this, &AMyActor::HandleLine);
Agent->OnEmotionChanged.AddDynamic(this, &AMyActor::HandleEmotion);
Agent->OnRequestError.AddDynamic(this, &AMyActor::HandleError);
Agent->SendMessage(TEXT("Hello there!"));
}
void AMyActor::HandleLine(const FNeocortexChatLine& Line)
{
UE_LOG(LogTemp, Log, TEXT("%s"), *Line.Text);
}
void AMyActor::HandleError(const FNeocortexRequestError& Error)
{
if (Error.IsRetryable()) { /* busy, try again in a moment */ }
else { UE_LOG(LogTemp, Error, TEXT("%s"), *Error.Message); }
}The handlers are UFUNCTION()s. Each reply arrives as lines, each with its own emotion and voice. See Chat lines and Handling errors.
Voice
Add a Neocortex Microphone Recorder component and give it to the chat widget with Chat->SetMicrophone(Microphone) before it is shown. The chat listens, sends what the player says once they pause, and listens again. Chat->SetPushToTalk(true) swaps that for a button to hold. To handle the recording yourself, see Neocortex Microphone Recorder.
Mobile
Android: turn on Project Settings > Platforms > Android > Advanced APK Packaging > Add permissions to support Voice chat (RECORD_AUDIO), and ask for the permission at runtime with UNeocortexMicrophonePermission::RequestMicrophonePermission().
iOS: add a microphone usage description in Project Settings > Platforms > iOS > Additional Plist Data:
<key>NSMicrophoneUsageDescription</key><string>Used for voice chat with characters.</string>On Windows and macOS, players grant microphone access in the system's privacy settings.
Troubleshooting
- The plugin does not appear: make sure
Neocortex.upluginis directly inPlugins/Neocortex/, not in a nested folder left by unzipping. - The rebuild fails: right-click the
.uproject, choose Generate Visual Studio project files (or Generate Xcode project), and build theYourProjectEditortarget from your IDE to see the error. - The microphone does not record: check the microphone permission in your system's privacy settings, and look for
LogNeocortexandLogVoicemessages in the Output Log.
To update, close the editor, replace Plugins/Neocortex with the latest release (or run git pull in it), and open the project again to rebuild.
API Reference
C# reference for the Neocortex Unity SDK 0.8 with AI NPC agents, chat lines, actions, group chat, quizzes, usage, voice, lip sync and errors in Unity.
Editor Tools
The Neocortex window, Details panel pickers and sample tools in the Unreal Editor. Manage your API key, pick AI characters and question sets, and open the samples.