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:
- Graph - Main graph execution engine
- GraphBuilder - Builder for creating graph configurations
- SubgraphBuilder - Builder for creating reusable subgraphs
- SequentialGraphBuilder - Builder for creating sequential graphs
- GraphOutputStream - Handler for graph execution output
- GraphExecutionManager - Registry for managing graph executions
Nodes
Import nodes from@inworld/runtime/graph or @inworld/runtime/graph/nodes:
Built-in Nodes
Nodes with an asterisk (*) are experimental and subject to change.
| Node | Description | Input Type(s) | Output Type(s) |
|---|---|---|---|
| KeywordMatcherNode | Matches keywords in text input | String | GraphTypes.MatchedKeywords |
| KnowledgeNode* | Retrieves relevant knowledge based on input text | String | GraphTypes.KnowledgeRecords |
| LLMChatRequestBuilderNode | Generates formatted chat requests using prompt templates populated with JSON input | Object | GraphTypes.LLMChatRequest |
| LLMPromptBuilderNode | Generates formatted prompts using prompt templates populated with JSON input | Object | String |
| MCPCallToolNode | Calls multiple tools on an MCP server in parallel | GraphTypes.ToolCallRequest | GraphTypes.ToolCallResponse |
| MCPListToolsNode | Lists available tools from an MCP server | any | GraphTypes.ListToolsResponse |
| ProxyNode | Simple data passing node for forwarding input to output | any | any |
| RandomCannedTextNode | Selects a random text from a list of predefined phrases | any | String |
| RemoteLLMChatNode | Generates a response using a large language model | GraphTypes.LLMChatRequest | GraphTypes.LLMChatResponse |
| RemoteLLMCompletionNode | Generates text completion using a large language model | String | String |
| RemoteSTTNode | Converts speech audio to text using a speech-to-text (STT) model | GraphTypes.Audio | String |
| RemoteTTSNode | Converts text-to-speech audio using a text-to-speech (TTS) model | String GraphTypes.TextStream GraphTypes.TTSRequest | GraphTypes.TTSOutputStream |
| SafetyCheckerNode | Analyzes text for potentially harmful content and returns safety assessment results | String | GraphTypes.SafetyResult |
| SubgraphNode | Executes a compiled subgraph as a node | any | any |
| TextAggregatorNode | Combines text streams (chunks) into a single string | String GraphTypes.TextStream GraphTypes.LLMChatResponse | String |
| TextChunkingNode | Splits text into smaller chunks | GraphTypes.TextStream GraphTypes.ContentStream | GraphTypes.TextStream |
| TextClassifierNode | Analyzes text and classifies it into predefined categories using ML models | String | GraphTypes.ClassificationResult |
Built-in Subgraphs
Subgraphs with an asterisk (*) are experimental and subject to change.
| Subgraph | Description | Input Type(s) | Output Type(s) |
|---|---|---|---|
| Intent Subgraph* | Detects the intent of the text input using a built-in subgraph | String | GraphTypes.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:
Components
Import components from@inworld/runtime/graph or @inworld/runtime/graph/components:
- RemoteLLMComponent - LLM provider configuration
- RemoteKnowledgeComponent - Knowledge base configuration
- RemoteEmbedderComponent - Text embedding configuration
- RemoteSTTComponent - Speech-to-text configuration
- RemoteTTSComponent - Text-to-speech configuration
- MCPClientComponent - MCP server configuration
Telemetry
Import telemetry functionality from@inworld/runtime: