Self-Improving AI Agent for Automatic Software Project Generation
An intelligent AI-powered system that automatically analyzes, designs, codes, tests, and documents complete software projects using state-of-the-art language models via OpenRouter.ai.
The AI Agent MVP takes a simple project description and automatically generates:
- π Project Analysis - Requirements, user stories, technical specifications
- ποΈ Software Architecture - System design, database schema, API structure
- π» Complete Source Code - Ready-to-run project files and folders
- π§ͺ Testing Strategy - Test cases, automation setup, quality gates
- π Documentation - User guides, API docs, deployment instructions
- π§ Real Project Files - Actual working directories with proper file structure
Input: "Build a todo app with React frontend and Node.js backend"
Output: Complete working project with all files, documentation, and deployment ready!
- π End-to-End Automation - From idea to working code
- π€ Multi-Model Support - Works with various AI models via OpenRouter
- π Real File Generation - Creates actual project directories and files
- π³ Docker Ready - Containerized for easy deployment
- π Sequential Pipeline - 6-phase structured development process
- π Comprehensive Logging - Track every step of the generation process
- π― Production Ready - Clean, documented, and maintainable code output
Component | Technology |
---|---|
Backend | Python 3.12 + FastAPI |
AI Integration | OpenRouter.ai API |
Current Model | Qwen 3 Coder (Free) |
Container | Docker + Docker Compose |
Environment | python-dotenv |
HTTP Client | requests |
- Docker and Docker Compose
- OpenRouter.ai API key (Get yours here)
git clone https://github.com/yourusername/mvp-ai-agent.git
cd mvp-ai-agent
# Add your OpenRouter API key to .env
echo "OPENROUTER_API_KEY=your_actual_api_key_here" >> .env
# Build the Docker image
docker build -t mvp-ai-agent .
# Run with volume mapping for real-time file access
docker run -d -p 8000:8000 -v $(pwd)/outputs:/app/outputs mvp-ai-agent
# Check if the service is running
curl http://localhost:8000/health
# Generate your first project
curl -X POST "http://localhost:8000/generate" \
-H "Content-Type: application/json" \
-d '{"description": "Build a simple todo app with React frontend and Express.js backend"}'
# View generated project structure
ls -la outputs/
tree outputs/source_code/ # If tree is installed
# Generated files will be in:
# outputs/source_code/frontend/
# outputs/source_code/backend/
Once running, visit: http://localhost:8000/docs
Generate a complete software project from description.
Request:
{
"description": "Your project description here"
}
Response:
{
"success": true,
"message": "AI agent pipeline completed successfully",
"execution_time": 45.2,
"outputs": {
"analysis": "outputs/analysis.md",
"design": "outputs/design.md",
"source_code": "outputs/source_code/implementation.md",
"testing": "outputs/tests.md",
"documentation": "outputs/documentation.md"
},
"project_generation": {
"success": true,
"created_files": ["frontend/App.jsx", "backend/server.js"],
"created_directories": ["frontend", "backend"],
"total_files": 8,
"total_directories": 3
}
}
GET /health
- Health checkGET /
- Service status
Variable | Description | Default |
---|---|---|
OPENROUTER_API_KEY |
Your OpenRouter API key | Required |
OPENROUTER_MODEL |
AI model to use | qwen/qwen3-coder:free |
Available Models:
qwen/qwen3-coder:free
(Default - Free)google/gemini-2.0-flash-exp:free
(Free)anthropic/claude-3.5-sonnet
(Paid)openai/gpt-4o
(Paid)
Switch Models:
# Via environment variable
export OPENROUTER_MODEL="google/gemini-2.0-flash-exp:free"
# Via Docker run
docker run -e OPENROUTER_MODEL="anthropic/claude-3.5-sonnet" mvp-ai-agent
mvp-ai-agent/
βββ app.py # FastAPI orchestrator
βββ openrouter_service.py # AI model integration
βββ model_config.py # Model configuration
βββ prompts/ # AI prompt templates
β βββ analysis.txt
β βββ design.txt
β βββ coding.txt
β βββ testing.txt
β βββ documentation.txt
βββ outputs/ # Generated content
β βββ analysis.md # Project analysis
β βββ design.md # Architecture design
β βββ tests.md # Testing strategy
β βββ documentation.md # Final documentation
β βββ source_code/ # Real project files
β βββ frontend/ # Frontend application
β βββ backend/ # Backend application
β βββ database/ # Database files
βββ requirements.txt # Python dependencies
βββ Dockerfile # Container configuration
βββ .env # Environment variables
{
"description": "Create a blog platform with user authentication, post creation, comments, and admin panel using Next.js and PostgreSQL"
}
{
"description": "Build a REST API for a fitness tracking app with user profiles, workout logging, and progress analytics using FastAPI and MongoDB"
}
{
"description": "Develop a file organizer desktop app with drag-drop interface, automatic categorization, and cloud sync using Electron and Node.js"
}
- π Analysis Phase - Requirements gathering, user stories, technical specs
- ποΈ Design Phase - System architecture, database design, API specs
- π» Coding Phase - Complete source code, project structure, config files
- π§ͺ Testing Phase - Test strategies, test cases, quality assurance
- π Documentation Phase - User docs, API docs, deployment guides
- π§ Real Project Generation - Actual file creation, directory structure
Metric | Value |
---|---|
Average Generation Time | Depending on the performance of the language model |
Supported File Types | JavaScript, Python, HTML, CSS, JSON, Markdown |
Max Project Complexity | Medium to large applications |
Concurrent Requests | Limited by OpenRouter rate limits |
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
# Clone and setup
git clone https://github.com/yourusername/mvp-ai-agent.git
cd mvp-ai-agent
# Install dependencies
pip install -r requirements.txt
# Run locally
python app.py
This project is licensed under the MIT License.
- OpenRouter.ai for AI model access
- FastAPI for the excellent web framework
- Qwen Team for the coding-specialized model
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Made with β€οΈ by Γmer Yasir Γnal(https://github.com/yourusername)
"From idea to implementation in minutes, not months."