A simple project demonstrating how an AI system can improve its own writing using a reflection loop.
Instead of generating text once and stopping, the system follows a structured workflow that allows the model to critique and refine its own output.
- Draft – The model generates an essay on a given topic.
- Reflect – The model critiques its own writing, focusing on clarity, structure, and argument strength.
- Revise – The model improves the essay using the feedback it generated.
This pattern is inspired by agentic AI systems, where models can evaluate and improve their own outputs.
The pipeline follows a simple structure:
Draft → Reflection → Revision
Each stage uses an OpenAI model (gpt-4o-mini) to:
- write the initial essay
- generate constructive critique
- produce a stronger final version
- Python
- OpenAI API
- python-dotenv