APEX Atomic Transactions & Temporary ID Mapping
Transaction Execution Model
APEX dispatches all environment mutations inside atomic batches. Transactions success is binary: either every batched operation executes flawlessly, or the transaction fails as a whole and reverts. This ensures the live 3D engine is never left in an unstable, partially configured state.
Transaction Protocol Contracts
The communication schema defines exact request, response, and result structures for atomic commits:
export enum ApexTransactionStatus {
SUCCESS = "success",
INVALID = "invalid",
FAILURE = "failure"
}
export interface ApexTransactionRequest {
/** Explains the agent's goal. Vital for telemetry and RAG-ready KB logging. */
intent: string;
actions: ApexAction[
];
}
export interface ApexTransactionResponse {
/** Strict atomic outcome. */
status: ApexTransactionStatus;
/** Maps the agent's tempIds to the Engine's true IDs */
idMap: Record<string, string>;
/** Cascade alerts, success confirmations, or exact schema failure reasons */
message: string[];
}
export interface ApexActionResult {
status: ApexTransactionStatus;
message: string;
idMap?: Record<string, string>;
structures?: ApexInspectionTargetStructure[];
}Client-Side Temporary ID Resolution (idMap)
One of the major hurdles in multi-step 3D environment generation is referencing an object before it is officially committed to the engine database. For example: creating a new SCENE_OBJECT and immediately adding an EFFECT to it inside the exact same batch transaction.
APEX resolves this via Temporary ID mapping:
1. The agent assigns a temporary ID when adding a scene object (e.g., "targetId": "temp_shoe_mesh").
2. In the same batch, the agent can reference that temporary ID inside dependent actions (e.g., setting the effect's "parentId": "temp_shoe_mesh").
3. The APEX transaction coordinator translates temp_shoe_mesh to the real engine UUID during execution, registers the correct database relation, and reports the final UUID translation table inside the transaction response idMap:
{
"status": "success",
"idMap": {
"temp_shoe_mesh": "c502b4d2-fbfb-4f70-a8dc-6ef31c4b79b9"
}
}4. This allows agents to seamlessly track constructed objects and coordinate highly complex, multi-layered operations within a single network round-trip.
The Importance of 'Intent' Telemetry
The intent string in ApexTransactionRequest is a semantic explanation of what the agent is attempting to achieve (e.g., "Bifurcating custom shoe material dataset configurations by registering two separate option sets for leather and suede textures").
This is recorded in the live engine telemetry logs to build a RAG-ready knowledge database, helping secondary agents track historical environment mutations and reconstruct past human-agent cooperation chains.
Basic APEX Transaction Examples#
Dataset & Row Operations
Here are simple payloads demonstrating basic addition and modification of datasets and dynamic dataset rows:
// ADD a new Dataset
[
{
"operation": "ADD",
"domain": "DATASET",
"targetId": "dataset_customers",
"payload": {
"schema": {"id": "STRING", "price": "FLOAT"},
"name": "TestAPEX7"
}
}
]// EDIT an existing Dataset schema
[
{
"operation": "EDIT",
"domain": "DATASET",
"targetId": "bn5w3msa6n",
"payload": {
"schema": {"id": "STRING", "price": "FLOAT", "coolness": "FLOAT"},
"name": "A Cooler Name1"
}
}
]// ADD a new Dataset Row record
[
{
"operation": "ADD",
"domain": "DATASET_ROW",
"targetId": "anything3",
"payload": {
"datasetId": "bn5w3msa6n",
"values": {"id": "anything3", "price": 1, "coolness": 101}
}
}
]// EDIT an existing Dataset Row record
[
{
"operation": "EDIT",
"domain": "DATASET_ROW",
"targetId": "anything5",
"payload": {
"datasetId": "bn5w3msa6n",
"values": {"price": 10000, "coolness": 106}
}
}
]Option Model & Set Configurations
Here are simple payloads demonstrating adding and editing Option Models and Option Sets:
// ADD a new Option Model
[
{
"operation": "ADD",
"domain": "OPTION_MODEL",
"targetId": "NEW_ID",
"payload": {
"name": "Apex Test 1"
}
}
]// EDIT an existing Option Model
[
{
"operation": "EDIT",
"domain": "OPTION_MODEL",
"targetId": "d4ya54XkRpU9aMVo",
"payload": {
"name": "Apex Test 1b"
}
}
]// ADD a new Option Set linked to Option Model and Dataset
[
{
"operation": "ADD",
"domain": "OPTION_SET",
"targetId": "New Options",
"payload": {
"name": "Apex Options 1",
"optionModelId": "d4ya54XkRpU9aMVo",
"datasetId": "bn5w3msa6n"
}
}
]





