Node Catalog

The Mesa module provides 31 base nodes for building agent-based models, plus an optional Mesa Geo extension with 15 additional nodes for GIS-based spatial models.

Base Nodes (31)

Behavior

Actions agents perform during their step.

  • Move — Move the agent to a random neighboring cell
  • Evaluate — Evaluate neighbors and move toward the best cell

Agent Lifecycle

Create and remove agents during the simulation.

  • Spawn Agent — Create a new agent of a given archetype at runtime
  • Remove Self — Remove the current agent from the simulation

Meta-Agent / AgentSet

Operate on groups of agents using Mesa's AgentSet API.

  • Do All — Execute an action on every agent in a set
  • Set All — Set a property on every agent in a set
  • Group By — Partition agents by a property value
  • Get All — Get the full set of agents of a given archetype
  • Select Agents — Filter agents by a condition
  • Shuffle Agents — Randomize the order of an agent set
  • Sort Agents — Sort agents by a property

Properties / Queries

Read model and agent state.

  • Get Step — Current simulation step number
  • Get Agent Count — Number of agents of a given type
  • Get Cell — Get the cell contents at a position
  • Get Empty Cells — List all unoccupied grid cells
  • Get Neighbors — Agents in neighboring cells
  • Get Position — The current agent's grid position
  • Get Data — Read collected data from a data collector
  • Get Property — Read a property from the current agent
  • Get Model Property — Read a scenario parameter from the model

Data Collection

Track metrics over the simulation run.

  • Collect Data — Trigger data collection for the current step
  • Agent Reporter — Record a per-agent metric
  • Model Reporter — Record a model-level aggregate metric

Random

Generate random values for stochastic models.

  • Random Bool — Random true/false with configurable probability
  • Random Choice — Pick a random element from a list
  • Random Float — Random float in a range
  • Random Int — Random integer in a range

Simulation

Model-level orchestration and federation nodes.

  • Model Ref — Reference an imported model in a simulation project
  • Step Controller — Run a stepping loop for N iterations
  • Data Logger — Log values during a simulation run
  • Coupling — Wire outputs of one model to inputs of another

Mesa Geo Extension (15 nodes)

Mesa Geo is an optional extension that adds GIS capabilities for building spatially-explicit models with real-world geographic data. It requires the mesa-geo pip package and is toggled per project in the project settings.

Geo

  • GeoSpace — Create a geographic continuous space
  • Create GeoAgent — Spawn an agent with a geometry (point, polygon, etc.)
  • Load From File — Load geographic data from a shapefile or GeoPackage
  • From GeoJSON — Load geographic data from GeoJSON
  • Add Agents — Add geo-agents to the GeoSpace
  • Add Layer — Add a vector or raster layer to the space
  • Reproject CRS — Reproject geographic data to a different coordinate reference system

Geo Query

  • Neighbors Within Distance — Find agents within a geographic radius
  • Intersecting Agents — Find agents whose geometries intersect
  • Agents At — Find agents at a geographic location
  • Geo Distance — Calculate geographic distance between agents
  • Spatial Relation — Test spatial relationships (contains, within, touches, etc.)

Raster

  • Load Raster — Load raster data (elevation, temperature, land cover, etc.)
  • Get Raster Data — Sample raster values at a location
  • Apply Raster — Apply a raster operation across the grid

Domain Types

Mesa Geo introduces additional domain types: GeoAgent, GeoSpace,RasterLayer, and Geometry. These appear as port types on Geo nodes and wire with their own colors.

Extension System

Modules in Loom can define optional extensions that add specialized node sets without bloating the default palette. Extensions are toggled per project in the project settings panel. Mesa Geo is the first extension — when enabled, its 15 nodes appear alongside the base Mesa nodes in the sidebar.

Libraries

Libraries are a different kind of module — instead of owning a project type, they provide composable nodes that can be mixed into any framework's graph. This lets you combine framework-specific logic (e.g., Mesa agent behaviors or Weave AI tool definitions) with library nodes (e.g., NetworkX graph analysis, ChromaDB vector search, or SQLAlchemy database queries) on the same canvas.

Enabling Libraries

Open the Libraries Panel in the editor sidebar. Each available library is listed with a toggle. Enable the ones you need for your project — you can enable multiple libraries at once.

Using Library Nodes

Once a library is enabled, its nodes appear in the context menu under an amber-colored section. They wire and execute like any other node — data flows between framework nodes and library nodes seamlessly.

Code Generation

When you generate code, Loom automatically includes the correct imports and adds library packages to requirements.txt. No manual dependency management needed.

Available Libraries

LibraryPackageUse Case
NetworkXnetworkxGraph analysis and network science
ChromaDBchromadbVector database for RAG pipelines
LiteLLMlitellmProvider-agnostic LLM calls
UnstructuredunstructuredDocument ingestion (PDF, DOCX, HTML, images)
SQLAlchemysqlalchemySQL database access
Tavilytavily-pythonWeb search and content extraction
PydanticpydanticData validation and schema definition
Neo4jneo4jGraph database with Cypher queries
PlaywrightplaywrightBrowser automation
CeleryceleryTask queues, background jobs, scheduling

Semantic Color System

Node header colors encode the node's role at a glance. There are 11 semantic roles, consistent across all modules:

  • Green — Entry points (Entry, Agent Start, Gateway, Tool Definition)
  • Red — Exit points (Remove Self, Agent End, Tool Return)
  • Purple — LLM nodes (LLM Call, LLM Stream, Structured Output, Embed Text)
  • Cyan — Flow control (Branch, Sequence, ForEach, Gate, Try/Catch, Retry, Parallel)
  • Blue — Message nodes (User Message, Append Message, Message History)
  • Slate — Data and expression nodes (Math, Compare, Logic, Literal, JSON, Dict)
  • Amber — I/O nodes (HTTP Request, File R/W, Cache, Data Collection)
  • Yellow — Tool use nodes (Dispatch Tool, Tool Result, On Tool Call)
  • Indigo — Reference nodes (Agent Ref, Model Ref)
  • Teal — Orchestration nodes (Request Router, Response Aggregator, Server Logger)
  • Gray — Domain nodes (module-specific operations like Mesa behaviors, NetworkX algorithms)

This color system is consistent across all modules, so the same visual language applies whether you are building a Mesa model, a NetworkX analysis, or a Weave AI agent. Statement nodes have solid borders while expression nodes have dashed borders.