CodePhoenix is a "self-healing" multi-agent system designed to autonomously diagnose, research, and repair broken Python code. It mimics the workflow of a Senior Software Engineer by executing a strict Research-Fix-Verify loop within a secure execution environment.
CodePhoenix utilizes a Sequential Process across three specialized agents:
- 🔍 The Investigator: Analyzes
broken_script.pyand uses Google Search to find current solutions. - ⚙️ The Engineer: Implements the fix and runs it inside an isolated Docker container.
- 💼 The Manager: Validates the result and sends a Push Notification to the user.
- Python 3.11+
- Docker Desktop: Download here. (Ensure it is running before starting the crew).
- OpenAI API Key: Get it here.
To enable the full "Autonomous" experience, sign up for these free tiers:
- Serper (Search): Go to serper.dev, sign up, and copy your API Key. This allows the agent to search Google/StackOverflow.
- Pushover (Mobile Alerts): 1. Install the Pushover app on your phone. 2. Go to pushover.net to get your User Key. 3. Create an "Application" on the dashboard to get your API Token.
# Clone the repository
git clone [https://github.com/Sama-ndari/code_phoenix.git](https://github.com/Sama-ndari/code_phoenix.git)
cd code_phoenix
# Install dependencies
uv sync
Create a .env file in the root directory and fill in your keys:
# Core LLM
OPENAI_API_KEY=sk-proj-xxxx
# Web Research (serper.dev)
SERPER_API_KEY=xxxx
# Mobile Notifications (pushover.net)
PUSHOVER_USER=xxxx
PUSHOVER_TOKEN=xxxx
- Define the Problem: Place any broken Python code into
broken_script.pyin the root folder. - Run the Crew:
uv run crewai run
- Observe:
- The Investigator will log its research findings.
- The Engineer will create
fixed_script.pyand start a Docker container to test it. - You will receive a Push Notification on your phone once the script is verified as working.
src/code_phoenix/config/: YAML files defining Agent personalities and Task sequences.src/code_phoenix/tools/: Custom Python tools (Pushover integration).broken_script.py: The input file the agents monitor.fixed_script.py: The final output generated by the Engineer.
Created by Samandari