Skip to content
NEWMarketplace and the trig8n Agent: sell what you build, and get plans and changes that are tested before you see them. See what is new

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

  1. AI Agent
  2. Loop Over Items
  3. If
  4. Critic Agent
  5. Refiner Agent
  6. Edit Fields
  7. Code
  8. Edit Fields1
  9. OpenAI Chat Model
  10. Structured Output Parser
  11. When clicking ‘Execute workflow’
  12. Evaluation agent

Similar automations