System-Prompt-Tuner
Dies ist ein Engineering, AI-Bereich Automatisierungsworkflow mit 5 Nodes. Hauptsächlich werden Gmail, FormTrigger, Agent, LmChatOpenAi, OutputParserStructured und andere Nodes verwendet, kombiniert mit KI-Technologie für intelligente Automatisierung. Optimierung des AI-Agenten-Systems durch Feedback-Analyse mit GPT-4o und E-Mail-Versand
- •Google-Konto + Gmail API-Anmeldedaten
- •OpenAI API Key
Verwendete Nodes (5)
Kategorie
{
"id": "rx7v6helgDYENRs2",
"meta": {
"instanceId": "25cd9c9e1e996c71452f1ab7a15c1f1aa174615661f703590b37f8d95476bb1b",
"templateCredsSetupCompleted": true
},
"name": "System Prompt Tuner",
"tags": [],
"nodes": [
{
"id": "62a0e2bc-7c17-4546-b627-bbedc863a3a0",
"name": "Benutzereingaben",
"type": "n8n-nodes-base.formTrigger",
"position": [
-460,
-80
],
"webhookId": "cb20401c-ade4-45ce-912e-15956449ca3d",
"parameters": {
"options": {
"buttonLabel": "Send For Evaluation"
},
"formTitle": "Agent Prompt Tuner",
"formFields": {
"values": [
{
"fieldLabel": "Agent Name",
"requiredField": true
},
{
"fieldType": "textarea",
"fieldLabel": "Agent Purpose",
"requiredField": true
},
{
"fieldType": "textarea",
"fieldLabel": "What's Working?",
"requiredField": true
},
{
"fieldType": "textarea",
"fieldLabel": "What's Not Working?",
"requiredField": true
},
{
"fieldType": "textarea",
"fieldLabel": "Current System Prompt",
"requiredField": true
},
{
"fieldType": "textarea",
"fieldLabel": "Sample Input (Prompt)"
},
{
"fieldType": "textarea",
"fieldLabel": "Example Output"
}
]
},
"formDescription": "Enhances autonomous agent system prompts based on user provided descriptions of behavior and examples "
},
"typeVersion": 2.2
},
{
"id": "355883e9-05c4-47a1-a9f1-37aec5e3a550",
"name": "KI-Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
-240,
-80
],
"parameters": {
"text": "=Here is the information for your analysis:\n\nAgent Name: {{ $json['Agent Name'] }}\n\nAgent Purpose: {{ $json['Agent Purpose'] }}\n\nCurrent System Prompt: {{ $json['Current System Prompt'] }}\n\nHere is how I would evaluate its current performance.\n\nThis is working well: {{ $json['What\\'s Working?'] }}\n\nThis is what's going wrong: {{ $json['What\\'s Not Working?'] }}\n\nHere's an examlple of a prompt I wrote and the output I received. If the following section is blank, please disregard it. Otherwise, consider it in your evaluation:\n\nSample prompt: {{ $json['Sample Input (Prompt)'] }}\n\nThe prompt generated the following output:\n\n{{ $json['Example Output'] }}\n\n\nPlease generate the improved system prompt ensuring that your response adheres to the JSON formatting instruction.",
"options": {
"systemMessage": "You are an expert AI prompt engineer. \n\nYour task is to receive a set of observations about how a specific AI agent is performing. These observations include:\n\n* The name of the AI agent\n* A short description of the agent's intended purpose\n* A description of what *is* working well\n* A description of what *is not* working as expected\n* (Optionally) An example output from the current version of the agent\n\nUsing this information, your task is to analyze the shortcomings or gaps in the agent's behavior and generate a revised, full **system prompt** intended to improve its performance and address the identified issues.\n\nYour response should be in **JSON** format with the following fields:\n\n```json\n{\n \"updated_system_prompt\": \"The full improved system prompt, rewritten from scratch or as a modification of the implied original\",\n \"summary_of_improvements\": \"A short explanation of what was changed or improved and why\"\n}\n```\n\nYou must:\n\n* Use clear and specific instructions in the new system prompt.\n* Preserve functionality that is working well.\n* Directly address behaviors that need correction.\n* Avoid vague language and ensure the new prompt is actionable and well-structured.\n\nDo not include any commentary outside the JSON response."
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.9
},
{
"id": "b869ffde-2392-4465-8092-9fbbbc9853b0",
"name": "OpenAI Chat-Modell",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
-380,
120
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"credentials": {
"openAiApi": {
"id": "***",
"name": "OpenAI Chat"
}
},
"typeVersion": 1.2
},
{
"id": "315ef666-e3cc-4b75-9ec3-4a0c8f4938a0",
"name": "Strukturierter Ausgabeparser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
-80,
140
],
"parameters": {
"jsonSchemaExample": "{\n \"updated_system_prompt\": \"The full improved system prompt, rewritten from scratch or as a modification of the implied original\",\n \"summary_of_improvements\": \"A short explanation of what was changed or improved and why\"\n}"
},
"typeVersion": 1.2
},
{
"id": "9143224c-c6ab-4e58-8b0c-e95b1f2f00a7",
"name": "Gmail",
"type": "n8n-nodes-base.gmail",
"position": [
120,
-100
],
"webhookId": "aa0e272c-96f6-465d-9f3c-555851974937",
"parameters": {
"sendTo": "user@example.com",
"message": "=<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title>AI System Prompt Improvement Notification</title>\n <style>\n body { font-family: Arial, sans-serif; line-height: 1.6; color: #333; background-color: #f9f9f9; padding: 20px; }\n .container { background-color: #ffffff; border-radius: 8px; padding: 24px; max-width: 700px; margin: auto; box-shadow: 0 0 10px rgba(0,0,0,0.05); }\n h2 { color: #2c3e50; border-bottom: 1px solid #ddd; padding-bottom: 4px; }\n pre { background-color: #f4f4f4; padding: 12px; border-radius: 4px; overflow-x: auto; font-family: monospace; }\n .footer { margin-top: 30px; font-size: 0.9em; color: #777; }\n </style>\n</head>\n<body>\n <div class=\"container\">\n <p>Hi there!</p>\n <p>You asked the <strong>AI System Prompt Improvement Agent</strong> to review the system prompt for <strong>{{ $('User inputs').item.json['Agent Name'] }}</strong>.</p>\n <h2>✅ Recommended Updated System Prompt</h2>\n <pre>{{ $json.output.updated_system_prompt }}</pre>\n <h2>📄 Original System Prompt</h2>\n <pre>{{ $('User inputs').item.json['Current System Prompt'] }}</pre>\n <h2>✏️ Summary of Improvements</h2>\n <p>{{ $json.output.summary_of_improvements }}</p>\n <div class=\"footer\">\n Regards,<br>\n <strong>AI Improvement Agent</strong>\n </div>\n </div>\n</body>\n</html>",
"subject": "=Improved prompt for: {{ $('User inputs').item.json['Agent Name'] }}"
},
"credentials": {
"gmailOAuth2": {
"id": "***",
"name": "Redacted Gmail OAuth"
}
},
"typeVersion": 2.1
}
],
"active": false,
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"versionId": "447d5b7f-6409-4470-aac7-be8e36c9e34d",
"connections": {
"355883e9-05c4-47a1-a9f1-37aec5e3a550": {
"main": [
[
{
"node": "9143224c-c6ab-4e58-8b0c-e95b1f2f00a7",
"type": "main",
"index": 0
}
]
]
},
"62a0e2bc-7c17-4546-b627-bbedc863a3a0": {
"main": [
[
{
"node": "355883e9-05c4-47a1-a9f1-37aec5e3a550",
"type": "main",
"index": 0
}
]
]
},
"b869ffde-2392-4465-8092-9fbbbc9853b0": {
"ai_languageModel": [
[
{
"node": "355883e9-05c4-47a1-a9f1-37aec5e3a550",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"315ef666-e3cc-4b75-9ec3-4a0c8f4938a0": {
"ai_outputParser": [
[
{
"node": "355883e9-05c4-47a1-a9f1-37aec5e3a550",
"type": "ai_outputParser",
"index": 0
}
]
]
}
}
}Wie verwende ich diesen Workflow?
Kopieren Sie den obigen JSON-Code, erstellen Sie einen neuen Workflow in Ihrer n8n-Instanz und wählen Sie "Aus JSON importieren". Fügen Sie die Konfiguration ein und passen Sie die Anmeldedaten nach Bedarf an.
Für welche Szenarien ist dieser Workflow geeignet?
Anfänger - Engineering, Künstliche Intelligenz
Ist es kostenpflichtig?
Dieser Workflow ist völlig kostenlos. Beachten Sie jedoch, dass Drittanbieterdienste (wie OpenAI API), die im Workflow verwendet werden, möglicherweise kostenpflichtig sind.
Verwandte Workflows
Daniel Rosehill
@danielrosehillDiesen Workflow teilen