You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR implements the built-in node library and graph execution pipeline for dynaflow under Milestone P1 (Orchestration Engine). It delivers 9 standard, typed node primitives with ReactFlow canvas metadata compatibility, a global node registry with palette export, and a directed execution pipeline (SimpleGraph).
Architecture & Components
Base Schema & Node Abstractions (dynavec.nodes.base):
NodePort: Typed input and output connection ports (string, number, boolean, array, object, any) with defaults and requirement flags.
NodeSchema: Node metadata describing category, inputs, outputs, config schemas, and ReactFlow-compatible canvas export via to_reactflow_dict().
Node: Abstract base class providing instance identity, config management, execute(inputs), and canvas node serialization via to_dict().
9 Standard Built-in Nodes (dynavec.nodes.builtin):
RetrieverNode: Vector database retrieval against dynavec index, producing structured document lists and concatenated context blocks.
LLMNode: Language model invocation supporting ChatModel instances or callable functions with automatic grounding context integration and system prompts.
ToolNode: Execution of callable functions, tools, and MCP actions with automatic JSON argument deserialization and status tracking.
RouterNode: Dynamic branch routing via custom predicate functions or explicit route overrides.
CodeNode: Execution of custom Python transform functions.
ApprovalNode: Human-in-the-loop review and approval checkpoints.
LoopNode: Iterative map processing over item arrays with configurable max_iterations.
WebhookNode: Event ingestion entrypoint for external HTTP webhook triggers.
SubGraphNode: Modular encapsulation of nested graphs or sub-workflows.
Node Registry (dynavec.nodes.registry):
NodeRegistry: Registry pattern allowing node class registration, schema introspection, and full ReactFlow component palette export via node_registry.export_canvas_palette().
Pipeline Execution Graph (dynavec.nodes.graph):
Edge: Directed connection supporting source/target port binding and dictionary key mapping.
SimpleGraph: Directed pipeline that threads state across nodes in topological order.
Validation & Testing
Added tests/test_nodes.py with 15 comprehensive unit tests:
Node registration and canvas palette export validation.
Serialization testing for ports, schemas, and ReactFlow nodes.
Independent execution tests for all 9 built-in nodes.
Reviewed — a big, well-structured step for dynaflow (covers #282 node schema + #283 built-in nodes). 🎯
Node system — NodePort / NodeSchema (serializable, ReactFlow-compatible shape) + a Node ABC, with the full built-in set: Retriever, LLM, Tool, Router, Code, Approval, Loop, Webhook, and SubGraph — plus a NodeRegistry palette. The LLMNode works with either a ChatModel or a plain callable, and ToolNode handles both dict and JSON-string arguments with error capture.
Graph pipeline — SimpleGraph with typed Edges, add_node/add_edge, run(), and validation errors for malformed graphs — a solid first execution pass that the full engine (#277–#281) can build on.
15 tests cover every node type, port/schema round-trip, the registry palette, validation errors, and an end-to-end retriever→llm→tool pipeline. All 4 CI checks green incl. strict mypy. Merging — excellent work @shivamm-gupta!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #283
This PR implements the built-in node library and graph execution pipeline for
dynaflowunder Milestone P1 (Orchestration Engine). It delivers 9 standard, typed node primitives with ReactFlow canvas metadata compatibility, a global node registry with palette export, and a directed execution pipeline (SimpleGraph).Architecture & Components
Base Schema & Node Abstractions (
dynavec.nodes.base):NodePort: Typed input and output connection ports (string,number,boolean,array,object,any) with defaults and requirement flags.NodeSchema: Node metadata describing category, inputs, outputs, config schemas, and ReactFlow-compatible canvas export viato_reactflow_dict().Node: Abstract base class providing instance identity, config management,execute(inputs), and canvas node serialization viato_dict().9 Standard Built-in Nodes (
dynavec.nodes.builtin):RetrieverNode: Vector database retrieval against dynavec index, producing structured document lists and concatenated context blocks.LLMNode: Language model invocation supportingChatModelinstances or callable functions with automatic grounding context integration and system prompts.ToolNode: Execution of callable functions, tools, and MCP actions with automatic JSON argument deserialization and status tracking.RouterNode: Dynamic branch routing via custom predicate functions or explicit route overrides.CodeNode: Execution of custom Python transform functions.ApprovalNode: Human-in-the-loop review and approval checkpoints.LoopNode: Iterative map processing over item arrays with configurablemax_iterations.WebhookNode: Event ingestion entrypoint for external HTTP webhook triggers.SubGraphNode: Modular encapsulation of nested graphs or sub-workflows.Node Registry (
dynavec.nodes.registry):NodeRegistry: Registry pattern allowing node class registration, schema introspection, and full ReactFlow component palette export vianode_registry.export_canvas_palette().Pipeline Execution Graph (
dynavec.nodes.graph):Edge: Directed connection supporting source/target port binding and dictionary key mapping.SimpleGraph: Directed pipeline that threads state across nodes in topological order.Validation & Testing
tests/test_nodes.pywith 15 comprehensive unit tests:RetrieverNode->LLMNode->ToolNode.ruff checkandruff format.