https://github.com/swarajjadhav12/multi-agent-spacex
Multi-agent system using public APIs (SpaceX, OpenWeatherMap) to plan, enrich, and analyze tasks based on user goals.
https://github.com/swarajjadhav12/multi-agent-spacex
ai-system automation multi-agent openai planning spacex spacex-api weather
Last synced: about 1 month ago
JSON representation
Multi-agent system using public APIs (SpaceX, OpenWeatherMap) to plan, enrich, and analyze tasks based on user goals.
- Host: GitHub
- URL: https://github.com/swarajjadhav12/multi-agent-spacex
- Owner: swarajjadhav12
- Created: 2025-06-13T18:23:12.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-06-13T18:43:48.000Z (12 months ago)
- Last Synced: 2025-06-13T19:39:26.098Z (12 months ago)
- Topics: ai-system, automation, multi-agent, openai, planning, spacex, spacex-api, weather
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ๐ Multi-Agent AI System Using Google ADK
A multi-agent AI system that takes a user goal, plans task routing, and coordinates agents to fulfill the goal using real-time data and public APIs. Built in Python with modular, chainable agents.
## ๐ Table of Contents
- [Features](#-features)
- [Architecture](#-architecture-overview)
- [Setup](#-setup-instructions)
- [Usage](#-usage)
- [Development](#-development)
- [Testing](#-testing)
- [API Documentation](#-api-documentation)
- [Contributing](#-contributing)
- [License](#-license)
## โจ Features
- ๐ค **Modular Agent System**: Each agent is independent and chainable
- ๐ฑ **Android Device Integration**: Seamless communication with Android devices using Google ADK
- ๐ **Real-time Data**: Integration with SpaceX and Weather APIs
- ๐ **Task Planning**: Intelligent task routing based on user goals
- ๐ **Logging & Monitoring**: Comprehensive logging system for debugging and monitoring
- ๐งช **Evaluation Framework**: Built-in test cases and evaluation system
- ๐ **Error Handling**: Robust error handling and recovery mechanisms
## ๐ง Architecture Overview
### Core Components
- **PlannerAgent**: Parses user goals and determines agent execution order
- **SpaceXAgent**: Fetches data about upcoming SpaceX launches
- **WeatherAgent**: Retrieves weather data for specific locations
- **DelayAnalyzerAgent**: Analyzes weather conditions for launch delays
- **ADKAgent**: Manages communication with Android devices
### System Flow
```mermaid
graph TD
A[User Goal] --> B[PlannerAgent]
B --> C[SpaceXAgent]
C --> D[WeatherAgent]
D --> E[DelayAnalyzerAgent]
E --> F[Final Result]
B --> G[ADKAgent]
G --> H[Android Device]
```
## ๐ง Setup Instructions
### Prerequisites
- Python 3.8 or higher
- Android device with USB debugging enabled
- Google ADK development kit
- OpenWeatherMap API key
### Installation
1. **Clone the Repository**
```bash
git clone
cd
```
2. **Create Virtual Environment**
```bash
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
```
3. **Install Dependencies**
```bash
pip install -r requirements.txt
```
4. **Environment Setup**
Create a `.env` file in the root directory:
```env
OPENWEATHER_API_KEY=your_api_key_here
```
## โถ๏ธ Usage
### Running the System
```bash
python main.py
```
The system offers three modes:
1. **Manual Mode**: Run with predefined goals
2. **ADK Tasks**: Execute Android device-specific tasks
3. **Evaluations**: Run test cases and evaluations
### Example Goals
1. **SpaceX Launch Check**
```
"Find the next SpaceX launch, check weather at that location, then summarize if it may be delayed."
```
2. **Android Device Communication**
```
"Connect to Android device and send test data"
```
## ๐ป Development
### Project Structure
```
.
โโโ agents/ # Agent implementations
โ โโโ base_agent.py # Base agent class
โ โโโ planner_agent.py # Task planning agent
โ โโโ spacex_agent.py # SpaceX data agent
โ โโโ weather_agent.py # Weather data agent
โ โโโ delay_analyzer.py # Delay analysis agent
โโโ core/ # Core system components
โ โโโ agent_manager.py # Agent coordination
โ โโโ google_adk_manager.py # ADK integration
โโโ evals/ # Test cases and evaluations
โโโ android_app/ # Android application code
โโโ main.py # Main entry point
โโโ requirements.txt # Project dependencies
```
### Adding New Agents
1. Create a new agent class inheriting from `BaseAgent`
2. Implement the required `run()` method
3. Add the agent to the planner's task recognition
4. Update test cases if necessary
## ๐งช Testing
### Running Tests
```bash
python main.py --mode 3 # Run evaluation mode
```
### Test Cases
Test cases are defined in `evals/test_cases.json`:
```json
{
"goal": "Find next SpaceX launch",
"expected_keys": ["launch_data", "weather_data", "delay_analysis"]
}
```
## ๐ API Documentation
### SpaceX API
- **Base URL**: `https://api.spacexdata.com/v4`
- **Endpoint**: `/launches/next`
- **Authentication**: None required
- **Rate Limits**: No official limits
### OpenWeatherMap API
- **Base URL**: `https://api.openweathermap.org/data/2.5`
- **Endpoint**: `/weather`
- **Authentication**: API Key required
- **Rate Limits**: 60 calls/minute (free tier)
### Google ADK
- **Protocol**: USB
- **Requirements**: Android device with USB debugging
- **Features**: Bidirectional communication
## ๐ค Contributing
1. Fork the repository
2. Create a feature branch
3. Commit your changes
4. Push to the branch
5. Create a Pull Request
### Development Guidelines
- Follow PEP 8 style guide
- Add type hints to all functions
- Include docstrings for all classes and methods
- Write tests for new features
- Update documentation as needed
## ๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
## ๐ Troubleshooting
### Common Issues
1. **ADK Connection Issues**
- Ensure USB debugging is enabled
- Check USB cable connection
- Verify device drivers are installed
2. **API Rate Limits**
- Implement caching for API responses
- Use exponential backoff for retries
- Monitor API usage
3. **Logging**
- Check `app.log` for detailed error information
- Enable debug logging for more verbose output
## ๐ Support
For support, please:
1. Check the troubleshooting guide
2. Review the documentation
3. Open an issue on GitHub
4. Contact the development team