diff --git a/networks/smart-travel-network/.env.example b/networks/smart-travel-network/.env.example new file mode 100644 index 0000000..286496d --- /dev/null +++ b/networks/smart-travel-network/.env.example @@ -0,0 +1,8 @@ +# OpenRouter API Configuration +# Get your API key from: https://openrouter.ai/keys +OPENROUTER_API_KEY=YOUR_OPENROUTER_API_KEY + +# Instructions: +# 1. Copy this file to .env +# 2. Replace YOUR_OPENROUTER_API_KEY with your actual API key +# 3. Update all agent YAML files in agents/ folder with your key diff --git a/networks/smart-travel-network/.gitignore b/networks/smart-travel-network/.gitignore new file mode 100644 index 0000000..a22ac4b --- /dev/null +++ b/networks/smart-travel-network/.gitignore @@ -0,0 +1,7 @@ +__pycache__/ +*.pyc +.env +.venv +venv/ +*.log +openagents.log diff --git a/networks/smart-travel-network/Dockerfile b/networks/smart-travel-network/Dockerfile new file mode 100644 index 0000000..dc236e8 --- /dev/null +++ b/networks/smart-travel-network/Dockerfile @@ -0,0 +1,21 @@ +FROM ghcr.io/openagents-org/openagents:latest + +WORKDIR /app + +ENV PYTHONUNBUFFERED=1 + +# Install system dependencies (git/curl are usually needed) +RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/* + +# Copy project files (we don't need pip install as openagents is in the base image) +COPY . . + +# Make startup script executable +COPY start_zeabur.sh . +RUN chmod +x start_zeabur.sh + +# Expose the dashboard port +EXPOSE 8700 + +# Start the monolith +CMD ["./start_zeabur.sh"] diff --git a/networks/smart-travel-network/README.md b/networks/smart-travel-network/README.md new file mode 100644 index 0000000..52696f7 --- /dev/null +++ b/networks/smart-travel-network/README.md @@ -0,0 +1,51 @@ +# Smart Travel Network 🌍✈️ + +**A Multi-Agent System for Intelligent Travel Planning** + +> Submitted for the OpenAgents PR Hackathon + +## Overview +The **Smart Travel Network** is a centralized agent network designed to take a vague travel "vibe" or theme from a user and turn it into a concrete, actionable itinerary. It demonstrates the power of specialized agents collaborating in a pipeline. + +## Unique Value +Most travel bots just ask "Where do you want to go?". We ask **"How do you want to feel?"**. +* **Input**: "I want a cyberpunk aesthetics trip with great street food." +* **Output**: A complete breakdown of Tokyo/Seoul with specific neon-lit spots, food stalls, flights, and a daily schedule. + +## Agent Architecture +1. **🕵️ Destination Scout (`agent_a_scout`)**: + * Listens to specific user themes. + * Uses extensive knowledge to match "vibes" to real-world cities. +2. **✈️ Logistics Planner (`agent_b_logistics`)**: + * Receives the target city. + * Simulates searching for optimal flights and accommodation. +3. **🎡 Activities Coordinator (`agent_c_activities`)**: + * Finds unique, theme-aligned experiences (not just tourist traps). +4. **📅 Itinerary Master (`agent_d_master`)**: + * Synthesizes all data into a beautiful Markdown-formatted daily plan. + +## Setup & Run + +### Prerequisites +* OpenAgents v0.8.3+ +* A DeepSeek API Key (or compatible LLM key) + +### Installation +1. Clone this repository. +2. Navigate to `smart-travel-network`. +3. **IMPORTANT**: Open `agents/*.yaml` and paste your API key in the `api_key` field. + +### Running +Windows (PowerShell): +```powershell +./start_network.ps1 +``` + +### Usage +1. Connect to the network dashboard (default: `http://localhost:8700`). +2. Go to the **#user-input** channel. +3. Type a message like: `Theme: A quiet mountain retreat for reading and coffee.` +4. Watch the agents spring into action in the other channels! + +## License +MIT diff --git a/networks/smart-travel-network/agents/agent_a_scout.yaml b/networks/smart-travel-network/agents/agent_a_scout.yaml new file mode 100644 index 0000000..0e3bf84 --- /dev/null +++ b/networks/smart-travel-network/agents/agent_a_scout.yaml @@ -0,0 +1,46 @@ +# AgentA - Destination Scout +# Role: Suggests specific cities/countries based on abstract themes. + +type: "openagents.agents.collaborator_agent.CollaboratorAgent" +agent_id: "agent_a_scout" + +config: + model_name: "deepseek/deepseek-r1:free" + base_url: "https://openrouter.ai/api/v1" + api_key: "YOUR_OPENROUTER_API_KEY" + + instruction: | + You are the Destination Scout. + + 【Mission】 + Listen to #user-input for travel themes (e.g., "Relaxing beach with good food", "Cyberpunk vibes", "Historical Europe"). + Pick the SINGLE BEST real-world destination that matches that theme and post a research report to #location-research. + + 【Rules】 + - ONLY listen to #user-input. + - ONLY post to #location-research. + - Do not reply to other agents. + - Respond only once per theme. + + 【Output Format】 + **Destination Proposal** + Target: [City, Country] + Why: [One sentence explanation] + + ### Key Highlights + * [Highlight 1] + * [Highlight 2] + + react_to_all_messages: true + default_channels: + - "user-input" + - "location-research" + +mods: + - name: "openagents.mods.workspace.messaging" + enabled: true + +connection: + host: "localhost" + port: 8700 + transport: "http" diff --git a/networks/smart-travel-network/agents/agent_b_logistics.yaml b/networks/smart-travel-network/agents/agent_b_logistics.yaml new file mode 100644 index 0000000..3440296 --- /dev/null +++ b/networks/smart-travel-network/agents/agent_b_logistics.yaml @@ -0,0 +1,47 @@ +# AgentB - Logistics Planner +# Role: Suggests flights and hotels for the proposed destination. + +type: "openagents.agents.collaborator_agent.CollaboratorAgent" +agent_id: "agent_b_logistics" + +config: + model_name: "deepseek/deepseek-r1:free" + base_url: "https://openrouter.ai/api/v1" + api_key: "YOUR_OPENROUTER_API_KEY" + + instruction: | + You are the Logistics Planner. + + 【Mission】 + Listen to #location-research for a "Destination Proposal". + Generate realistic (mock) flight and hotel options for that destination and post to #logistics-plan. + + 【Rules】 + - ONLY listen to #location-research. + - ONLY post to #logistics-plan. + + 【Output Format】 + **Logistics Plan for [City]** + + ### Flights (Estimated) + * Option A: Direct ($800), 12h duration + * Option B: 1 Stop ($500), 18h duration + + ### Accommodation + * Luxury: [Name of real luxury hotel] + * Budget: [Name of real budget hostel/hotel] + * Unique: [Name of a boutique/unique stay] + + react_to_all_messages: true + default_channels: + - "location-research" + - "logistics-plan" + +mods: + - name: "openagents.mods.workspace.messaging" + enabled: true + +connection: + host: "localhost" + port: 8700 + transport: "http" diff --git a/networks/smart-travel-network/agents/agent_c_activities.yaml b/networks/smart-travel-network/agents/agent_c_activities.yaml new file mode 100644 index 0000000..ef1798b --- /dev/null +++ b/networks/smart-travel-network/agents/agent_c_activities.yaml @@ -0,0 +1,43 @@ +# AgentC - Activities Coordinator +# Role: Suggests fun things to do. + +type: "openagents.agents.collaborator_agent.CollaboratorAgent" +agent_id: "agent_c_activities" + +config: + model_name: "deepseek/deepseek-r1:free" + base_url: "https://openrouter.ai/api/v1" + api_key: "YOUR_OPENROUTER_API_KEY" + + instruction: | + You are the Activities Coordinator. + + 【Mission】 + Listen to #location-research for the destination. + Plan 3 distinct activities that fit the "Vibe" of the place. + Post to #activities. + + 【Rules】 + - ONLY listen to #location-research. + - ONLY post to #activities. + + 【Output Format】 + **Activity List** + + 1. **[Activity Name]**: [Description] + 2. **[Activity Name]**: [Description] + 3. **[Activity Name]**: [Description] + + react_to_all_messages: true + default_channels: + - "location-research" + - "activities" + +mods: + - name: "openagents.mods.workspace.messaging" + enabled: true + +connection: + host: "localhost" + port: 8700 + transport: "http" diff --git a/networks/smart-travel-network/agents/agent_d_master.yaml b/networks/smart-travel-network/agents/agent_d_master.yaml new file mode 100644 index 0000000..9e6badd --- /dev/null +++ b/networks/smart-travel-network/agents/agent_d_master.yaml @@ -0,0 +1,59 @@ +# AgentD - Itinerary Master +# Role: Compiles the final plan. + +type: "openagents.agents.collaborator_agent.CollaboratorAgent" +agent_id: "agent_d_master" + +config: + model_name: "deepseek/deepseek-r1:free" + base_url: "https://openrouter.ai/api/v1" + api_key: "YOUR_OPENROUTER_API_KEY" + + instruction: | + You are the Itinerary Master. + + 【Mission】 + You listen to #activities. When you see a new Activity List, you assume the Logistics Plan (in #logistics-plan) and Destination (in #location-research) are already sent. + + You must generate the **FINAL ITINERARY** by combining: + 1. The Destination (infer from activities/history) + 2. The Activities + 3. Safety Tips (from #safety-tips) + 4. Packing List (from #packing-list) + + (Wait for all these inputs or just aggregate what you see). + + 【Output Format】 + # FINAL TRAVEL ITINERARY + + ## The Trip + We are going to **[Destination]**! + + ## Daily Schedule + * **Day 1**: Arrival & Check-in. + * **Day 2**: [Activity 1] + * **Day 3**: [Activity 2] + * **Day 4**: [Activity 3] & Departure. + + ## Safety & Prep + * **Safety**: [Summary from Agent E] + * **Packing**: [Top 3 items from Agent F] + + ## Summary + Have a great trip! + + react_to_all_messages: true + default_channels: + - "activities" + - "safety-tips" + - "packing-list" + - "itinerary-output" + +mods: + - name: "openagents.mods.workspace.messaging" + enabled: true + +connection: + host: "localhost" + port: 8700 + transport: "http" diff --git a/networks/smart-travel-network/agents/agent_e_safety.yaml b/networks/smart-travel-network/agents/agent_e_safety.yaml new file mode 100644 index 0000000..41dc2b9 --- /dev/null +++ b/networks/smart-travel-network/agents/agent_e_safety.yaml @@ -0,0 +1,40 @@ +# AgentE - Safety Advisor +# Role: Provides safety warnings and emergency info. + +type: "openagents.agents.collaborator_agent.CollaboratorAgent" +agent_id: "agent_e_safety" + +config: + model_name: "deepseek/deepseek-r1:free" + base_url: "https://openrouter.ai/api/v1" + api_key: "YOUR_OPENROUTER_API_KEY" + + instruction: | + You are the Safety Advisor. + + 【Mission】 + Listen to #location-research. + Identify the destination and provide a safety briefing. + Post to #safety-tips. + + 【Output Format】 + **Safety Briefing for [City]** + + * **Safety Score**: [1-10] (10 is safest) + * **Emergency Number**: [Local Police/Ambulance ID] + * **Advisory**: [One sentence on any scams or areas to avoid] + * **Health**: [Vaccinations or water safety tips] + + react_to_all_messages: true + default_channels: + - "location-research" + - "safety-tips" + +mods: + - name: "openagents.mods.workspace.messaging" + enabled: true + +connection: + host: "localhost" + port: 8700 + transport: "http" diff --git a/networks/smart-travel-network/agents/agent_f_packing.yaml b/networks/smart-travel-network/agents/agent_f_packing.yaml new file mode 100644 index 0000000..b9233ea --- /dev/null +++ b/networks/smart-travel-network/agents/agent_f_packing.yaml @@ -0,0 +1,40 @@ +# AgentF - Packing Specialist +# Role: Creates a custom packing list. + +type: "openagents.agents.collaborator_agent.CollaboratorAgent" +agent_id: "agent_f_packing" + +config: + model_name: "deepseek/deepseek-r1:free" + base_url: "https://openrouter.ai/api/v1" + api_key: "YOUR_OPENROUTER_API_KEY" + + instruction: | + You are the Packing Specialist. + + 【Mission】 + Listen to #activities (because it implies the type of trip). + Generate a checklist of what to bring. + Post to #packing-list. + + 【Output Format】 + **Packing List** + + * **Clothing**: [3-4 items based on weather/activities] + * **Gear**: [Camera, adapters, snorkeling mask, etc.] + * **Documents**: [Visa requirements, Passport] + * **Don't Bring**: [Banned items or unnecessary things] + + react_to_all_messages: true + default_channels: + - "activities" + - "packing-list" + +mods: + - name: "openagents.mods.workspace.messaging" + enabled: true + +connection: + host: "localhost" + port: 8700 + transport: "http" diff --git a/networks/smart-travel-network/network.yaml b/networks/smart-travel-network/network.yaml new file mode 100644 index 0000000..6d8823f --- /dev/null +++ b/networks/smart-travel-network/network.yaml @@ -0,0 +1,58 @@ +network: + name: SmartTravelNetwork + mode: centralized + node_id: travel-planner-hub + transports: + - type: http + config: + port: 8700 + serve_studio: true + serve_mcp: true + serve_a2a: true + cors_allowed_origins: ["*"] + manifest_transport: http + recommended_transport: http + discovery_enabled: true + max_connections: 20 + message_routing_enabled: true + default_agent_group: guest + mods: + - name: openagents.mods.workspace.messaging + enabled: true + config: + default_channels: + - name: general + description: General chat for network status + - name: user-input + description: User enters travel themes here (e.g., "Cyberpunk Tokyo") + - name: location-research + description: AgentA posts detailed city/country info here + - name: logistics-plan + description: AgentB posts flight and hotel options here + - name: activities + description: AgentC posts local events and fun things to do + - name: safety-tips + description: AgentE posts safety warnings and embassy info + - name: packing-list + description: AgentF posts weather-dependent packing items + - name: itinerary-output + description: AgentD posts the final Markdown itinerary + max_thread_depth: 10 + initialized: true + +network_profile: + name: Smart Travel Planner + description: A team of agents that collaboratively builds a travel itinerary from a vague feeling or theme. + tags: + - Travel + - Lifestyle + - Multi-Agent + categories: + - planning + country: Worldwide + authentication: + type: none + host: 0.0.0.0 + port: 8700 +log_level: INFO +data_dir: ./data/smart-travel diff --git a/networks/smart-travel-network/start_network.ps1 b/networks/smart-travel-network/start_network.ps1 new file mode 100644 index 0000000..684021e --- /dev/null +++ b/networks/smart-travel-network/start_network.ps1 @@ -0,0 +1,33 @@ +# Start the Smart Travel Network +# Launches the Network Hub and 4 Agents in separate windows. + +Write-Host "Starting Smart Travel Network..." -ForegroundColor Cyan + +# 1. Start the Network Hub +Write-Host "Starting Network Hub..." +Start-Process -FilePath "openagents" -ArgumentList "launch-network ." -NoNewWindow:$false +# Give it a moment to bind to port 8700 +Start-Sleep -Seconds 5 + +# 2. Start Agents +$agents = @( + "agents/agent_a_scout.yaml", + "agents/agent_b_logistics.yaml", + "agents/agent_c_activities.yaml", + "agents/agent_d_master.yaml", + "agents/agent_e_safety.yaml", + "agents/agent_f_packing.yaml" +) + +foreach ($agent in $agents) { + Write-Host "Starting Agent: $agent" + Start-Process -FilePath "openagents" -ArgumentList "launch-agent $agent" -NoNewWindow:$false + Start-Sleep -Seconds 2 +} + +Write-Host "All components launched!" -ForegroundColor Green +Write-Host "---------------------------------------------------" +Write-Host "Dashboard: http://localhost:8700" +Write-Host "Action: Go to #user-input and type your travel theme!" +Write-Host "---------------------------------------------------" +Read-Host "Press Enter to exit this launcher (Agents will keep running)..." diff --git a/networks/smart-travel-network/start_zeabur.sh b/networks/smart-travel-network/start_zeabur.sh new file mode 100644 index 0000000..b5a8438 --- /dev/null +++ b/networks/smart-travel-network/start_zeabur.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +# Function to handle shutdown +cleanup() { + echo "Stopping agents..." + pkill -f openagents + exit 0 +} + +trap cleanup SIGINT SIGTERM + +echo "Starting Smart Travel Network on Zeabur..." + +# Handle Zeabur Dynamic Port +if [ ! -z "$PORT" ]; then + echo "Detected Zeabur PORT: $PORT" + sed -i "s/port: 8700/port: $PORT/g" network.yaml + sed -i "s/port: 8700/port: $PORT/g" agents/*.yaml +else + echo "No PORT var found, defaulting to 8700" +fi + +# 1. Launch Network Hub +# Run in background but pipe output to stdout so Zeabur sees it +echo "Starting Network Hub..." +openagents launch-network network.yaml & +HUB_PID=$! + +echo "Waiting 5 seconds for hub to warm up..." +sleep 5 + +# 2. Launch Agents +AGENTS=("agents/agent_a_scout.yaml" "agents/agent_b_logistics.yaml" "agents/agent_c_activities.yaml" "agents/agent_d_master.yaml" "agents/agent_e_safety.yaml" "agents/agent_f_packing.yaml") + +for agent in "${AGENTS[@]}"; do + echo "Starting Agent: $agent" + openagents launch-agent "$agent" & +done + +echo "System Running. Monitoring..." + +# DEBUG: Check if Studio is actually serving internally +echo "🔍 Checking internal Studio availability..." +curl -I http://localhost:$PORT/studio/ || echo "❌ curl failed on /studio/" +curl -I http://localhost:$PORT/ || echo "❌ curl failed on /" + +# Wait for any process to exit +wait -n + +# If one exits, kill the rest and exit +echo "A process has exited. Shutting down..." +cleanup