π€ AI Python Developer Agent with CrewAI
An AI-powered Python development agent that generates complete Python applications based on your requirements.
Powered by CrewAI, OpenAI, Gradio, and a fully modular multi-agent architecture.
β οΈ Note: This project is built for development and testing.
For production, ensure secure API keys, HTTPS, and proper rate limiting.
π Features
- π§ Multi-Agent System with specialized roles (Engineering Lead, Backend Engineer, Frontend Engineer, Service Runner)\
- π Automated Design generation from high-level requirements\
- π» Python Code Generation with clean, efficient implementation\
- π¨ Gradio UI Generation for instant prototypes and demos\
βΆοΈ Automatic Service Runner to launch generated applications\- π§ Terminal Tool Integration for command execution\
- π YAML-based Configuration for agents and tasks
π§ Tech Stack
| Technology | Version | Description |
|---|---|---|
| Python | 3.10+ | Core language |
| CrewAI | 1.6.0 | Multi-agent orchestration framework |
| OpenAI API | GPT-4o | LLM for code generation |
| Gradio | 6.0.1+ | Interactive UI framework |
| Hatchling | Latest | Build system |
βοΈ Prerequisites
Before running the project, ensure you have:
- π Python 3.10+\
- π¦ pip or uv (recommended)\
- π Git\
- π OpenAI API key
π οΈ Installation
git clone https://github.com/ReZaiden/Python-Developer-Agent-with-crewai.git
cd Python-Developer-Agent-with-crewai
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .Or using uv (faster):
uv syncποΈ Edit .env file
- Rename
.env.samplefile to.env - Add your OpenAI API key:
MODEL=gpt-4o-mini
OPENAI_API_KEY=your_openai_api_key_hereβΆοΈ Run the Project
Using Gradio UI:
source .venv/bin/activate # On Windows: .venv\Scripts\activate
python src/project/app.pyThen go to http://localhost:11228/
Using CLI:
python -m projectOr:
run_crewπ‘ How It Works
- User provides requirements β Describe what Python application you need\
- Engineering Lead β Creates detailed design with classes and methods\
- Backend Engineer β Writes clean Python implementation code\
- Frontend Engineer β Builds a Gradio UI to demonstrate the backend\
- Service Runner β Launches the generated application\
- Output saved β All files saved in
output/{module_name}/
π§© Project Structure
src/
βββ project/
βββ __init__.py
βββ app.py # Gradio web interface
βββ crew.py # CrewAI agents and crew setup
βββ main.py # CLI entry point
βββ config/
β βββ agents.yaml # Agent configurations
β βββ tasks.yaml # Task definitions
βββ tools/
βββ __init__.py
βββ run_terminal.py # Terminal execution tool
output/ # Generated applications (created during execution)
pyproject.toml # Project configuration
.env.sample # Environment variables template
π€ Agents
| Agent | Role |
|---|---|
| Engineering Lead | Designs the application architecture |
| Backend Engineer | Implements Python code |
| Frontend Engineer | Creates Gradio UI |
| Service Runner | Runs the generated application |
π Security Notes
- Keep API keys inside
.env\ - Never commit
.envto version control\ - Use safe code execution mode for untrusted inputs
π‘ Future Improvements
- Add more specialized agents\
- Support for multiple programming languages\
- Database integration for project history\
- Enhanced error handling and validation
π§βπ» Author
Developed by: ReZaiden
πΌ GitHub: @ReZaiden
π§ Contact: rezaidensalmani@gmail.com