Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Scene Store (nexus.scene)

Owns the per-session Scene store and exposes five tools the LLM uses to construct durable, addressable, structured visual output: charts, dashboards, multi-section documents.

Details

IDnexus.scene
Capabilityscene.store
Dependencies(none)
Requires(none)

Configuration

No config keys today — activate the plugin in plugins.active and the default tools register at boot.

Tool surface

ToolArgumentsOutput
scene_createschema (string), content (any)SceneHandle JSON
scene_patchscene_id, patchSceneHandle JSON
scene_getscene_idfull Scene JSON (handle + content + history)
scene_list(none)array of SceneHandle
scene_deletescene_id{"deleted":true}

Map patches merge shallow (keys in the patch overwrite); non-map patches replace content. Schema-specific renderers wanting richer merge semantics can plug a custom Patcher into the in-process scene.MemoryStore.

Persistence

FileWhenContents
<session>/plugins/nexus.scene/scenes.jsonlPer mutationJSONL record of every create / patch / delete. Replay reads this to reconstruct historical state.
<session>/plugins/nexus.scene/scenes.jsonOn ShutdownFull snapshot of every scene at session end. Loaded on next Init for clean restart resume.

Events

Subscribes To

EventPriorityPurpose
tool.invoke50Handle invocations of the scene_* tools.

Emits

EventWhen
tool.registerRegisters each scene_* tool at boot.
tool.result / before:tool.resultPer tool call.
scene.createdPer scene_create. Payload includes content (the initial content).
scene.patchedPer scene_patch. Payload includes content (the full post-merge content).
scene.deletedPer scene_delete.

scene.created and scene.patched carry the scene’s full post-mutation content so bus consumers (e.g. the AG-UI transport’s shared-state mirror) can track scene state without a tool call. The scene store’s own patch semantics are shallow-merge, not RFC 6902, so a consumer needing an RFC 6902 delta diffs the full content itself.

agent_id on scene events flows from Event.Causation.AgentID so sub-agent contributions stay attributable. See scene events for payload shape.

Example

plugins:
  active:
    - nexus.io.tui
    - nexus.llm.anthropic
    - nexus.agent.react
    - nexus.scene
    - nexus.memory.capped

  nexus.agent.react:
    system_prompt: |
      When building visual output (charts, dashboards, multi-section
      documents), use the scene_create / scene_patch tools to build
      durable, addressable artifacts the UI can render incrementally.