Your intelligent travel companion that creates personalized trip itineraries using machine learning and real-time APIs
- Collaborative Filtering (Netflix-style) for destination recommendations
- Trained on 6,580+ real trip records from Kaggle dataset
- Item-based similarity using cosine similarity algorithm
- Personalized suggestions: "Users who visited X also visited Y"
- Flights: Live prices from Amadeus API (Cheapest, Fastest, Best Overall)
- Hotels: Real-time availability and pricing via Amadeus
- Activities: Google Places API integration with ratings and reviews
- Local Events: AI-discovered festivals, concerts, and cultural happenings
- LangChain ReAct Agent with Groq LLM (llama-3.1-8b-instant)
- Multi-step reasoning and tool selection
- Sequential question flow with form field suggestions
- Conversational memory for context-aware planning
- Trending destinations from real traveler patterns
- ML-powered activity recommendations from Kaggle data
- Budget-aware filtering and personalization
- Interactive destination carousel with live statistics
βββββββββββββββββββββββββββββββββββββββββββββββ
β USER INTERFACE (React) β
β β’ Chat Interface β’ Trending Carousel β
β β’ Trip Planner β’ My Saved Trips β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββββββββββΌβββββββββββββββββββββββββββ
β LANGCHAIN ORCHESTRATOR (Groq LLM) β
β β’ ReAct Pattern β’ Tool Selection β
β β’ Multi-step Execution β’ Error Handling β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
ββββββββββββ΄βββββββββββ
β β
βββββββββΌββββββββββ βββββββββΌββββββββββββββ
β ML MODELS β β LIVE APIs β
β (Offline) β β (Real-time) β
βββββββββββββββββββ€ βββββββββββββββββββββββ€
β β’ Collaborative β β β’ Amadeus Flights β
β Filtering β β β’ Amadeus Hotels β
β β’ Kaggle Data β β β’ Google Places β
β Analysis β β β’ Event Discovery β
βββββββββββββββββββ βββββββββββββββββββββββ
- ONE Trip Planner Agent with LangChain orchestration
- 5 Specialized Tools: FlightPlanner, HotelPlanner, ActivityRecommender, DestinationRecommender, LocalEventsDiscoverer
- Python 3.9+
- Node.js 16+
- MongoDB Atlas account (optional - works without it)
- API Keys: Amadeus, Groq, Google Places (optional)
git clone https://github.com/Neharor/tripmate.git
cd tripmatecd backend
# Install dependencies
pip3 install -r requirements.txt
# Create .env file
cp .env.example .env
# Add your API keys to .env:
# GROQ_API_KEY=your_groq_api_key
# AMADEUS_CLIENT_ID=your_amadeus_client_id
# AMADEUS_CLIENT_SECRET=your_amadeus_client_secret
# GOOGLE_PLACES_API_KEY=your_google_places_key (optional)
# MONGODB_URI=your_mongodb_uri (optional)
# Start backend server
python3 main.pyBackend runs on: http://localhost:5002
cd frontend/trimate-frontend
# Install dependencies
npm install
# Start development server
npm startFrontend runs on: http://localhost:3000
- Framework: Flask (Python)
- AI/ML: LangChain, scikit-learn, pandas, numpy
- LLM: Groq API (llama-3.1-8b-instant)
- APIs: Amadeus (flights/hotels), Google Places (activities)
- Database: MongoDB Atlas (optional)
- Memory: In-process conversation storage
- Framework: React 18
- UI Library: Material-UI (MUI)
- Carousel: Swiper
- HTTP Client: Axios
- Styling: CSS Modules
- Algorithm: Item-based collaborative filtering
- Similarity: Cosine similarity (sklearn)
- Dataset: 6,580 trip records, 25 destinations, 4,614 users
- Matrix Sparsity: 94.4% (realistic for travel data)
User: "Plan a 5-day trip to Bangkok for food lovers, budget $100/day"
- Extracts entities: destination (Bangkok), duration (5 days), interests (food), budget ($100)
- Identifies missing information (departure city, travel dates)
- Asks sequential questions with form suggestions
Thought: User wants Bangkok trip, need to find flights
Action: FlightPlanner
Action Input: "Delhi to Bangkok, 5 days, Dec 15-20"
Thought: Now need accommodation
Action: HotelPlanner
Action Input: "Bangkok hotels, food lovers, $100/day budget"
Thought: Need activities for food culture
Action: ActivityRecommender
Action Input: "Bangkok food activities, 5 days"
Thought: Check local events during trip
Action: LocalEventsDiscoverer
Action Input: "Bangkok events Dec 15-20"
# Collaborative filtering finds similar destinations
similar_destinations = cf_model.get_similar_destinations('Bangkok')
# Returns: Phuket (85% similar), Chiang Mai (72% similar)...- Day-by-day plan with morning/afternoon/evening activities
- Flight options (Cheapest, Fastest, Best Overall)
- Hotel recommendations at different price tiers
- Local events happening during travel dates
- Budget breakdown
# User-Item Matrix (Binary: 1 = visited, 0 = not visited)
User | Bali | Tokyo | Paris | Bangkok | ...
------|------|-------|-------|---------|----
U001 | 1 | 0 | 1 | 0 | ...
U002 | 1 | 1 | 0 | 1 | ...
U003 | 0 | 1 | 1 | 0 | ...
# Cosine Similarity Matrix (Destination Γ Destination)
Bali Tokyo Paris Bangkok
Bali 1.000 0.245 0.189 0.312
Tokyo 0.245 1.000 0.234 0.289
Paris 0.189 0.234 1.000 0.198
Bangkok 0.312 0.289 0.198 1.000Model Statistics:
- Training Data: 6,580 trip records
- Destinations: 25 popular locations
- Users: 4,614 synthetic travelers
- Avg Similarity: 0.029 (distinct destination clusters)
- Sparsity: 94.4%
Recommendation Methods:
get_similar_destinations()- Find destinations similar to queryrecommend_for_interests()- Interest-based with CF enhancementget_user_recommendations()- Personalized based on past trips
tripmate/
βββ backend/
β βββ agents/ # AI Agents
β β βββ langchain_orchestrator.py # Main LangChain agent
β β βββ langchain_tools.py # Tool definitions
β β βββ destination.py # ML-powered recommendations
β β βββ flight.py # Amadeus flight integration
β β βββ stays.py # Hotel recommendations
β β βββ activities.py # Activity suggestions
β β βββ local_events.py # Event discovery
β βββ ml/ # Machine Learning
β β βββ collaborative_filter.py # CF recommender
β β βββ kaggle_trending.py # Trending analysis
β β βββ kaggle_activities.py # Activity patterns
β βββ services/ # External Services
β β βββ api_clients.py # Amadeus API client
β β βββ activities_service.py # Google Places integration
β β βββ flight_service.py # Flight search logic
β βββ routes/ # API Routes
β β βββ auth_routes.py # Authentication
β β βββ trip_routes.py # Trip CRUD
β β βββ trending.py # Trending destinations
β βββ memory/ # Conversation Memory
β β βββ conversation_memory.py # In-memory storage
β βββ database/ # Database
β β βββ models.py # MongoDB models
β βββ main.py # Flask app entry point
β
βββ frontend/
βββ trimate-frontend/
βββ src/
β βββ components/ # React Components
β β βββ ChatInterface.js # Main chat UI
β β βββ DestinationCarousel.js # Trending carousel
β β βββ FlightCard.js # Flight display
β β βββ HotelCard.js # Hotel display
β β βββ ActivityCard.js # Activity display
β βββ styles/ # CSS Styles
β βββ App.js # Main app component
β βββ MyTrips.js # Saved trips view
βββ package.json
# Required
GROQ_API_KEY=your_groq_api_key_here
AMADEUS_CLIENT_ID=your_amadeus_client_id
AMADEUS_CLIENT_SECRET=your_amadeus_client_secret
# Optional (Enhances features)
GOOGLE_PLACES_API_KEY=your_google_places_key
MONGODB_URI=mongodb+srv://user:pass@cluster.mongodb.net/tripmate_db
# Optional (Additional APIs)
GETYOURGUIDE_API_KEY=your_getyourguide_key
VIATOR_API_KEY=your_viator_key- Amadeus: See
GETTING_REAL_FLIGHTS.md(FREE tier available) - Google Places: See
GOOGLE_PLACES_SETUP.md(28,000 requests/month FREE) - Groq: Visit https://console.groq.com (FREE tier available)
| Component | Data Source | Type | Status |
|---|---|---|---|
| Destinations | Collaborative Filtering (Kaggle) | ML Model | β Active |
| Trending | Kaggle Trip Dataset (6,580 records) | Historical Data | β Active |
| Flights | Amadeus API | Live API | β Active |
| Hotels | Amadeus API | Live API | β Active |
| Activities | Google Places API + Kaggle Patterns | Hybrid | β Active |
| Events | Groq LLM (Cultural Calendar) | AI-Generated | β Active |
# Example: Find destinations similar to Bali
cf_recommender.get_similar_destinations('Bali', top_n=5)
# Returns:
# 1. Phuket, Thailand - 85% match
# 2. Maldives - 78% match
# 3. Krabi, Thailand - 72% match# Amadeus API returns 3 options
flights = flight_service.search_flights(
origin='DEL',
destination='BKK',
dates='2025-12-15 to 2025-12-20'
)
# Returns: Cheapest, Fastest, Best OverallBot: "Where would you like to go?" β Destination autocomplete
User: "Bangkok"
Bot: "Where will you be flying from?" β City autocomplete
User: "Delhi"
Bot: "How long do you want to stay?" β Days slider (1-90)
User: "5 days"
Bot: "What's your budget?" β Budget slider ($20-$1000/day)
User: "$100/day"
Bot: "What are your interests?" β Multi-select tags
User: [Food, Culture, Nightlife]
β Complete itinerary generated
- Live data from 6,580+ trip records
- Displays: Trip count, avg budget, best time to visit
- Interactive cards with ratings and reviews
- Click to auto-populate trip planner
POST /api/generate # Main chat endpoint
GET /api/trending-destinations # ML-powered trending
POST /api/trips # Save trip
GET /api/trips # Get user trips
DELETE /api/trips/:id # Delete trip
GET /api/locations/popular # Popular destinations
GET /api/locations/search # Search destinations
curl -X POST http://localhost:5002/api/generate \
-H "Content-Type: application/json" \
-d '{
"query": "Bangkok food culture 5 days $100 per day from Delhi",
"session_id": "user123"
}'cd backend
python3 ml/collaborative_filter.pypython3 ml/kaggle_trending.py# Terminal 1: Start backend
cd backend && python3 main.py
# Terminal 2: Test trending API
curl http://localhost:5002/api/trending-destinations | jqContributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Kaggle for travel dataset (6,580 trip records)
- Amadeus for flight and hotel APIs
- Google Places for activity data
- Groq for ultra-fast LLM inference
- LangChain for agent orchestration framework
Neha Arora - @Neharor
Project Link: https://github.com/Neharor/tripmate
- Add more ML models (price prediction, sentiment analysis)
- Implement user authentication with JWT
- Add real-time chat with WebSockets
- Create mobile app (React Native)
- Integrate more travel APIs (Skyscanner, Booking.com)
- Add multi-language support
- Implement Redis for production memory
Made with β€οΈ using AI, ML, and Real-Time APIs