Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jhe.zheng/node-red-make-iot-smart) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Node-RED Make IoT Smart
๐ Languages
An AI intelligent assistant extension designed specifically for Node-RED, making IoT development smarter and more efficient.
Overview
Node-RED Make IoT Smart is a comprehensive AI agent designed specifically for Node-RED development. It provides intelligent code assistance, automated flow optimization, and smart debugging capabilities to enhance your IoT development experience. The extension now supports six major scenarios: Learning, Solution, Integration, Development, Configuration, and Management.
Features
๐ค AI Assistant
- Intelligent Code Suggestions: Provides context-aware code recommendations for Node-RED flows.
- Smart Flow Analysis: Analyzes flows and provides optimization suggestions.
- Natural Language Interface: Interact with the Node-RED environment using natural language commands.
- Multi-language Support: Supports Chinese, English, Japanese, Korean, and other languages. Follows Node-RED language configuration changes.
- Multi-provider Support: Based on LangChain.js framework, supports OpenAI, Anthropic, Google, DeepSeek, and other AI models.
- Intelligent Memory Management: SQLite-based short-term and long-term memory system, supporting conversation history, user preferences, and flow template storage.
- Scenario-based Prompts: JSON-configured scenario-based prompt management with dynamic parameter injection support.
- MCP Tools Integration: Supports Model Context Protocol (MCP) tool calls to extend AI assistant capabilities.
๐ง Development Tools
- Real-time Code Analysis: Continuously analyzes Node-RED flows.
- Configuration Management: Centralized API configuration for different AI providers.
- Interactive Sidebar: Dedicated AI assistant panel integrated into the Node-RED editor.
- JSON Editor: Built-in configuration file editor with syntax highlighting.
- MCP Tool Integration: Supports Model Context Protocol (MCP) tool calls to extend AI assistant capabilities.
- LangChain Tool Management: Unified tool management framework supporting built-in tools and MCP tools.
- Scenario-based Support: Provides customized support for seven major scenarios:
- Learning: Explains nodes and concepts, provides example flows.
- Solution: Provides multiple IoT solutions with flow JSON and node installation guidance.
- Integration: Assists with protocol integration (e.g., MQTT, Modbus) or software.
- Development: Optimizes existing flows and function node code.
- Configuration: Guides modification of Node-RED settings (e.g.,
settings.js). - Management: Supports remote access, Git integration, and batch deployment.
๐ Upcoming Features
- Remote Debugging: AI-assisted remote debugging of Node-RED flows.
- Team Management: Collaborative development with team management features.
- Advanced Analytics: Deep insights into IoT system performance.
- Smart Deployment: AI-guided deployment strategies for IoT applications.
Installation
Install from npm
npm install @jhe.zheng/node-red-make-iot-smartInstall from Node-RED Palette Manager
- Open the Node-RED editor.
- Go to Menu โ Manage Palette.
- Search for
@jhe.zheng/node-red-make-iot-smart. - Click Install.
- After installation is complete, restart Node-RED.
- After installation, you will see a new AI Assistant tab in the Node-RED sidebar.
- Click the Configure button to set up your AI provider.
- Choose from supported providers:
- DeepSeek: Cost-effective choice with strong coding capabilities.
- OpenAI: Industry-leading GPT models.
- Anthropic: Advanced reasoning capabilities with Claude models.
- Enter your API key and select the appropriate model.
- After configuration is complete, you can start using the AI assistant. Note that after saving the configuration, Node-RED will automatically generate a configuration node, and Node-RED will prompt for flow changes - just click merge.
- Start interacting with your AI assistant!
Quick Start
Type "Analyze current node"
Type "Create a sample flow"
Type "Health check"
Configuration
LangSmith Debug Configuration (Optional)
For better debugging and monitoring of LangChain execution processes, you can configure LangSmith support:
Copy the
.env.examplefile to.env:cp .env.example .envEdit the
.envfile and fill in your LangSmith configuration:LANGCHAIN_TRACING_V2=true LANGCHAIN_API_KEY=your_langsmith_api_key_here LANGCHAIN_PROJECT=your_project_nameRestart Node-RED to apply the configuration.
Visit LangSmith to view detailed execution traces and debugging information.
Note: LangSmith configuration is optional and will not affect basic functionality if not configured.
Usage
Basic Chat Interface
- Open the AI Assistant sidebar tab.
- Enter your questions or instructions in natural language.
- Get intelligent responses including code suggestions and explanations.
Scenario Selection
- Select scenarios (Learning, Solution, Integration, Development, Configuration, Management) through the dropdown menu in the sidebar.
- AI customizes responses based on the selected scenario, providing relevant tools and flow JSON.
JSON/Code Handling
- Large JSON or code outputs are hidden behind View JSON/Code buttons to keep the UI clean.
- Edit flow JSON in the built-in editor with syntax highlighting and apply changes directly.
Supported Scenarios
Scenario Overview
| Scenario | Chinese Name | Description | Supported Tools |
|---|---|---|---|
| learning | ๅญฆไน ๆจกๅผ | Node-RED learning assistant providing teaching guidance and knowledge answers | get-flows, get-nodes, create-flow, update-flow |
| solution | ่งฃๅณๆนๆกๆจกๅผ | IoT solution expert providing technical solutions and architecture recommendations | create-flow, update-flow, get-flows, create-subflow |
| integration | ้ๆๆจกๅผ | System integration expert handling device connections and data integration | create-flow, update-flow, install-node, get-node-info |
| development | ๅผๅๆจกๅผ | Code development assistant helping write and optimize Node-RED flows | create-flow, update-flow, create-subflow, get-node-info, install-node, get-flow |
| configuration | ้ ็ฝฎๆจกๅผ | System configuration expert handling Node-RED environment and node configuration | get_settings, update_settings, install_node, get_node_info, get_diagnostics |
| management | ็ฎก็ๆจกๅผ | Project management assistant helping with flow organization and project planning | get-flows, create-flow, update-flow, create-subflow |
| general | ้็จๆจกๅผ | General AI assistant handling various Node-RED related issues | No specific tool restrictions |
Preset Prompt Examples
| Scenario | Preset Prompts |
|---|---|
| Learning Mode | โข I'm new to Node-RED, please introduce the basic concepts and core functions of Node-RED โข Please explain what Flow, Node, and Wire are in Node-RED โข How to create my first simple flow in Node-RED? Please provide detailed steps โข What are the commonly used core nodes in Node-RED? What are their respective functions? |
| Solution Mode | โข I need to design a smart home control system, please provide a complete IoT solution architecture โข How to use Node-RED to build an Industry 4.0 data collection and monitoring system? โข Please design an agricultural IoT solution, including sensor data collection and automation control โข I want to establish a smart city environmental monitoring network, what technical solutions are needed? |
| Integration Mode | โข How to integrate MQTT devices and HTTP APIs in Node-RED? Please provide detailed integration solutions โข I need to send sensor data from Modbus devices to cloud databases, how to implement this? โข Please help me design a data transformation flow that converts JSON format to XML and sends to third-party systems โข How to implement unified data collection and processing for multiple different protocol devices in Node-RED? |
| Development Mode | โข Detailed explanation and description of the current flow โข Detailed explanation and description of the current node โข Please help me write a Function node code that implements data filtering and format conversion โข How to create a custom node in Node-RED? Please provide complete development steps |
| Configuration Mode | โข How is the current Node-RED configuration? โข How is the current Node-RED diagnostics? โข How to configure Node-RED security settings, including user authentication and HTTPS? โข Please help me optimize Node-RED performance configuration to improve system efficiency โข How to install and manage third-party node packages in Node-RED? โข I need to configure Node-RED logging and monitoring, how should I set it up? |
| Management Mode | โข Please help me develop an IoT project development plan and milestone arrangement โข How to organize and manage large project flow structures in Node-RED? โข I need to assess the risks and quality of the current project, please provide analysis suggestions โข How to establish Node-RED development standards and best practices for team collaboration? |
| General Mode | โข What is Node-RED? What are its main features and application scenarios? โข I encountered a Node-RED problem, please help me analyze and solve it โข Please recommend some Node-RED learning resources and best practices โข How to choose the appropriate Node-RED scenario mode to solve my specific needs? |
Smart Keyword Triggers
| Scenario | Keywords | Trigger Behavior |
|---|---|---|
| Development Mode | create flow, generate flow, new flow, build flow | Automatically switches to development mode, generates complete Node-RED flow JSON code with detailed explanations |
| Configuration Mode | current config, system config, configuration info, settings, current settings | Automatically calls get_settings tool to retrieve configuration information and displays in table format |
| Configuration Mode | current diagnostics, system diagnostics, diagnostic info, health check | Automatically calls get_diagnostics tool for system diagnostics |
Dynamic Input Parameters
All scenarios support the following dynamic parameter injection:
nodeRedVersion- Node-RED version informationnodeVersion- Node.js version informationcurrentTime- Current timestampselectedFlow- Currently selected flowselectedNodes- Currently selected nodeslang- Current language settingmcpTools- Available MCP tools list
Each scenario also supports specific dynamic parameters:
- Learning Mode:
userLevel(user skill level) - Solution Mode:
projectRequirements(project requirements) - Integration Mode:
integrationTargets(integration targets) - Development Mode:
developmentTask(development task) - Configuration Mode:
configurationNeeds(configuration needs) - Management Mode:
projectStatus(project status)
System Prompt Features
Each scenario is configured with specialized system prompts to ensure the AI assistant can:
- Role Positioning: Clearly define its professional role in specific scenarios
- Output Format: Provide structured response formats according to scenario needs
- Tool Integration: Intelligently call appropriate MCP tools and Node-RED APIs
- Context Awareness: Utilize dynamic parameters to provide personalized recommendations
| Scenario | Description |
|---|---|
| Learning | Explains nodes/concepts and provides example flows for learning. |
| Solution | Provides multiple IoT solutions with flow JSON and node installation guidance. |
| Integration | Assists with protocol/software integration and generates related flows. |
| Development | Optimizes existing flows and function node code. |
| Configuration | Guides modification of Node-RED settings (e.g., settings.js). |
| Management | Supports remote access, Git integration, and batch deployment. |
Supported AI Providers
| Provider | Models | Features |
|---|---|---|
| OpenAI | GPT-3.5, GPT-4, GPT-4o | General purpose, wide compatibility |
| Anthropic | Claude-3, Claude-3.5 | Advanced reasoning, safety-focused |
| Gemini Pro, Gemini Flash | Multimodal, high performance | |
| DeepSeek | deepseek-chat, deepseek-coder | Cost-effective, coding-focused |
| Others | All LLM providers supported by LangChain.js | Highly extensible, flexible configuration |
API Configuration
- API keys are stored locally and encrypted.
- Support for multiple provider configurations.
- Easy switching between different providers and models.
- Separate model settings for planning and execution phases.
Development
Project Structure
โโโ ai-sidebar.html # Main sidebar interface
โโโ ai-sidebar-config.json # UI configuration
โโโ make-iot-smart.html # Node configuration template
โโโ make-iot-smart.js # Backend node implementation
โโโ lib/
โ โโโ langchain-manager.js # LangChain core manager
โ โโโ memory-manager.js # SQLite memory management
โ โโโ scenario-manager.js # Scenario-based prompt management
โโโ config/
โ โโโ scenarios.json # Scenario configuration file
โโโ data/
โ โโโ memory.db # SQLite database file
โโโ package.json # Package configurationTechnical Architecture
This project is built on the LangChain.js framework with a modular architecture design:
- LangChain Manager: Core AI model management, supporting multiple LLM providers
- Memory Manager: SQLite-based intelligent memory system, supporting short-term and long-term memory
- Scenario Manager: Scenario-based prompt management, supporting JSON configuration and dynamic parameters
- Tool Manager: Unified tool management framework, integrating MCP tools and built-in tools
- API Layer: RESTful API interface, supporting streaming chat and tool execution
Contributing
- Fork the repository.
- Create a feature branch.
- Make changes and commit.
- Submit a pull request.
Roadmap
Phase 1 (Completed)
- โ AI assistant integration
- โ Multi-provider support
- โ Interactive sidebar
- โ Configuration management
- โ Scenario-based support
- โ LangChain.js architecture migration
- โ SQLite memory management system
- โ MCP tool integration
- โ Unified tool management framework
Phase 2 (Coming Soon)
- ๐ Remote debugging functionality
- ๐ Team collaboration features
- ๐ Advanced flow analysis
- ๐ Smart deployment tools
Phase 3 (Future)
- ๐ Team management system
- ๐ Enterprise features
- ๐ Advanced security options
- ๐ Custom model training
System Requirements
- Node.js >= 18.0.0
- Node-RED >= 2.0.0
License
Licensed under the MIT License. See LICENSE file for details.
Support
AI development is more like art than technology. Mastering LLMs is not a simple task and requires deep understanding of AI models, data, and application scenarios. Each Q&A session may yield different results. Initial versions are often imperfect, but with the improvement of prompt engineering, they will gradually truly meet the daily needs of Node-RED users, whether IT or OT engineers. We welcome more interested people to join the project.
- Issue Reports: GitHub Issues
- Documentation: Wiki
- Discussions: GitHub Discussions
Author
Zheng He - Email: jhe.zheng@gmail.com - GitHub: @jimmyfreecoding - Website: https://www.makeiotsmart.com
Let AI-driven assistance make your IoT development smarter!