augengine
Guide · 0.4.1-alpha.0

Getting started

Go from an empty folder to a WebGPU scene with a floor, a sun, an animated glTF character, and a persona that remembers you across page reloads. Then drive a scene from an agent over MCP.

Tested

On 2026-11-27, in a fresh Vite 8 project with no Vite configuration, @mnemopay/augengine@latest (0.4.1-alpha.0) and @mnemopay/sdk@latest (1.17.0), in headed Chrome on Intel UHD. Three loads printed "First time here?", then "visit 2", then "visit 3". main.ts typechecks and vite build succeeds. This is an alpha, so APIs can change between releases.

The first scene: a waving robot on a dark plinth casting a long shadow under a dusk sky, captioned 'Welcome back. That's visit 3.'
The result after three page loads.

What you need

1. Install

npm create vite@latest my-scene -- --template vanilla-ts
cd my-scene
npm install @mnemopay/augengine@latest @mnemopay/sdk

The engine works without @mnemopay/sdk. This guide uses the SDK for in-process memory (createInProcessBrain), which loads @mnemopay/sdk/recall the first time it is used. No Vite configuration is needed.

Next, get a character. Any skinned .glb works. This guide uses the CC0 Quaternius robot that Studio bundles for retargeting:

mkdir -p public
curl -o public/character.glb https://augengine.com/assets/character.glb

2. The page

index.html:

<!doctype html>
<html>
  <body style="margin:0;background:#111">
    <canvas id="game" style="width:100vw;height:100vh;display:block"></canvas>
    <p id="say" style="position:fixed;left:16px;bottom:16px;color:#eee;font:16px system-ui"></p>
    <script type="module" src="/main.ts"></script>
  </body>
</html>

3. The first scene

main.ts is about 51 lines of code. Each numbered comment marks one step.

import { Scene, Tag, loadGltfIntoRenderer, applyGltfAnimation,
  createInProcessBrain, createMnemoPayMemoryAdapter, type Entity, type EntityId } from "@mnemopay/augengine";
import { createLiveRenderer, lookAtTransform } from "@mnemopay/augengine/runtime/live";

// 1. Renderer (WebGPU only; throws if the browser has no WebGPU).
const canvas = document.getElementById("game") as HTMLCanvasElement;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
const renderer = createLiveRenderer(canvas, { sampleCount: 1 }); // 1x MSAA lets TAA and SSAO run
await renderer.init();
renderer.setSky(true);
renderer.setShadowQuality("high");
renderer.setImageQuality({ taa: true, ao: true });
renderer.setLook({ tonemapper: "aces", exposure: 1.0, bloomIntensity: 0.2 });

// 2. Scene: a camera, a floor, a plinth, a sun and a fill light. Entities are plain data.
const id = (s: string) => s as EntityId;
const at = (position: [number, number, number], scale: [number, number, number] = [1, 1, 1]) =>
  ({ position, rotation: [0, 0, 0, 1], scale, parent: null }) as const;
const pbr = (baseColor: [number, number, number], roughness: number) =>
  ({ kind: "pbr", baseColor, metallic: 0, roughness }) as const;
const entities: Entity[] = [
  { id: id("camera"), name: "Camera", components: {
      transform: { ...lookAtTransform([1.4, 1.5, 3.2], [0, 0.95, 0], [0, 1, 0]), parent: null },
      camera: { fovY: 0.75, near: 0.1, far: 200, active: true } } },
  { id: id("floor"), name: "Floor", components: { transform: at([0, 0, 0], [40, 1, 40]),
      mesh: { geometry: { kind: "primitive", shape: "plane" }, visible: true, material: pbr([0.16, 0.15, 0.15], 0.8) } } },
  { id: id("plinth"), name: "Plinth", components: { transform: at([0, 0.04, 0], [0.9, 0.04, 0.9]),
      mesh: { geometry: { kind: "primitive", shape: "cylinder" }, visible: true, material: pbr([0.05, 0.055, 0.065], 0.3) } } },
  { id: id("sun"), name: "Sun", components: { transform: at([-3, 5, 2.5]),
      light: { kind: "directional", color: [1, 0.9, 0.75], intensity: 3.2 } } },
  { id: id("fill"), name: "Fill", components: { transform: at([2.5, 1.8, 2]),
      light: { kind: "point", color: [0.55, 0.65, 1], intensity: 2.5, range: 8 } } },
];
const scene = new Scene({ schemaVersion: 1, source: { kind: "authored", path: "first-scene" },
  entities, defaultCamera: id("camera") });

// 3. A glTF character: one call uploads its meshes and textures and adds its entities to the scene.
const { instance: rook } = await loadGltfIntoRenderer(renderer, scene, "/character.glb",
  { idPrefix: "rook", position: [0, 0.08, 0], rotation: [0, 0.2, 0, 0.98] });
const wave = rook!.animations.find((a) => a.name.endsWith("|Wave")) ?? rook!.animations[0];

// 4. A persona whose memory survives reloads (in-process brain, saved to localStorage).
const brain = createInProcessBrain({ loadRecall: () => import("@mnemopay/sdk/recall"),
  initial: JSON.parse(localStorage.getItem("rook-memory") ?? "[]"),
  onPersist: () => localStorage.setItem("rook-memory", JSON.stringify(brain.snapshot())) });
const memory = createMnemoPayMemoryAdapter({ client: brain, mode: "vector" });
scene.get(rook!.rootEntityId)!.components[Tag.Persona] =
  { traits: ["warm", "observant"], voice: null, memoryId: "rook", goals: [], mood: 0.2 };
const visits = await memory.recall("rook", "player visited", 50);
document.getElementById("say")!.textContent = visits.length
  ? `Rook: "Welcome back. That's visit ${visits.length + 1}."` : `Rook: "First time here?"`;
await memory.remember("rook", `player visited at ${new Date().toISOString()}`, ["visit"]);

// 5. Loop: animate, render.
const start = performance.now();
(function frame(now: number) {
  if (wave) applyGltfAnimation(scene, rook!, wave, (now - start) / 1000, { loop: true });
  renderer.render(scene);
  requestAnimationFrame(frame);
})(start);
  1. Renderer. createLiveRenderer returns AugEngine's own WebGPU renderer. setSky(true) turns on the gradient sky. sampleCount: 1 switches multisampling off so temporal anti-aliasing and ambient occlusion (setImageQuality) can run; setShadowQuality("high") gives the sun a soft shadow map (shadows are off by default) and setLook picks the ACES tone mapper.
  2. Scene. A scene is plain data: entities with components such as transform, mesh, light, camera and persona. A directional light with no rotation shines from its position toward the origin.
  3. glTF. loadGltfIntoRenderer fetches and parses the file, uploads each primitive (and its PBR textures, if any) under the key gltf:<url>#<primitive> that a { kind: "gltf", url } mesh looks up, and adds the file's nodes, skin and clips to the scene as entities. Pass null as the scene to upload meshes only. applyGltfAnimation samples a clip every frame, and the engine skins the mesh on the GPU. The lower-level pieces (loadGlb, buildGltfSceneInstance, renderer.uploadMesh) are still exported if you need control over each step.
  4. Persona with memory. createMnemoPayMemoryAdapter turns any client that has remember and recall into the engine's memory adapter. createInProcessBrain runs embedding and search in the page, and onPersist saves each memory to localStorage. loadRecall hands the brain your own import of @mnemopay/sdk/recall so Vite bundles it; without it, a bundled page gets an Install @mnemopay/sdk … error on the first memory call. That's how the robot knows you came back. To keep memory on a server, pass a hosted MnemoPay client to the same adapter.
  5. Loop. Each frame, advance the animation and call renderer.render(scene).

4. Run it

npx vite

Open the printed URL in Chrome. The robot waves and the corner reads Rook: "First time here?". Reload the page and it reads Welcome back. That's visit 2. To reset the memory, delete the rook-memory key in DevTools under Application > Local Storage.

5. Drive a scene from an agent over MCP

AugEngine has an MCP server. An MCP client such as Claude Code, Claude Desktop or Cursor can use it to build and drive scenes through typed tool calls.

Availability

The MCP server isn't on npm yet. Build it from the public source repository, github.com/mnemopay/augengine (Apache-2.0).

Clone, build, and register it in Claude Code:

git clone https://github.com/mnemopay/augengine.git
cd augengine
npm ci
npm run build
claude mcp add augengine -- node /abs/path/to/augengine/packages/augengine-mcp/dist/cli.js serve --stdio
ToolWhat it does
augengine_create_sceneTurns a prompt into a SceneSpec. The same (prompt, seed) always gives the same spec. No model call.
augengine_add_entityAdds an entity to a scene.
augengine_attach_personaAttaches or replaces a persona (traits, memoryId, mood, voice).
augengine_list_entitiesLists entities by component tag or name pattern, with world positions.
augengine_describe_sceneReturns component counts, the verbs you can dispatch, and the available predicates and effects.
augengine_dispatch_actionRuns an action (verb, actor, target, preconditions, effects).
augengine_subscribe_observationOpens a buffered subscription to one channel: Visual, Audible, Social, Inventory, Combat or Dialogue.
augengine_poll_observationDrains queued events from a subscription.
augengine_export_godotWrites a SceneSpec out as a Godot 4.4 project. The output hasn't been opened in a real Godot editor yet.
augengine_render_clipDoesn't work over stdio. It needs a browser, so it returns an error.
detective_new_session, detective_status, detective_actPlay The Wrenfield Observatory under the same rules as a human player.

Here is a session run on 2026-11-27, showing the requests and the important parts of each response:

augengine_create_scene      { "prompt": "a robot greeter in a courtyard at night", "seed": 7 }
  -> sceneId "scene_1": camera, dim blue directional light, floor, sky dome,
     and "npc_robot_0" with a persona and the verbs say / move / look / emote

augengine_attach_persona    { "sceneId": "scene_1", "entityId": "npc_robot_0",
                              "traits": ["warm", "observant"], "memoryId": "rook", "mood": 0.2 }
  -> { "ok": true }

augengine_subscribe_observation { "sceneId": "scene_1", "channel": "Dialogue" }
  -> { "subscriptionId": "sub_1" }

augengine_dispatch_action   { "sceneId": "scene_1", "action": { "verb": "say", "actor": "npc_robot_0",
                              "params": { "text": "Welcome back." }, "preconditions": ["actor_exists"],
                              "effects": ["emit_dialogue"], "source": "agent" } }
  -> { "ok": true, "appliedEffects": ["emit_dialogue"] }

augengine_poll_observation  { "subscriptionId": "sub_1" }
  -> events: [{ "channel": "Dialogue", "source": "npc_robot_0",
               "payload": { "kind": "dialogue.line", "text": "Welcome back.", "verb": "say" } }]

The spec returned by augengine_create_scene has the same SceneSpec shape that the browser Scene constructor takes, so you can pass it to new Scene(spec) in place of the hand-written scene in step 3.

Known gaps (alpha)

Play a game built on it See the showcase npm package Source on GitHub

Character model: "Character" by Quaternius, CC0, as bundled with AugEngine Studio.