An AI-powered multi-agent system that automatically generates, reviews, and deploys web applications using CrewAI agents with SambaNova's LLM backend.
- Overview
- Architecture
- System Workflow
- Prerequisites
- Installation
- Configuration
- Running the Application
- API Endpoints
- Deployment
- Project Structure
- Agents
- Core Components
- Troubleshooting
This system implements an automated development workflow using two AI agents:
- Developer Agent: Generates production-ready HTML, CSS, and JavaScript code
- Debugger Agent: Reviews code quality, identifies issues, and approves deployments
The system uses a feedback loop mechanism with a maximum iteration limit to ensure code quality before deployment.
┌─────────────┐ ┌──────────────────┐ ┌──────────────┐
│ │ │ │ │ │
│ User │───▶│ API │───▶│ Development │
│ │ │ │ │ Crew │
└─────────────┘ └──────────────────┘ └──────────────┘
│ │
▼ ▼
┌──────────────────┐ ┌──────────────┐
│ │ │ │
│ Frontend │◀───┤ Agents │
│ (Vercel) │ │ │
│ │ └──────────────┘
└──────────────────┘
- Requirements Input: User provides development requirements via API
- Development Phase: Developer agent generates code based on requirements
- Review Phase: Debugger agent reviews the generated code
- Approval Gate: Code must be approved (-11) or sent back for fixes (-00)
- Iteration: Process repeats until approval or max iterations reached
- Deployment: Approved code is prepared for deployment
- Python 3.8+
- SambaNova API key
- pip package manager
- Clone the repository:
git clone <repository-url>
cd coding-mas-2- Create a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Create a
.envfile in the project root:
cp .env.example .env- Add your SambaNova API key to the
.envfile:
SAMBANOVA_API_KEY=your_api_key_here
Start the API server:
python api.pyThe server will start on http://localhost:8000 by default.
Run the system via command line:
python main.py --cliHealth check and API information endpoint.
Response:
{
"message": "AI Developer & Debugger System API",
"endpoints": {
"health": "GET /health",
"generate": "POST /generate"
}
}Health check endpoint.
Response:
{
"status": "ok"
}Main endpoint for code generation with streaming updates.
Request Body:
{
"requirements": "Create a responsive website with a navigation bar and contact form",
"max_iterations": 5
}Response: Server-Sent Events stream with real-time updates:
data: {"status": "processing", "message": "Starting development process...", "progress": 0}
data: {"status": "processing", "message": "Developer agent generating code (iteration 1)", "progress": 15}
data: {"status": "completed", "message": "Process completed successfully", "progress": 100, "result": {"html": "<!DOCTYPE html>..."}}
The application is configured for deployment on Render. The render.yaml file contains the deployment configuration.
- Push your code to a GitHub repository
- Connect your repository to Render
- Render will automatically deploy using the configuration in
render.yaml
Set the following environment variables in your deployment environment:
SAMBANOVA_API_KEY: Your SambaNova API key
.
├── agents/ # AI agent implementations
│ ├── __init__.py
│ ├── developer_agent.py # Developer agent definition
│ └── debugger_agent.py # Debugger agent definition
├── core/ # Core system components
│ ├── __init__.py
│ ├── crew.py # Main crew orchestration
│ └── executor_client.py # Client for running development process
├── api.py # Flask API server
├── main.py # Command line interface
├── requirements.txt # Python dependencies
├── render.yaml # Render deployment configuration
├── .env.example # Environment variables template
└── README.md # This file
- Role: Senior Full-Stack Engineer
- Model: DeepSeek-R1-0528 via SambaNova
- Responsibilities:
- Generate production-ready HTML, CSS, and JavaScript
- Create visually appealing, modern, interactive websites
- Follow best practices for responsive design and accessibility
- Role: Code Reviewer
- Model: Meta-Llama-3.3-70B-Instruct via SambaNova
- Responsibilities:
- Strictly validate code quality and correctness
- Identify bugs, security issues, and performance problems
- Approve (-11) or reject (-00) code for deployment
Orchestrates the development process:
- Manages agent interactions
- Implements feedback loop mechanism
- Handles iteration limits
- Provides streaming updates
Client for running the development process:
- Interfaces with the DevelopmentCrew
- Handles streaming of updates
- Manages error handling
Flask-based API server:
- Provides REST endpoints
- Implements Server-Sent Events for streaming
- Handles CORS for cross-origin requests
- CORS Errors: Ensure
flask-corsis installed and properly configured - API Key Issues: Verify your SambaNova API key is correct and active
- Streaming Problems: Check network connectivity and browser compatibility
Enable verbose logging by setting the appropriate environment variables or modifying the agent configurations in the agent files.
For issues not covered in this README, please check the GitHub issues or contact the maintainers.