Introducing node-red-contrib-ai-flow-builder - an AI chat sidebar for Node-RED (feedback and ideas welcome)

Hi everyone, I’ve recently developed and open-sourced a project called node-red-contrib-ai-flow-builder:

GitHub - Siphion/node-red-contrib-ai-flow-builder: AI chat sidebar for Node-RED (OpenAI / Anthropic) that reads and edits your flows · GitHub

It’s an AI chat sidebar for Node-RED that works directly inside the editor and lets you interact with your flows using OpenAI or Anthropic.

The main goal is to make AI actually useful inside Node-RED itself: not just as an external chatbot, but as something that can see your flows, understand what nodes are installed, work with attachments, and propose changes that can be applied directly to the canvas.

What it provides

  • AI chat inside the Node-RED editor
    A right-sidebar chat with streaming responses.
  • OpenAI and Anthropic support
    You can configure multiple providers/models and switch between them at any time, even during the same conversation.
  • Flow-aware context
    The active tab is automatically included, and you can also add extra tabs per message.
  • Installed palette awareness
    The assistant also receives the catalog of registered node types grouped by module, so it knows what is actually available in that Node-RED instance.
  • Attachments support
    It supports images, PDFs, and text/JSON/YAML/CSV/log-style files as additional context.
  • Apply changes directly in the editor
    The AI can return structured code blocks for actions like:
    • importing nodes into an existing tab
    • creating a brand-new tab
    • patching a specific node
    • creating/updating subflows
    • connecting or disconnecting wires
    • deleting nodes or tabsEach block can be copied, previewed, and applied directly to the editor canvas. Changes go through the normal undo history, so they can be reverted with Ctrl+Z.
  • Conversation persistence
    Chats and attachments are stored locally under the Node-RED user directory and can be reopened or deleted later.
  • Built-in sanitization
    Before anything is sent to the model, the flow snapshot is sanitized to remove config provider nodes and redact sensitive values such as passwords, tokens, secrets, API keys, auth fields, and similar data.

How it works

The workflow is designed to stay close to normal Node-RED editing:

  1. Open the AI Chat sidebar
  2. Select a configured provider/model
  3. Let the assistant inspect the active tab, and optionally include additional tabs
  4. Ask for explanations, refactors, wiring help, new flow fragments, or changes to existing nodes
  5. If the answer includes apply-able blocks, preview them and apply them directly to the canvas

So instead of copying flow JSON into an external AI tool and rebuilding everything manually, the idea is to have a flow-aware assistant living inside the Node-RED editor.

A few practical examples

Some things it can be used for:

  • explaining what an existing flow does
  • generating a new flow from a prompt
  • patching specific nodes
  • creating a new tab or subflow
  • suggesting changes based on the nodes already installed
  • analyzing screenshots, PDFs, logs, or structured files as extra context

Security / design choices

A couple of design choices were important to me:

  • API keys are stored in a Node-RED config node, so they remain server-side and encrypted in flows_cred.json
  • the browser never needs direct access to the raw keys
  • flow data is sanitized before being sent
  • if the model echoes a redacted value back in an apply block, that placeholder is dropped so existing secrets are preserved instead of overwritten

The intention is to make the tool practical, but also safe enough for real Node-RED projects, where flows may still reference sensitive systems or, in some cases, contain credentials but ideally those secrets should be supplied via environment variables or other proper credential mechanisms rather than embedded in the flows themselves. References such as ${env.MY_KEY} may still be present in the context, but only as symbolic references: the actual environment-variable values are not included and are never sent to the model.

Why I built it

I built this because I wanted something better than “ask an external chatbot, paste some JSON back, and fix everything manually”.

What I was looking for was something that could:

  • stay inside the Node-RED editor
  • understand the actual flow context
  • know which nodes are installed
  • support multiple AI providers
  • accept attachments
  • and make AI-generated changes easier to review and apply

So this project is my attempt to turn that into a proper Node-RED contrib module.

Any feedback, criticism, or alternative ideas are very welcome.

Thanks a lot for your time.


4 Likes

Nice, does it work with any provider that is openAI compatible? We use litellm at work and would love to try this !

Hi @nlecaude , yes it should work with any openai api compatible. Let me know :slight_smile: