Unreal Engine SDK

Store/thunk runtime for Unreal Engine 5.7

View as Markdown

The current Unreal Engine plugin mirrors @forbocai/core and @forbocai/node: a shared store, slice state, selectors, and thunks. The public runtime is centered on FSDKState, createSDKStore(), SDKOps, and rtk::*Thunk APIs.

This page reflects the current sdk-ue-5.7.3 source. It does not describe the older factory-style integration examples that still exist in parts of the historical demo project.

What Ships

  • RuntimeStore.h: FSDKState, createSDKStore(), ConfigureSDKStore()
  • NPC/NPCSlice.h: NPC entity state, selectors, history, block state
  • Protocol/ProtocolThunks.h: rtk::processNPC(...) multi-turn protocol execution
  • Memory/MemoryThunks.h: remote memory and local node-backed memory
  • Cortex/CortexThunks.h: local llama.cpp and remote cortex helpers
  • Bridge/BridgeThunks.h: validation, presets, and rulesets
  • Soul/SoulThunks.h: local export, remote export/import, list, verify
  • Ghost/GhostThunks.h: Ghost session start/status/results/history
  • CLI/CliOperations.h: synchronous SDKOps::* wrappers over the same thunks
  • RuntimeBlueprintLibrary.h: Blueprint-callable wrappers for a smaller subset

Canonical Runtime Pattern

Use createSDKStore() when you want your own store instance in C++. The synchronous SDKOps helpers are thin adapters over store dispatch and match the CLI/test workflow in the plugin.

1#include "RuntimeStore.h"
2#include "RuntimeConfig.h"
3#include "CLI/CliOperations.h"
4
5auto Store = createSDKStore();
6SDKConfig::SetApiConfig(TEXT("https://api.forboc.ai"), ApiKey);
7
8FNPCInternalState Npc = SDKOps::CreateNpc(
9 Store,
10 TEXT("A cautious merchant who protects rare inventory."));
11
12SDKOps::InitNodeMemory(Store, TEXT("/tmp/merchant.db"));
13SDKOps::InitCortex(Store, TEXT("smollm2-135m"));
14
15FAgentResponse Response =
16 SDKOps::ProcessNpc(Store, Npc.Id, TEXT("Do you sell keys?"));
17
18UE_LOG(LogTemp, Display, TEXT("%s"), *Response.Dialogue);

Important Protocol Behavior

  • SDKOps::ProcessNpc(...) and rtk::processNPC(...) run the API-directed multi-turn protocol, not a single completion call.
  • rtk::LocalProtocolRuntime() is the default runtime used by the synchronous helpers.
  • If the API asks for memory recall/store and local memory is not initialized, processing fails fast.
  • If the API asks for inference and local cortex is not initialized, processing fails fast.
  • A successful finalize step updates NPC state, last action, history, and any returned memory instructions.

Access Layers

Direct store/thunks

Best when you want parity with packages/core and packages/node.

1#include "RuntimeStore.h"
2#include "NPC/NPCSlice.h"
3#include "Memory/MemoryThunks.h"
4#include "Cortex/CortexThunks.h"
5#include "Protocol/ProtocolThunks.h"

SDKOps

Best for commandlets, tests, and synchronous tooling.

1#include "CLI/CliOperations.h"

Blueprints

Best for simple wrapper calls such as CreateNpc, ProcessNpc, ExportSoul, and config access.

1#include "RuntimeBlueprintLibrary.h"

Next Pages