Skip to main content

A centralized hub for multi-agent code creation, enhancement, and deployment

Project description

Agent Control Hub

CI/CD Pipeline Python 3.8+ License: MIT Code style: black Streamlit

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

  1. Clone the repository:

    git clone https://github.com/Dzg0507/AgentHub.git
    cd AgentHub
    
  2. Create a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. 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 .env file:

    # 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.bat or run scripts/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 project
  • GET /projects - List all projects
  • GET /projects/{id} - Get project details
  • DELETE /projects/{id} - Delete a project
  • GET /projects/{id}/download - Download project as ZIP
  • GET /projects/{id}/files - List project files
  • GET /projects/{id}/logs - Get execution logs
  • POST /projects/{id}/retry - Retry project processing
  • POST /projects/{id}/force-scaffold - Force create minimal scaffold
  • POST /projects/{id}/venv - Create virtual environment
  • POST /projects/{id}/setup - Run setup commands

System

  • GET / - Root endpoint with server info
  • GET /health - Health check
  • GET /ui - Built-in web interface
  • GET /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]
  1. ๐Ÿ“ Create Project: Submit a prompt describing what you want to build
  2. โœจ Prompt Enhancement: AI enhances your prompt with technical requirements
  3. ๐Ÿ“‹ File Planning: AI creates a structured file plan for the project
  4. ๐Ÿ’ป Code Generation: AI generates complete, runnable code
  5. ๐Ÿ”ง Environment Setup: Virtual environment and dependencies are configured
  6. ๐Ÿงช Testing: Generated code is tested for functionality
  7. ๐Ÿš€ Deployment: Project is packaged and ready for deployment
  8. ๐Ÿ“ฆ 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_HOST and SERVER_PORT: Server binding address
  • WORKSPACE_DIR: Directory for generated projects
  • TEMP_TTL_MINUTES: Project retention time
  • LLM_CONFIG: Language model configuration
  • SUPPORTED_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

  1. Add language to SUPPORTED_LANGUAGES in core/config.py
  2. Update _write_language_scaffold() in services/pipeline.py
  3. Add setup commands in setup_project() function
  4. Update language selector in streamlit_app.py

Adding New Agents

  1. Define agent in agents/factory.py
  2. Add agent to the returned dictionary
  3. Use agent in pipeline functions in services/pipeline.py

๐Ÿ› Troubleshooting

Common Issues

  1. Import Errors: Ensure all dependencies are installed and virtual environment is activated
  2. API Key Issues: Verify API keys are set in .env file
  3. Port Conflicts: Change SERVER_PORT in core/config.py if port 8000 is in use
  4. File Generation Failures: Use the "Force Scaffold" button to create minimal files
  5. Memory Issues: Reduce TEMP_TTL_MINUTES to clean up old projects

Logs

  • Server logs: logs/agent_hub.log
  • Project execution logs: Available via /projects/{id}/logs endpoint
  • Streamlit logs: Check terminal output
  • CI/CD logs: Available in GitHub Actions tab

Getting Help

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Quick Contribution Steps

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests if applicable
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. 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

๐Ÿ“Š 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

#\x00 \x00T\x00e\x00s\x00t\x00 \x00t\x00r\x00i\x00g\x00g\x00e\x00r\x00 \x00 \x00

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_control_hub-1.0.0.tar.gz (91.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_control_hub-1.0.0-py3-none-any.whl (44.2 kB view details)

Uploaded Python 3

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

Hashes for agent_control_hub-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6158f0a9bca4821b461fce1d754fae0d60f1b1f9d67fc573b4482f0d919faf01
MD5 2ddbf59a774e51b3baf0efb2ae554502
BLAKE2b-256 8228f7db757e244abd9fd800e9e19db9305490b165fbd52d3277c6275200886a

See more details on using hashes here.

File details

Details for the file agent_control_hub-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_control_hub-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cdf72fc57d56f174181b4a449ed9fd70e962e96ee9e6b646a503334ea61bf3b
MD5 014559d5f5be98b2519d789267e8f690
BLAKE2b-256 d903539e61b9bb31465a1e202a9d5ade090ed95f5bc812a69f637439da1f2282

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page