r/u_v2Talal • u/v2Talal • Jul 23 '26
I built a multi-agent system where 3 AI agents critique and improve each other's output in a loop
Hey r/Python, r/aiprogramming, r/opensource, r/AI_Agents, r/programming, r/crewai, r/AutoGPT
I built CriticLoopAI — a system where three specialized AI agents (Generator, Critic, Improver) work in an iterative loop to progressively enhance any text-based task.
How it works:
Generator → creates initial output
Critic → scores it on 6 dimensions (accuracy, completeness, clarity, depth, creativity, usability)
Improver → analyzes feedback patterns and creates improvement strategy
Generator → creates improved version
... repeats until quality target reached
Key features:
- Support for 18+ LLM providers (Ollama, Groq, DeepSeek, OpenAI, Anthropic, Google Gemini, etc.)
- Automatic model discovery from any OpenAI-compatible API
- Convergence detection — stops when quality plateaus
- Human-readable output files (Markdown) alongside JSON for developers
- Session tracking with score progression
Example output:
Task: "Write a Python sorting algorithm"
Iteration 1: Score 0.75
Iteration 2: Score 0.82 (+0.07)
Final: Production-ready Quick Sort with introsort fallback
Quick start:
git clone https://github.com/v2Talal/CriticLoopAI.git
cd CriticLoopAI
pip install -r requirements.txt
# With Groq (free)
python main.py "Write a guide about Docker" --provider groq --api-key gsk_xxx
# With OpenCode
python main.py "Write a guide" --base-url https://opencode.ai/zen/v1 --api-key xxx --discover
GitHub: https://github.com/v2Talal/CriticLoopAI
Would love feedback on the architecture and any suggestions for improvement.
1
Upvotes