Library / AI Agents & Assistants
AI Agents & Assistants
Improve AI Output with Critic and Refiner Agent Loops
When you run it, an OpenAI agent drafts a result and critic and refiner agents loop over it to improve it.
What it does
# ⚙️ Setup Guide ## This is a workflow for user's customization. ### 🧑💻 Author: Sebastian/OptiLever ### 🚀 Prerequisite: 1. Connect to Openai API account. --- ### 🚀 Steps to Connect: 1. Edit Fields Node Setup (Initial) - Locate the "Edit Fields" node at the beginning of the workflow. - Edit the following fields: - Ensure the input field "ideas" is set as an array. - Add a field "turn" to track the number of loop iterations (default value: 1). - Add a field "done" to track if the evaluation is complete (default value: false). 2. Critic Agent Setup - Configure the "Critic Agent" node to analyze the input and provide feedback. - Ensure the output is structured to include suggestions for improvements. 3. Refiner Agent Setup - Configure the "Refiner Agent" node to use the original input and critic feedback. - Ensure the output is an improved version of the input (e.g., three improved names and taglines). 4. Evaluation Agent Setup - Configure the "Evaluation Agent" node to rank the refined outputs. - Ensure the output includes a "done" field indicating if the result is satisfactory. 5. Edit Fields Node Setup (Final) - Ensure the final "Edit Fields" node matches the structure of the initial input. - This ensures the loop can process the data correctly in each iteration. 6. If Node Setup - Configure the "If" node to check if "turn" exceeds a threshold (e.g., 5) or if "done" is true. - If true, exit the loop and proceed to the next step in the workflow. 7. Optional: Additional AI Agents - Add additional AI agents after the loop to further process the final output. ---
The steps
- AI Agent
- Loop Over Items
- If
- Critic Agent
- Refiner Agent
- Edit Fields
- Code
- Edit Fields1
- OpenAI Chat Model
- Structured Output Parser
- When clicking ‘Execute workflow’
- Evaluation agent
Similar automations
Building Blocks & UtilitiesGenerate JSON Output Formats for AI Agents with Mistral19 stepsAI Agents & AssistantsGet Reliable Structured Output from OpenAI Agents10 stepsBuilding Blocks & UtilitiesValidate OpenAI Output with Auto-Fixing Parsers7 stepsRAG & Knowledge BasesForecast Solar Output with Claude RAG and Supabase10 steps