How nvlabs/spatialclaw works
SpatialClaw is a training-free spatial-reasoning agent: it evaluates benchmark samples by repeatedly asking a VLM for executable Python, running each cell in a persistent Jupyter kernel, returning observations for further reasoning, and committing an answer. Its runtime also includes perception tools backed by a separate GPU service and a vLLM service; benchmark evaluation and service monitoring are supporting product branches. The workflow and loop are documented in the README and workflow excerpt; some service-to-service wiring and unsampled benchmark internals are not shown, so those links are omitted.
Main entry points: workflow.py Workflow graph · gpu_rpc.py GPU RPC · run.py Run entrypoint · router.py Loop routing
Components 25
Agent workflow
- Run entrypoint
spatial_agent/entrypoints/run.py - Agent config
spatial_agent/config.py - Workflow graph
spatial_agent/workflow.py - Initialize session
spatial_agent/nodes/init_node.py - Plan strategy
spatial_agent/nodes/plan_node.py - Generate code
spatial_agent/nodes/llm_step_node.py - Check and execute
spatial_agent/nodes/execute_node.py - Persistent kernel
spatial_agent/kernel/manager.py - Collect feedback
spatial_agent/nodes/feedback_node.py - Reflect
spatial_agent/nodes/reflection_node.py - Loop routing
spatial_agent/nodes/router.py - Final answer
spatial_agent/kernel_types/return_answer.py
Perception tools
- Tool facade
spatial_agent/tools/__init__.py - 3D reconstruction
spatial_agent/tools/reconstruct_tool.py - SAM3 segmentation
spatial_agent/tools/sam3_tool.py
Benchmark evaluation
- Benchmark loaders
spatial_agent/evals - Evaluation scoring
spatial_agent/evals/scoring.py
Model services
- VLM client
spatial_agent/llm/client.py - GPU RPC
spatial_agent/gpu_rpc.py - GPU model runtime
spatial_agent/gpu_models/sam3_model.py - vLLM service
spatial_agent/launch_managers/vllm_manager/server_chain.py - GPU tool service
spatial_agent/launch_managers/gpu_server_manager/server_chain.py
Monitoring
- GPU dashboard
spatial_agent/gpu_dashboard/app.py - GPU sample store
spatial_agent/gpu_dashboard/storage.py
Other components
- Experiment runner
Connections 26
- Experiment runner → Run entrypoint: starts run
- Run entrypoint → Agent config: loads settings
- Run entrypoint → Workflow graph: runs agent
- Workflow graph → Initialize session: starts graph
spatial_agent/workflow.py - Workflow graph → Plan strategy: routes to
spatial_agent/workflow.py - Workflow graph → Generate code: routes to
spatial_agent/workflow.py - Workflow graph → Check and execute: routes to
spatial_agent/workflow.py - Workflow graph → Collect feedback: routes to
spatial_agent/workflow.py - Workflow graph → Reflect: routes to
spatial_agent/workflow.py - Workflow graph → Loop routing: checks loop
spatial_agent/workflow.py - Initialize session → Tool facade: sets up
spatial_agent/nodes/init_node.py - Generate code → VLM client: requests code
spatial_agent/nodes/llm_step_node.py - Check and execute → Persistent kernel: executes cell
- Persistent kernel → Collect feedback: returns output
- Loop routing → Generate code: repeats step
spatial_agent/nodes/router.py - Loop routing → Final answer: terminates
- Tool facade → 3D reconstruction: creates tool
spatial_agent/tools/__init__.py - Tool facade → SAM3 segmentation: creates tool
spatial_agent/tools/__init__.py - 3D reconstruction → GPU RPC: calls remotely
- SAM3 segmentation → GPU RPC: calls remotely
- GPU RPC → GPU model runtime: dispatches model
- Benchmark loaders → Evaluation scoring: scores results
spatial_agent/evals/erqa.py - GPU dashboard → GPU sample store: reads and writes
spatial_agent/gpu_dashboard/app.py - Experiment runner → Benchmark loaders: selects dataset
- vLLM service → VLM client: serves requests
- GPU tool service → GPU RPC: hosts tools