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
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
|