System Overview: From UE5 to Core
The value of LiteRT-LM lies not in a single inference, but in this incremental architecture deeply optimized for Unreal Engine long-conversation scenarios.
Three-Layer Progressive Architecture
Business Integration
Handles FabServer message models, mapping in-game NPC logic to AI requests.
Integration Abstraction
Implements incremental message synchronization. Maintains one-to-one persistent mapping between Session and Agent.
Physical Isolation
Completely resolves symbol conflicts via ABI firewall. Background thread drives WaitUntilDone heartbeat.
Incremental Sync Model
Physical KV Cache Persistence
In LiteRtLmUnrealApi.cpp, the system precisely tracks the synced message index for each Agent via SessionMsgCountMap. Switching Agents is like switching pointers in GPU memory, enabling zero-overhead multi-Agent interaction.
Role Normalization Logic
Since underlying models (like Gemma-2) do not natively support system or tool roles, the UnrealApi layer performs complex protocol downgrading:
Code Snippet (Normalization logic)
if (Role == "tool") {
NewMsg->SetStringField("role", "user");
NewMsg->SetStringField("content",
"[Tool Result] (id: " + id + ")\n" + Content);
}