This project implements a controlled multi-agent workflow using LangGraph and LLMs to execute complex tasks in a structured and reliable manner.
Instead of relying on a single LLM response, the system follows an iterative loop: Planning → Execution → Evaluation → Retry/Advance
This approach improves robustness, traceability, and control over task completion.
The system is composed of three core agents:
- Decomposes a high-level task into sequential subtasks
- Produces a structured list of actionable steps
- Executes each subtask step-by-step
- Uses previous results as context for continuity
- Evaluates the output of each step
- Returns:
PASS→ proceed to next stepFAIL→ retry (with limit)
- Iterative multi-agent loop (Plan → Execute → Evaluate)
- Controlled termination (prevents infinite loops)
- Retry mechanism with limits
- Self-evaluation using a critic agent
- Structured state management via LangGraph
- JSON output logging for reproducibility
- Secure API key handling using environment variables
- Python
- LangGraph
- LangChain
- OpenAI API
Clone the repository:
git clone https://github.com/your-username/repo-name.git
cd repo-namepip install -r requirements.txt
python multi_agent_demo.py