Skip to main content
Inworld’s Node.js Runtime SDK is a comprehensive toolkit for building AI-powered applications.

Graphs

At the core of the SDK is the Graph system, an interface to construct complete AI pipelines, from input to final output.

Core Classes

Import core graph classes from @inworld/runtime/graph:
import { 
  Graph, 
  GraphBuilder, 
  SubgraphBuilder, 
  SequentialGraphBuilder, 
  GraphOutputStream, 
  GraphExecutionManager 
} from '@inworld/runtime/graph';

Nodes

Import nodes from @inworld/runtime/graph or @inworld/runtime/graph/nodes:
import { 
  RemoteLLMChatNode,
  RemoteTTSNode,
  RemoteSTTNode,
  SubgraphNode
  // ... and other nodes ...
} from '@inworld/runtime/graph';

Built-in Nodes

Nodes with an asterisk (*) are experimental and subject to change.
NodeDescriptionInput Type(s)Output Type(s)
KeywordMatcherNodeMatches keywords in text inputStringGraphTypes.​​MatchedKeywords
KnowledgeNode*Retrieves relevant knowledge based on input textStringGraphTypes.​KnowledgeRecords
LLMChatRequestBuilderNodeGenerates formatted chat requests using prompt templates populated with JSON inputObjectGraphTypes.​LLMChatRequest
LLMPromptBuilderNodeGenerates formatted prompts using prompt templates populated with JSON inputObjectString
MCPCallToolNodeCalls multiple tools on an MCP server in parallelGraphTypes.​ToolCallRequestGraphTypes.​ToolCallResponse
MCPListToolsNodeLists available tools from an MCP serveranyGraphTypes.​ListToolsResponse
ProxyNodeSimple data passing node for forwarding input to outputanyany
RandomCannedTextNodeSelects a random text from a list of predefined phrasesanyString
RemoteLLMChatNodeGenerates a response using a large language modelGraphTypes.​LLMChatRequestGraphTypes.​LLMChatResponse
RemoteLLMCompletionNodeGenerates text completion using a large language modelStringString
RemoteSTTNodeConverts speech audio to text using a speech-to-text (STT) modelGraphTypes.​AudioString
RemoteTTSNodeConverts text-to-speech audio using a text-to-speech (TTS) modelString
GraphTypes.​TextStream
GraphTypes.​TTSRequest
GraphTypes.​TTSOutputStream
SafetyCheckerNodeAnalyzes text for potentially harmful content and returns safety assessment resultsStringGraphTypes.​SafetyResult
SubgraphNodeExecutes a compiled subgraph as a nodeanyany
TextAggregatorNodeCombines text streams (chunks) into a single stringString
GraphTypes.​TextStream
GraphTypes.​LLMChatResponse
String
TextChunkingNodeSplits text into smaller chunksGraphTypes.​TextStream
GraphTypes.​ContentStream
GraphTypes.​TextStream
TextClassifierNodeAnalyzes text and classifies it into predefined categories using ML modelsStringGraphTypes.​ClassificationResult

Built-in Subgraphs

Subgraphs with an asterisk (*) are experimental and subject to change.
SubgraphDescriptionInput Type(s)Output Type(s)
Intent Subgraph*Detects the intent of the text input using a built-in subgraphStringGraphTypes.MatchedIntents

Custom Nodes

You can create your own nodes by extending the CustomNode base class.

Graph Types

Import graph data types from @inworld/runtime/graph:
import { GraphTypes } from '@inworld/runtime/graph';
GraphTypes are graph data types used for input and output between nodes in the graph:

Components

Import components from @inworld/runtime/graph or @inworld/runtime/graph/components:
import { 
  RemoteLLMComponent,
  RemoteKnowledgeComponent,
  RemoteEmbedderComponent,
  RemoteSTTComponent,
  RemoteTTSComponent,
  MCPClientComponent
} from '@inworld/runtime/graph';
Components are reusable configurations that can be shared across multiple nodes:

Telemetry

Import telemetry functionality from @inworld/runtime:
import { telemetry } from '@inworld/runtime';
Capture metrics, trace, and logs to help with understanding and optimizing your AI pipeline: