Getting Started with Swarm Squad Episode II β
Welcome to Swarm Squad Episode II: The Digital Dialogue, a modern multi-agent system framework featuring real-time communication, enhanced user interfaces, and advanced chatbot capabilities for seamless human-AI collaboration.
What is Swarm Squad Episode II? β
Swarm Squad Episode II is an advanced simulation framework that extends the Swarm Squad ecosystem with modern web technologies and real-time communication capabilities. The framework features:
- π¬ Real-time Communication: WebSocket-based messaging for instant agent interactions
- π Modern Web Interface: Built with Next.js, TypeScript, and Tailwind CSS
- π€ Enhanced Chatbot Integration: Advanced AI-powered chat capabilities
- π Full-stack Architecture: Separate frontend and backend for scalability
- π Interactive Dashboards: Real-time visualization and monitoring
- π Live Updates: Real-time data synchronization across all components
- π― User-Centric Design: Intuitive interface for seamless user experience
- π οΈ Developer-Friendly: Comprehensive CLI tools and development utilities
Quick Start β
For most users, getting started with Swarm Squad Episode II is as simple as:
# Install Swarm Squad Episode II
uv pip install swarm-squad-ep2
# Launch the application
swarm-squad-ep2
swarm-squad-ep2 --help
That's it! The application will start both the backend and frontend, and you can begin exploring modern multi-agent systems.
Prerequisites β
For basic usage, you only need:
- uv: For package installation and management (recommended)
Installing uv β
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
Installation β
Option 1: Install from PyPI (Recommended) β
The simplest way to install Swarm Squad Episode II is directly from PyPI:
# Install the package using uv
uv pip install swarm-squad-ep2
Option 2: Development Installation β
For contributors, developers, or if you want to modify the framework:
Additional Prerequisites for Development:
- Node.js v18 or higher: For the frontend application (recommended: install via nvm)
- pnpm: For Node.js frontend dependencies (recommended)
- git: For cloning the repository
Install Node.js and pnpm for Development β
# Install nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
# Install and use Node.js 18
nvm install 18
nvm use 18
# Install pnpm globally
npm install -g pnpm
Development Setup β
# Clone the repository
git clone https://github.com/Sang-Buster/Swarm-Squad-Ep2
cd Swarm-Squad-Ep2
# Create and activate virtual environment
uv venv --python 3.10
source .venv/bin/activate # On Linux/macOS
# Or: .venv\Scripts\activate # On Windows
# Install in development mode
uv pip install -e .
Running Swarm Squad Episode II β
Using the CLI Interface β
After installation, you can use the comprehensive CLI interface:
# Show all available commands
swarm-squad-ep2 --help
Available Commands β
Launch Complete Application β
# Launch both backend and frontend together
swarm-squad-ep2 launch
Run Components Individually β
# Run FastAPI backend server (default port 8000)
swarm-squad-ep2 fastapi
# Run FastAPI backend on custom port
swarm-squad-ep2 fastapi --port 8080
# Run Next.js frontend (default port 3000)
swarm-squad-ep2 webui
# Run frontend on custom port
swarm-squad-ep2 webui --port 3001
Development and Simulation Commands β
# Install frontend dependencies (development only)
swarm-squad-ep2 install
# Build frontend for production (development only)
swarm-squad-ep2 build
# Run vehicle simulation components
swarm-squad-ep2 sim
# Run with matplotlib visualization
swarm-squad-ep2 sim visualize
# Run WebSocket test client
swarm-squad-ep2 sim test
Development Setup β
If you're planning to develop or extend Swarm Squad Episode II:
Install Development Dependencies β
# Install development dependencies
uv pip install -e .
Development Workflow β
# Install frontend dependencies for development
swarm-squad-ep2 install
# Build frontend for production
swarm-squad-ep2 build
# Launch the complete application
swarm-squad-ep2 launch
Project Structure β
Understanding the Swarm Squad Episode II file structure will help you navigate and extend the framework:
π Swarm-Squad-Ep2
β£ π lib/ # Project media/assets
β β£ π banner.png
β β π screenshot.png
β£ π src/
β β π¦ swarm_squad_ep2/ # Python package
β β£ π api/ # FastAPI backend
β β β£ π routers/ # Route handlers (REST + WS)
β β β β£ π batch.py # Batch job endpoints
β β β β£ π llms.py # LLM-facing routes
β β β β£ π realtime.py # WebSocket / SSE endpoints
β β β β£ π veh2llm.py # VehicleβLLM bridge routes
β β β β π vehicles.py # Vehicle CRUD/telemetry routes
β β β£ π static/ # Static files (favicon, small assets)
β β β β π favicon.ico
β β β£ π templates/ # Jinja2 templates
β β β β π index.html
β β β£ π database.py # DB session/engine + init
β β β£ π main.py # FastAPI app entrypoint
β β β£ π models.py # Pydantic/ORM models
β β β π utils.py # Shared backend helpers
β β£ π cli/ # Command-line tools
β β β£ π build.py # Build/package helpers
β β β£ π fastapi.py # Start API server CLI
β β β£ π install.py # Dev/install helpers
β β β£ π launch.py # One-shot launcher
β β β£ π sim.py # Run simulations via CLI
β β β£ π utils.py # CLI utilities
β β β π webui.py # Launch frontend from CLI
β β£ π scripts/ # Standalone scripts
β β β£ π utils/
β β β β£ π client.py # HTTP/WebSocket client helpers
β β β β π message_templates.py # Prompt/message templates
β β β£ π run_simulation.py # Scripted sim runner
β β β£ π simulator.py # Simulation engine
β β β£ π test_client.py # Quick API/WS tests
β β β π visualize_simulation.py # Simple plotting/vis tools
β β£ π web/ # Next.js frontend
β β β£ π app/ # Next.js (App Router) entry
β β β β£ π globals.css
β β β β£ π layout.tsx
β β β β π page.tsx
β β β£ π components/ # React components (incl. ui/)
β β β β£ π ui
β β β β£ π category-header.tsx
β β β β£ π chat.tsx
β β β β£ π emoji-picker.tsx
β β β β£ π message-input.tsx
β β β β£ π sidebar.tsx
β β β β£ π theme-provider.tsx
β β β β π theme-toggle.tsx
β β β£ π hooks/ # Frontend hooks
β β β β£ π use-mobile.tsx
β β β β£ π use-toast.ts
β β β β π use-websocket.ts
β β β£ π lib/ # Frontend utils
β β β β£ π api.ts
β β β β£ π mock-data.ts # Dev-only
β β β β π utils.ts
β β β£ π public/
β β β β π favicon.ico
β β β£ π next.config.mjs
β β β£ π package.json
β β β£ π tailwind.config.ts
β β β£ π postcss.config.mjs
β β β£ π tsconfig.json
β β β π pnpm-lock.yaml
β β π main.py # Package-level entry
β£ π pyproject.toml # Python project config
β£ π uv.lock # Python deps lock
β£ π README.md # Overview and quickstart
β£ π LICENSE # License
β£ π .python-version # Python toolchain pin
β£ π .pre-commit-config.yaml # Lint/format hooks
β π .gitignore # Ignore rules
Key Components β
Swarm Squad Episode II includes several modern components for enhanced user experience:
Frontend Architecture β
- Next.js Framework: Server-side rendering and modern React features
- TypeScript: Type-safe development for better code quality
- Tailwind CSS: Utility-first styling for responsive design
- Real-time Communication: WebSocket integration for live updates
Backend Architecture β
- FastAPI: High-performance Python web framework
- WebSocket Support: Real-time bidirectional communication
- RESTful API: Standard HTTP endpoints for data operations
- Integration Layer: Connects to Swarm Squad simulation engine
CLI Tools β
The CLI provides comprehensive commands for different workflows:
launch
: Complete application startupfastapi
: Backend server managementwebui
: Frontend development serversetup
: Vehicle simulation and testinginstall
: Development dependency managementbuild
: Production build process
First Application Launch β
Once you have Swarm Squad Episode II installed, you can launch your first session:
Launch the Application:
bashswarm-squad-ep2 launch
Access the Web Interface: Open your browser and navigate to
http://localhost:3000
Explore the Features:
- User authentication and account management
- Real-time chat interface
- Interactive dashboards
- Live data visualization
- WebSocket communication status
Test the API: The backend API documentation is available at
http://localhost:8000/docs
Vehicle Simulation β
Swarm Squad Episode II includes vehicle simulation capabilities:
# Run basic vehicle simulation
swarm-squad-ep2 sim
# Run simulation with matplotlib visualization
swarm-squad-ep2 sim visualize
# Test WebSocket connections
swarm-squad-ep2 sim test
Configuration β
The application behavior can be configured through various methods:
- Environment Variables: Set in
.env
files for both frontend and backend - Configuration Files: Modify settings in respective config files
- CLI Parameters: Pass options like
--port
to customize server settings - Runtime Settings: Adjust settings through the web interface
Next Steps β
Now that you have Swarm Squad Episode II installed and running, explore these areas:
- Architecture: Understand the full-stack system design
- Configuration: Learn about customization options and settings
- Demo: Try out example scenarios and use cases
- API Documentation: Explore the backend API at
http://localhost:8000/docs
- Community: Join the Swarm Squad community for support and collaboration
Troubleshooting β
If you encounter issues during installation or setup:
Common Issues β
- Python Version: Ensure you're using Python 3.10 or higher
- Port Conflicts: Check if ports 3000 and 8000 are available, or use custom ports
- Dependencies: Run
uv pip install -e .
again if you encounter import errors - WebSocket Issues: Ensure WebSocket connections are not blocked by firewalls
Getting Help β
- Check the error messages for specific guidance
- Review the logs in the terminal output
- Ensure all prerequisites are correctly installed
- Use
swarm-squad-ep2 --help
to see all available commands - Visit the project's GitHub repository for issue tracking and community support
Development Issues β
- Use
swarm-squad-ep2 install
to ensure frontend dependencies are installed - Use
swarm-squad-ep2 build
to create production builds - Verify that both frontend and backend are running properly
- Check the browser console for frontend errors
With Swarm Squad Episode II properly installed and configured, you're ready to explore modern multi-agent systems with real-time communication and enhanced user interfaces!