🚀 Multi-Agent Launch Analysis System A Python-based multi-agent system that analyzes SpaceX launches by coordinating multiple specialized agents to gather and process real-time information about upcoming launches, weather conditions, and related news.
📌 Overview This system takes a natural language goal (e.g., "Find next SpaceX launch, check weather, assess delay") and coordinates multiple agents to: 1️⃣ Find the next SpaceX launch details 2️⃣ Check weather conditions at the launch site 3️⃣ Analyze relevant news articles 4️⃣ Provide a comprehensive analysis of potential launch delays
🧠 Agent Flow The system consists of four specialized agents, each with a defined role:
- 🗺️ Planner Agent Parses natural language goals Creates execution plans Coordinates between other agents Handles iterations if goals aren't met
- 🚀 SpaceX Agent Fetches launch data from SpaceX API Provides mission details Extracts launch site coordinates
- 🌦️ Weather Agent Retrieves weather data from OpenWeatherMap Analyzes launch conditions Predicts delay probability
- 📰 News Agent Searches for launch-related news Analyzes articles for delay indicators Provides context about potential issues
💻 Installation 1️⃣ Clone the repository
git clone <repository-url>
cd <repository-name>2️⃣ Install dependencies
pip install -r requirements.txt3️⃣ Set up API keys
Create a .env file in the project root and add your credentials:
OPENWEATHERMAP_API_KEY=your_key_here
NEWSAPI_API_KEY=your_key_here
⚠️ Note: the variable name must beNEWSAPI_API_KEY(notNEWS_API_KEY) — this matches whatutils.pylooks up viaload_api_key('NEWSAPI').
🌐 API Setup
☁️ OpenWeatherMap
Sign up at OpenWeatherMap
Get your API key and add to .env
📰 NewsAPI
Sign up at NewsAPI
Add your API key to .env
🚀 SpaceX API
No key required
Uses public API: https://api.spacexdata.com
🧩 Usage
python main.pyYou'll be prompted to enter a goal, e.g.:
Please enter your goal (e.g., 'Check if next SpaceX launch will be delayed'):
> Find next SpaceX launch, check weather at that location, then summarize if it may be delayed
Example Output
Mission: Starlink 6-1
Launch Date: 2026-07-12T14:30:00Z
Launch Site: Kennedy Space Center
Weather Conditions: Clear
Delay Probability: 10%
Summary: Launch likely to proceed as scheduled. Weather conditions are
favorable with clear skies and moderate winds. No delay indicators found
in recent news.
🧾 Running Evaluations Run test evaluations:
python run_eval.pyExample Output:
Evaluation Summary:
Total tests: 2
Passed: 1
Failed: 1
Failed Tests:
evals/eval2.json:
- weather.delay_probability: Value mismatch (expected 0.8, got 0.75)
- news.articles[0].title: Value mismatch
🗂️ Project Structure
.
├── main.py # Entry point
├── planner_agent.py # Goal planning and coordination
├── weather_agent.py # Weather data processing
├── spacex_agent.py # SpaceX launch data
├── news_agent.py # News analysis
├── utils.py # Helper functions
├── .env # Environment variables (not committed)
├── requirements.txt # Dependencies
└── evals/ # Evaluation examples
├── eval1.json
└── eval2.json
🧩 Error Handling The system ensures reliability through: API call retries with exponential backoff Response validation Environment variable checks Detailed logging
🪵 Logging Logs follow this format:
2026-07-07 10:00:00,123 - agent_name - INFO - Message