AgentCanvas / Pages / Developer Guide / Nodesets / Common / Tools / Basic Agent NodeSet
2026-04-10 14:22

General-purpose tools for LLM-based VLN agents, providing 11 canvas nodes across 5 categories: scratch pad (working memory), web grounding, vision, spatial math, and episode context. Use these nodes to build agents that can read/write notes, search the web, analyze images, compute distances and headings, and access episode metadata.


1. Overview

The Basic Agent NodeSet (basic_agent_tools) provides a foundational toolkit for agents that reason about VLN tasks. The 11 nodes are organized into 5 functional categories:

Category Purpose Nodes
Scratch Pad Ephemeral working memory Write, Read, List
Web Grounding External information retrieval Search, Fetch
Vision On-demand image analysis Analyze
Spatial Math 3D position and orientation reasoning Measure Distance, Compute Heading
Episode Context Environment state and history Get Instruction, Get Step Count, Get History

Each node is registered in the canvas component system and can be wired into agent graphs via the canvas UI.


2. Canvas Nodes

2.1 Scratch Pad

The scratch pad nodes provide key-value storage for LLM working memory (planning, reasoning state, intermediate results). Storage is shared across all nodes in the same pad_id.

Node Type Display Name Input Ports Output Ports Description
basic_agent__note_write Scratch Pad: Write key (TEXT), content (TEXT) ok (BOOL) Save a named note to the scratch pad. Returns True if successful.
basic_agent__note_read Scratch Pad: Read key (TEXT) content (TEXT) Read a named note from the scratch pad. Returns empty string if key not found.
basic_agent__note_list Scratch Pad: List trigger (TEXT, optional) keys (TEXT) List all note keys in the scratch pad as a JSON array.

UI Color: Amber

Example workflow:

[LLM Node] β†’ key="plan" β†’ [Scratch Pad: Write]
                        β†’ content="explore north hallway"
[Scratch Pad: List] β†’ keys=["plan"]
[Scratch Pad: Read] β†’ key="plan" β†’ content="explore north hallway"

2.2 Web Grounding

The web grounding nodes enable agents to search and fetch information from the public web.

Node Type Display Name Input Ports Output Ports Description
basic_agent__web_search Web: Search query (TEXT) results (TEXT) Search the web via DuckDuckGo HTML-lite (no API key required). Returns numbered results with titles and snippets.
basic_agent__web_fetch Web: Fetch url (TEXT) content (TEXT) Fetch a URL and extract readable text content. Strips HTML tags and collapses whitespace.

UI Color: Sky

Implementation details: - Web: Search uses DuckDuckGo's HTML-lite interface with a standard User-Agent header. Handles network failures gracefully. - Web: Fetch follows redirects (max 3), strips <script> and <style> blocks, and truncates output if it exceeds max_chars config.

Example workflow:

[LLM: "search for tall buildings"] β†’ [Web: Search] β†’ results="1. Empire State..."
                                   β†’ [Web: Fetch] β†’ content="...architectural details..."

2.3 Vision

The vision node provides on-demand image analysis via the active VLM (Vision Language Model) configured in the LLM profile.

Node Type Display Name Input Ports Output Ports Description
basic_agent__image_analyze Vision: Analyze image (IMAGE), prompt (TEXT, optional) response (TEXT) Analyze an image with the active VLM. Accepts numpy arrays or base64-encoded strings. Uses config prompt as fallback.

UI Color: Violet

Input formats: - image as numpy array (e.g., from camera, screenshot) - image as base64 string (pre-encoded external images) - prompt as optional override (defaults to "Describe this image concisely for a navigation agent.")

Configuration: - temperature (slider, 0.0–1.0, default 0.3): VLM sampling temperature

Example workflow:

[Episode: Panoramic] β†’ image=<numpy array> β†’ [Vision: Analyze] β†’ response="A hallway with..."
                    β†’ prompt="What objects do you see?"

2.4 Spatial Math

Spatial math nodes compute distances and headings for navigation reasoning.

Node Type Display Name Input Ports Output Ports Description
basic_agent__measure_distance Spatial: Measure Distance from_state (STATE), to_state (STATE) distance (TEXT) Calculate Euclidean distance between two 3D positions in meters.
basic_agent__compute_heading Spatial: Compute Heading current (STATE), target (STATE) heading (TEXT) Compute absolute and relative heading to a target. Returns JSON: {absolute_deg, relative_deg, interpretation}.

UI Color: Emerald

Coordinate system: - Habitat uses Y-up convention: horizontal plane is XZ, forward is βˆ’Z - Position: [x, y, z] - Orientation: quaternion [qx, qy, qz, qw] (converted to yaw for heading)

Heading interpretation: Relative headings are interpreted as human-readable directions: - < 15Β°: "ahead" - 15°–60Β°: "slightly left/right" - 60°–120Β°: "left/right" - 120°–165Β°: "behind-left/right" - > 165Β°: "behind"

Example workflow:

[Episode: State] β†’ position=[1.0, 0.5, 2.0] β†’ [Spatial: Measure Distance]
               β†’ orientation=[0, 0.707, 0, 0.707]      distance="5.12"

[Spatial: Compute Heading] β†’ absolute_deg=45.2, relative_deg=-30.5, interpretation="slightly right"

2.5 Episode Context

Episode context nodes provide access to the Habitat environment's state and history.

Node Type Display Name Input Ports Output Ports Description
basic_agent__get_instruction Episode: Get Instruction (none β€” entry node) instruction (TEXT) Retrieve the navigation instruction for the current episode.
basic_agent__get_step_count Episode: Get Step Count trigger (TEXT, optional) count (TEXT) Get the current iteration step number as a string.
basic_agent__get_history Episode: Get History action (ACTION, optional), response (TEXT, optional) history (TEXT) Accumulate action history across steps and retrieve as formatted text.

UI Color: Rose

Details: - Get Instruction: Queries the HabitatEnvManager (if loaded) via async executor. Returns "(Habitat not loaded)" if environment unavailable. - Get Step Count: Returns ctx.step β€” the iteration counter in the execution context. - Get History: Maintains a persistent list across steps. Each entry records step number, action name (STOP/FORWARD/LEFT/RIGHT), and a truncated LLM response (120 chars).

Configuration (Get History): - max_history (slider, 5–200, default 50): Maximum history entries to return

Example workflow:

[Trigger] β†’ [Episode: Get Instruction] β†’ instruction="Go to the kitchen."
[LLM] β†’ action=1 β†’ [Episode: Get History] β†’ history="Step 1: FORWARD β€” Agent moved ahead...\nStep 2: LEFT β€” Turn to explore..."
     β†’ response="Turning left to see the hallway"


3. Shared Scratch Pad

The scratch pad is implemented as a module-level dictionary (_scratch_pads: dict[str, dict[str, str]]) keyed by pad_id from node configuration.

Isolation and Sharing

Lifecycle

Use this for: - Storing intermediate reasoning steps - Accumulating context across multiple LLM calls - Sharing state between parallel agent branches

Do NOT use for: - Persistent data (cleared on shutdown) - Large data structures (memory overhead)


4. Configuration

Each node exposes configuration fields in the canvas UI. These fields are passed to the node's forward() method via self.config.

Scratch Pad Nodes

{
  "pad_id": "default"
}
- pad_id (text): Shared key for isolation. All nodes with the same pad_id share the same dictionary.

Web Grounding Nodes

{
  "max_results": 5,
  "max_chars": 4000
}
- max_results (Web: Search slider, 1–10, default 5): Maximum search results to return - max_chars (Web: Fetch slider, 500–20000, default 4000): Maximum characters to extract from webpage

Vision Node

{
  "temperature": 0.3
}
- temperature (slider, 0.0–1.0, default 0.3): VLM sampling temperature (lower = more deterministic)

Episode Context Nodes

{
  "max_history": 50
}
- max_history (Get History slider, 5–200, default 50): Maximum action history entries to retain


5. Usage

Loading the NodeSet

Send a POST request to the backend:

POST /api/components/nodesets/basic_agent_tools/load

The backend registers all 11 nodes in the component registry and makes them available in the canvas UI under their respective categories.

Wiring Patterns

Pattern 1: Agent Planning Loop

[Seed] β†’ [Episode: Get Instruction]
      β†’ [Scratch Pad: Write] (key="task", content=instruction)
      β†’ [LLM: Reason]
      β†’ [Scratch Pad: Read] (key="task")
      β†’ [Scratch Pad: List] (to monitor planning state)

Pattern 2: Web-Grounded Navigation

[LLM: Query] β†’ [Web: Search] β†’ [LLM: Analyze] β†’ [Decision]
                                            ↓
                          [Web: Fetch] (fetch top result)
                                            ↓
                          [Vision: Analyze] (if image available)

Pattern 3: Spatial Reasoning

[Episode: State] β†’ [Spatial: Measure Distance] β†’ [LLM: Distance-aware decision]
               β†’ [Spatial: Compute Heading]

Pattern 4: History Tracking

[LLM Output] β†’ [Episode: Get Step Count]
           β†’ [Episode: Get History] (accumulate actions)
           β†’ [LLM: Use history for context]

Error Handling

All nodes include graceful fallbacks: - Empty query β†’ "(empty query)" - Network failure β†’ "(search failed: )" - Habitat not loaded β†’ "(Habitat not loaded)" - Invalid image β†’ "(invalid image input)" - No LLM profile β†’ "(no LLM profile active β€” cannot call VLM)"

Agents should check for these error patterns in LLM prompts.

AgentCanvas docs