Uses Docker to orchestrate and run PostgreSQL and Neo4j database containers for the trip planner application.
Integrates with Google's Gemini AI API for natural language processing, query analysis, and intelligent agent orchestration in the multi-agent chatbot system.
Provides links to Google Maps for location-based trip planning and navigation as part of comprehensive travel recommendations.
Enables execution of Cypher queries against Neo4j graph database for querying employee organizational data and hierarchical relationships.
Implements the MCP server, agents, and chatbot functionality using Python 3.10+ for trip planning orchestration and database interactions.
Includes TripAdvisor resource links in trip recommendations for discovering attractions, restaurants, and travel reviews.
Trip Planner MCP PoC
This is a Proof of Concept for a Trip Planner application using the Model Context Protocol (MCP), Postgres, and Neo4j. It demonstrates how an Orchestrator Agent can coordinate with specialized agents (Team, Food, Travel) to answer complex queries.
Prerequisites
Docker Desktop: Ensure Docker is installed and running.
Python 3.10+: Ensure Python is installed.
Setup
Start the Databases: Open a terminal in this folder and run:
docker-compose up -dThis will start Postgres (port 5432) and Neo4j (ports 7474, 7687).
Create Virtual Environment:
python -m venv venv # Windows venv\Scripts\activate # Mac/Linux # source venv/bin/activateInstall Dependencies:
pip install -r requirements.txtConfigure Environment Variables: Copy
.env.exampleto.envand add your API keys:# Windows copy .env.example .env # Mac/Linux # cp .env.example .envEdit
.envand add:GOOGLE_API_KEY: Get from https://makersuite.google.com/app/apikeyOPENWEATHER_API_KEY: Get from https://openweathermap.org/api (free tier)
Seed Neo4j Data: The Postgres data is seeded automatically. For Neo4j, run this script once:
python src/db_utils.py
Running the Application
Option 1: Test Trip Recommendations Tool
Test the new trip recommendations tool with real-time weather data:
Option 2: Orchestrator (Simulated)
Run the hardcoded orchestrator to see the agent workflow without an API key:
Option 3: Chatbot (Single Agent)
Run the interactive chatbot (requires Google API Key):
Create a
.envfile in the root folder:GOOGLE_API_KEY=your-gemini-api-key OPENWEATHER_API_KEY=your-openweather-api-keyGet free OpenWeather API key from: https://openweathermap.org/api (1000 calls/day free)
Run the chatbot:
python src/chatbot.py
Option 4: A2A Chatbot (Multi-Agent System) ✨ RECOMMENDED
Run the advanced multi-agent system where an Orchestrator coordinates with specialized Team, Food, and Travel agents:
Ensure
.envhas yourGOOGLE_API_KEYandOPENWEATHER_API_KEY.Run the A2A chatbot:
python src/a2a_chatbot.py
Features:
🤖 Intelligent Agent Orchestration: Automatically routes queries to specialized agents (Team, Food, Travel)
💬 Conversational Context: Maintains chat history across sessions (
chat_history.json)🔄 Parallel Processing: Multiple agents work together to provide comprehensive responses
🎯 Smart Query Understanding: Uses Gemini AI to analyze and decompose complex travel planning requests
🌐 Full MCP Integration: Seamless access to Neo4j, Postgres, Weather API, and Country Info API
The A2A chatbot is fully functional and provides the most advanced trip planning experience with multi-agent collaboration.
How it Works
Core Components
src/mcp_server.py: The MCP Server exposing multiple tools:run_cypher_query: Execute raw Cypher queries against Neo4j (employee org graph).run_sql_query: Execute raw SQL queries against Postgres (food preferences, trip data).get_trip_recommendations: Get comprehensive travel recommendations with real-time weather data, customizable preferences, dates, group size, and budget.get_country_info: Get country information (currency, languages) from RestCountries API.
src/orchestrator.py: Basic orchestrator with simulated agent workflow (no API key needed).src/a2a_chatbot.py: Advanced Multi-Agent System ✨Orchestrator Agent: Analyzes user queries and coordinates specialized agents
Team Agent: Handles employee data queries using Neo4j graph database
Food Agent: Manages food preferences and dietary requirements from Postgres
Travel Agent: Provides comprehensive trip planning with weather and location data
Intelligent Routing: Uses Gemini AI to determine which agents are needed for each query
Context Aware: Maintains conversation history and builds on previous interactions
Parallel Execution: Multiple agents can work simultaneously for complex queries
src/chatbot.py: Single-agent chatbot for basic interactions.
Project Structure
docker-compose.yml: Database configuration.data/: Initialization scripts for databases.src/: Source code.mcp_server.py: The MCP tool provider with database query tools.orchestrator.py: Basic orchestrator with simulated workflow.db_utils.py: Database connection helpers.a2a_chatbot.py: Advanced multi-agent chatbot system ✨ (Fully functional)chatbot.py: Single-agent chatbot for basic use.
test_trip_recommendations.py: Test script for trip recommendations tool.TRIP_RECOMMENDATIONS_GUIDE.md: Comprehensive guide for using trip recommendations.ARCHITECTURE.md: Detailed system architecture documentation.AGENT_UPDATES.md: Agent implementation updates and changes..env.example: Template for environment variables.
New Features
🌦️ Real-Time Weather Integration
The get_trip_recommendations tool now fetches live weather data from OpenWeatherMap API:
Current conditions and 5-day forecast
Temperature, humidity, wind speed
Weather-based packing tips
Automatic location geocoding
🎯 Smart Trip Planning
Customizable Preferences: adventure, food, culture, relaxation, shopping, nature
Group Travel Support: Tips for traveling with multiple people
Budget-Aware: Recommendations based on budget constraints
Date Flexibility: Auto-defaults to upcoming weekend if dates not specified
External Resources: Links to TripAdvisor, Google Maps, Booking.com, WikiTravel
📊 Example Queries You Can Try (A2A Chatbot)
Basic Trip: "Plan a weekend trip to Paris"
Detailed Planning: "Plan a 5-day adventure trip to Udaipur from 2025-12-20 to 2025-12-25 for 4 people with preferences: adventure, nature, food. Budget is 5000 INR per person"
Group Trip: "We are 8 friends planning a relaxation and shopping trip to Bali"
Team Outing: "Get my team members and plan a 3-day team outing to Goa considering everyone's food preferences"
Multi-Agent Query: "Who are the employees under Bob Chen and what are their food preferences? Plan a team dinner in San Francisco"
Complex Planning: "I want to organize a corporate retreat to Jaipur for 15 people next month with cultural activities"
🔧 Advanced Database Queries
run_cypher_query: Execute raw Cypher queries for complex Neo4j graph traversalsrun_sql_query: Execute raw SQL queries for flexible Postgres data retrievalFull schema documentation in tool descriptions
For detailed usage instructions, see TRIP_RECOMMENDATIONS_GUIDE.md.
This server cannot be installed