node-red-contrib-ai-agent 0.5.1 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Your feedback and contributions are highly appreciated!
|
|
|
19
19
|
## Features
|
|
20
20
|
|
|
21
21
|
- **AI Agent Node**: Process messages with AI, maintaining conversation context
|
|
22
|
-
- **AI Agent
|
|
22
|
+
- **AI Orchestrator Agent Node**: Participates in orchestrated flows via Chain Discovery
|
|
23
23
|
- **Memory Nodes**:
|
|
24
24
|
- **In-Memory**: Store conversation context in memory (volatile)
|
|
25
25
|
- **File-based**: Persist conversation context to disk
|
|
@@ -62,7 +62,7 @@ Processes messages using the configured AI model and maintains conversation cont
|
|
|
62
62
|
- **System Prompt**: Initial instructions for the AI
|
|
63
63
|
- **Response Type**: Format of the response (text or JSON object)
|
|
64
64
|
|
|
65
|
-
### AI Agent
|
|
65
|
+
### AI Orchestrator Agent
|
|
66
66
|
A specialized version of the AI Agent designed for multi-agent workflows. It "tags" messages in a pipeline so the **AI Orchestrator** can discover it.
|
|
67
67
|
|
|
68
68
|
**Properties:**
|
|
@@ -200,7 +200,7 @@ Each agent will maintain its own conversation context based on its memory config
|
|
|
200
200
|
The AI Orchestrator can manage complex, multi-step tasks by utilizing specialized agents in a pipeline:
|
|
201
201
|
|
|
202
202
|
1. Add an **AI Orchestrator** node.
|
|
203
|
-
2. Add one or more **AI Agent
|
|
203
|
+
2. Add one or more **AI Orchestrator Agent** nodes (e.g., "Coder", "Researcher").
|
|
204
204
|
3. Connect them in a line: `[Inject Goal] --> [Coder] --> [Researcher] --> [Orchestrator] --> [Debug]`.
|
|
205
205
|
4. The Orchestrator will automatically discover the "Coder" and "Researcher" via the message pipeline and call them as needed to achieve the goal.
|
|
206
206
|
|
|
@@ -87,7 +87,7 @@ module.exports = function (RED) {
|
|
|
87
87
|
|
|
88
88
|
const agentNode = RED.nodes.getNode(agentInfo.id);
|
|
89
89
|
if (!agentNode || typeof agentNode.executeTask !== 'function') {
|
|
90
|
-
throw new Error(`Agent node ${agentInfo.name} [${agentInfo.id}] is not an AI Agent
|
|
90
|
+
throw new Error(`Agent node ${agentInfo.name} [${agentInfo.id}] is not an AI Orchestrator Agent or is missing executeTask API.`);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
node.status({ fill: 'blue', shape: 'ring', text: `agent: ${agentInfo.name}` });
|
package/{agent-orchestrator/agent-orchestrator.html → orchestrator-agent/orchestrator-agent.html}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script type="text/javascript">
|
|
2
|
-
RED.nodes.registerType('ai-agent
|
|
2
|
+
RED.nodes.registerType('ai-orchestrator-agent', {
|
|
3
3
|
category: 'AI Agent',
|
|
4
4
|
color: '#deb887',
|
|
5
5
|
defaults: {
|
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
inputs: 1,
|
|
17
|
-
outputs:
|
|
17
|
+
outputs: 1,
|
|
18
18
|
icon: 'agent/ai-agent-icon.svg',
|
|
19
19
|
label: function () {
|
|
20
|
-
return this.name || 'AI Agent
|
|
20
|
+
return this.name || 'AI Orchestrator Agent';
|
|
21
21
|
},
|
|
22
|
-
paletteLabel: 'Agent
|
|
22
|
+
paletteLabel: 'Orchestrator Agent',
|
|
23
23
|
oneditprepare: function () {
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
|
-
<script type="text/x-red" data-template-name="ai-agent
|
|
28
|
+
<script type="text/x-red" data-template-name="ai-orchestrator-agent">
|
|
29
29
|
<div class="form-row">
|
|
30
30
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
|
31
|
-
<input type="text" id="node-input-name" placeholder="AI Agent
|
|
31
|
+
<input type="text" id="node-input-name" placeholder="AI Orchestrator Agent">
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<div class="form-row">
|
|
@@ -46,13 +46,12 @@
|
|
|
46
46
|
|
|
47
47
|
<div class="form-tips" style="background: #f8f9fa; border-left: 3px solid #3b78e7; padding: 10px;">
|
|
48
48
|
<p><b>Pipeline Node:</b> This node tags messages with its identity so a connected Orchestrator can use it.</p>
|
|
49
|
-
<p><b>Output
|
|
50
|
-
<p><b>Output 2:</b> Discovery Pipeline (Connect to Orchestrator).</p>
|
|
49
|
+
<p><b>Output:</b> Discovery Pipeline (Connect to Orchestrator).</p>
|
|
51
50
|
</div>
|
|
52
51
|
</script>
|
|
53
52
|
|
|
54
|
-
<script type="text/x-red" data-help-name="ai-agent
|
|
55
|
-
<h3>AI Agent
|
|
53
|
+
<script type="text/x-red" data-help-name="ai-orchestrator-agent">
|
|
54
|
+
<h3>AI Orchestrator Agent Node</h3>
|
|
56
55
|
<p>A specialized version of the AI Agent designed for multi-agent workflows.</p>
|
|
57
56
|
|
|
58
57
|
<h4>Features</h4>
|
|
@@ -64,7 +63,7 @@
|
|
|
64
63
|
<h4>Usage</h4>
|
|
65
64
|
<ol>
|
|
66
65
|
<li>Place the node in front of an AI Orchestrator node.</li>
|
|
67
|
-
<li>Connect the
|
|
66
|
+
<li>Connect the output of this node to the input of the Orchestrator.</li>
|
|
68
67
|
<li>Define the agent's specific capabilities in the config.</li>
|
|
69
68
|
</ol>
|
|
70
|
-
</script>
|
|
69
|
+
</script>
|
package/{agent-orchestrator/agent-orchestrator.js → orchestrator-agent/orchestrator-agent.js}
RENAMED
|
@@ -65,7 +65,7 @@ function updateContext(msg, userMessage, assistantResponse) {
|
|
|
65
65
|
function handleError(node, msg, error) {
|
|
66
66
|
const errorMsg = error.response?.data?.error?.message || error.message || 'Unknown error';
|
|
67
67
|
node.status({ fill: 'red', shape: 'ring', text: 'Error' });
|
|
68
|
-
node.error('AI Agent
|
|
68
|
+
node.error('AI Orchestrator Agent Error: ' + errorMsg, msg);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
@@ -120,7 +120,7 @@ async function callAI(node, aiConfig, messages) {
|
|
|
120
120
|
'Authorization': `Bearer ${aiConfig.apiKey}`,
|
|
121
121
|
'Content-Type': 'application/json',
|
|
122
122
|
'HTTP-Referer': 'https://nodered.org/',
|
|
123
|
-
'X-Title': 'Node-RED AI Agent
|
|
123
|
+
'X-Title': 'Node-RED AI Orchestrator-Agent'
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
);
|
|
@@ -186,11 +186,9 @@ async function processToolCalls(node, responseMessage, tools, messages, aiConfig
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
module.exports = function (RED) {
|
|
189
|
-
function
|
|
189
|
+
function AIOrchestratorAgent(config) {
|
|
190
190
|
RED.nodes.createNode(this, config);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
this.name = config.name || 'AI Agent Orchestrator';
|
|
191
|
+
this.name = config.name || 'AI Orchestrator Agent';
|
|
194
192
|
this.systemPrompt = config.systemPrompt || 'You are a helpful AI assistant.';
|
|
195
193
|
this.capabilities = (config.capabilities || '').split(',').map(s => s.trim()).filter(Boolean);
|
|
196
194
|
|
|
@@ -217,6 +215,8 @@ module.exports = function (RED) {
|
|
|
217
215
|
}
|
|
218
216
|
};
|
|
219
217
|
|
|
218
|
+
const node = this;
|
|
219
|
+
|
|
220
220
|
node.on('close', function (done) {
|
|
221
221
|
node.status({});
|
|
222
222
|
if (done) done();
|
|
@@ -251,5 +251,5 @@ module.exports = function (RED) {
|
|
|
251
251
|
});
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
RED.nodes.registerType('ai-agent
|
|
254
|
+
RED.nodes.registerType('ai-orchestrator-agent', AIOrchestratorAgent);
|
|
255
255
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-red-contrib-ai-agent",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "AI Agent for Node-RED",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"license": "AGPL-3.0",
|
|
29
29
|
"files": [
|
|
30
30
|
"agent/*",
|
|
31
|
-
"
|
|
31
|
+
"memory-file/*",
|
|
32
|
+
"memory-inmem/*",
|
|
32
33
|
"model/*",
|
|
34
|
+
"orchestrator/*",
|
|
35
|
+
"orchestrator-agent/*",
|
|
33
36
|
"tool/*",
|
|
34
37
|
"tool-function/*",
|
|
35
|
-
"tool-http/*"
|
|
36
|
-
"memory-file/*",
|
|
37
|
-
"memory-inmem/*",
|
|
38
|
-
"orchestrator/*"
|
|
38
|
+
"tool-http/*"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"axios": "^1.6.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"ai-memory-file": "./memory-file/memory-file.js",
|
|
66
66
|
"ai-memory-inmem": "./memory-inmem/memory-inmem.js",
|
|
67
67
|
"ai-orchestrator": "./orchestrator/orchestrator.js",
|
|
68
|
-
"ai-agent
|
|
68
|
+
"ai-orchestrator-agent": "./orchestrator-agent/orchestrator-agent.js",
|
|
69
69
|
"ai-tool-approval": "./tool-approval/ai-tool-approval.js"
|
|
70
70
|
}
|
|
71
71
|
}
|