A centralized hub for multi-agent code creation, enhancement, and deployment
Project description
Agent Control Hub
A centralized hub for multi-agent code creation, enhancement, and deployment using Streamlit UI and FastAPI backend. Build complete applications with AI-powered agents that handle everything from prompt enhancement to deployment.
๐ Features
- ๐ค Multi-Agent Code Generation: Collaborative AI agents for prompt enhancement, file planning, code generation, testing, and deployment
- ๐ Language Support: Python, Node.js, React+TypeScript, Three.js, Go, Rust, Java
- ๐ง Virtual Environment Management: Per-project virtual environments with setup automation
- ๐ป Modern UI: Streamlit-based web interface with real-time project management
- โก FastAPI Backend: RESTful API with automatic documentation
- ๐ File Generation: Guaranteed file creation with fallback scaffolding
- ๐ Real-time Monitoring: Live project status and progress tracking
- ๐ฆ One-Click Deployment: Complete project packaging and download
๐๏ธ Architecture
graph TB
A[User Input] --> B[Streamlit UI]
B --> C[FastAPI Backend]
C --> D[Agent Pipeline]
D --> E[Prompt Enhancer]
D --> F[File Planner]
D --> G[Code Generator]
D --> H[Environment Setup]
E --> I[LLM Provider]
F --> I
G --> I
I --> J[Generated Project]
J --> K[Download/Deploy]
๐ Project Structure
Agent_Control_Hub/
โโโ src/ # Main source code
โ โโโ llm/ # LLM provider abstraction
โ โโโ ui/ # User interface components
โ โโโ main.py # Main entry point
โโโ agents/ # Agent definitions and factory
โโโ services/ # Business logic services
โโโ core/ # Core configuration
โโโ models/ # Pydantic response models
โโโ routers/ # FastAPI routers
โโโ server/ # FastAPI application
โโโ utils/ # Utility functions
โโโ tests/ # Test files
โโโ examples/ # Example files
โโโ config/ # Configuration files
โโโ docs/ # Documentation
โโโ prompts/ # Externalized prompts
โโโ templates/ # HTML templates
โโโ workspace/ # Agent workspace
โโโ logs/ # Log files
๐ Quick Start
Prerequisites
- Python 3.8 or higher
- Git
๐ New to Agent Control Hub? Check out our Complete Setup Guide for detailed step-by-step instructions with screenshots!
Installation
-
Clone the repository:
git clone https://github.com/Dzg0507/AgentHub.git cd AgentHub
-
Create a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
# Copy the example environment file cp config/env.example .env # Edit .env with your API keys nano .env # or use your preferred editor
Example
.envfile:# LLM Provider Configuration LLM_PROVIDER=gemini GOOGLE_API_KEY=your_google_api_key_here TOGETHER_API_KEY=your_together_api_key_here OPENROUTER_API_KEY=your_openrouter_api_key_here LLM_MODEL=gemini-1.5-flash
๐ฏ One-Command Startup (Recommended)
Start everything with one command:
# Quick launcher (recommended)
python run.py both
# Or use the full script
python scripts/start_hub.py
Or use the platform-specific scripts:
- Windows: Double-click
scripts/start_hub.bator runscripts/start_hub.bat - Unix/Linux/Mac:
./scripts/start_hub.sh
This will automatically:
- โ Start the FastAPI server on http://127.0.0.1:8000
- โ Start the Streamlit UI on http://localhost:8501
- โ Monitor both processes and restart if needed
- โ Provide unified shutdown with Ctrl+C
๐จ UI Features
๐ธ Want to see what it looks like? Check out our Visual Guide with detailed screenshots of every feature!
๐ Dashboard
- Welcome page with project creation
- Recent projects overview
- Quick start templates
๐ Project Management
- Comprehensive project listing
- Filtering and sorting capabilities
- Real-time status updates
- Project download and management
๐ฅ Server Status
- Real-time server health monitoring
- Server management controls
- Process monitoring and restart
๐ ๏ธ Debug Tools
- Testing and debugging utilities
- Log viewing and analysis
- Error tracking and resolution
๐ Pipeline Visualization
- Step-by-step process tracking
- Progress indicators
- Real-time status updates
๐ API Endpoints
Projects
POST /projects- Create a new projectGET /projects- List all projectsGET /projects/{id}- Get project detailsDELETE /projects/{id}- Delete a projectGET /projects/{id}/download- Download project as ZIPGET /projects/{id}/files- List project filesGET /projects/{id}/logs- Get execution logsPOST /projects/{id}/retry- Retry project processingPOST /projects/{id}/force-scaffold- Force create minimal scaffoldPOST /projects/{id}/venv- Create virtual environmentPOST /projects/{id}/setup- Run setup commands
System
GET /- Root endpoint with server infoGET /health- Health checkGET /ui- Built-in web interfaceGET /docs- Interactive API documentation
๐ Supported Languages
| Language | Framework | Package Manager | Status |
|---|---|---|---|
| Python | Standard Library | pip | โ Full Support |
| Node.js | Express/Fastify | npm | โ Full Support |
| React | TypeScript | npm/yarn | โ Full Support |
| Three.js | WebGL | npm | โ Full Support |
| Go | Standard Library | go mod | โ Full Support |
| Rust | Cargo | cargo | โ Full Support |
| Java | Spring Boot | Gradle | โ Full Support |
๐ Project Workflow
graph LR
A[User Prompt] --> B[Prompt Enhancement]
B --> C[File Planning]
C --> D[Code Generation]
D --> E[Environment Setup]
E --> F[Testing]
F --> G[Deployment]
G --> H[Download]
- ๐ Create Project: Submit a prompt describing what you want to build
- โจ Prompt Enhancement: AI enhances your prompt with technical requirements
- ๐ File Planning: AI creates a structured file plan for the project
- ๐ป Code Generation: AI generates complete, runnable code
- ๐ง Environment Setup: Virtual environment and dependencies are configured
- ๐งช Testing: Generated code is tested for functionality
- ๐ Deployment: Project is packaged and ready for deployment
- ๐ฆ Download: Get your complete project as a ZIP file
โ๏ธ Configuration
Environment Variables
| Variable | Description | Default | Required |
|---|---|---|---|
LLM_PROVIDER |
LLM provider to use | gemini |
Yes |
GOOGLE_API_KEY |
Google API key for Gemini | - | If using Gemini |
TOGETHER_API_KEY |
Together.ai API key | - | If using Together |
OPENROUTER_API_KEY |
OpenRouter API key | - | If using OpenRouter |
LLM_MODEL |
Model to use | gemini-1.5-flash |
No |
LLM_API_BASE |
Custom API base URL | - | No |
Server Configuration
Key configuration options in core/config.py:
SERVER_HOSTandSERVER_PORT: Server binding addressWORKSPACE_DIR: Directory for generated projectsTEMP_TTL_MINUTES: Project retention timeLLM_CONFIG: Language model configurationSUPPORTED_LANGUAGES: Available programming languages
๐งช Development
Running Tests
# Run all tests
python -m pytest tests/ -v
# Run specific test categories
python -m pytest tests/test_basic.py -v
python -m pytest tests/test_llm_provider.py -v
python -m pytest tests/test_utils.py -v
# Run with coverage
python -m pytest tests/ --cov=src --cov-report=html
Code Quality
# Format code
black .
# Lint code
flake8 .
# Type checking
mypy src/
Adding New Languages
- Add language to
SUPPORTED_LANGUAGESincore/config.py - Update
_write_language_scaffold()inservices/pipeline.py - Add setup commands in
setup_project()function - Update language selector in
streamlit_app.py
Adding New Agents
- Define agent in
agents/factory.py - Add agent to the returned dictionary
- Use agent in pipeline functions in
services/pipeline.py
๐ Troubleshooting
Common Issues
- Import Errors: Ensure all dependencies are installed and virtual environment is activated
- API Key Issues: Verify API keys are set in
.envfile - Port Conflicts: Change
SERVER_PORTincore/config.pyif port 8000 is in use - File Generation Failures: Use the "Force Scaffold" button to create minimal files
- Memory Issues: Reduce
TEMP_TTL_MINUTESto clean up old projects
Logs
- Server logs:
logs/agent_hub.log - Project execution logs: Available via
/projects/{id}/logsendpoint - Streamlit logs: Check terminal output
- CI/CD logs: Available in GitHub Actions tab
Getting Help
- ๐ Check the documentation
- ๐ Report issues on GitHub Issues
- ๐ฌ Start a discussion in GitHub Discussions
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Quick Contribution Steps
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests if applicable
- Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Setup
# Install development dependencies
pip install -e ".[dev]"
# Run pre-commit hooks
pre-commit install
# Run tests
pytest
# Format code
black .
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
- Streamlit for the amazing UI framework
- FastAPI for the high-performance API framework
- Google Gemini for the AI capabilities
- Together.ai for additional AI model access
- OpenRouter for model aggregation
๐ Project Status
- โ Core Features: Complete
- โ Multi-Language Support: Complete
- โ UI/UX: Complete
- โ API: Complete
- โ Testing: Complete
- โ CI/CD: Complete
- ๐ Documentation: Ongoing
- ๐ Performance Optimization: Ongoing
๐ Roadmap
- Plugin System: Extensible agent architecture
- Database Integration: Persistent project storage
- User Authentication: Multi-user support
- Cloud Deployment: One-click cloud deployment
- Advanced Analytics: Project metrics and insights
- Team Collaboration: Real-time collaborative editing
Made with โค๏ธ by the Agent Control Hub Team
โญ Star this repo โข ๐ Report Bug โข ๐ก Request Feature
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_control_hub-1.0.0.tar.gz.
File metadata
- Download URL: agent_control_hub-1.0.0.tar.gz
- Upload date:
- Size: 91.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6158f0a9bca4821b461fce1d754fae0d60f1b1f9d67fc573b4482f0d919faf01
|
|
| MD5 |
2ddbf59a774e51b3baf0efb2ae554502
|
|
| BLAKE2b-256 |
8228f7db757e244abd9fd800e9e19db9305490b165fbd52d3277c6275200886a
|
File details
Details for the file agent_control_hub-1.0.0-py3-none-any.whl.
File metadata
- Download URL: agent_control_hub-1.0.0-py3-none-any.whl
- Upload date:
- Size: 44.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0cdf72fc57d56f174181b4a449ed9fd70e962e96ee9e6b646a503334ea61bf3b
|
|
| MD5 |
014559d5f5be98b2519d789267e8f690
|
|
| BLAKE2b-256 |
d903539e61b9bb31465a1e202a9d5ade090ed95f5bc812a69f637439da1f2282
|