Skip to content

samudraneel05/TripWhat

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

62 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TripWhat 🌍✈️

AI-powered travel planner built with Model Context Protocol (MCP), LangGraph, and intelligent agents. Now with LLM-based intent detection and 10+ integrated tools!

πŸ†• What's New

  • 🧠 LLM-Based Intent Detection: 90%+ accuracy vs keyword matching
  • πŸ”§ 10+ Tools: Web search, distance calculation, restaurant finder, and more
  • 🌐 Web Search: Real-time travel information from the web
  • πŸ“ Smart Routing: Calculate distances and multi-stop routes
  • 🍽️ Restaurant Search: Find dining options by cuisine and location
  • πŸ“Š Unified Tool Registry: Easy to add new capabilities
  • 🎯 Better Understanding: Handles natural language variations

See Full Phase 1.5 Details


Architecture

tripwhat/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ agents/
β”‚   β”‚   β”‚   β”œβ”€β”€ travel-agent.ts      # Main LangGraph agent
β”‚   β”‚   β”‚   β”œβ”€β”€ intent-detector.ts   # πŸ†• LLM-based intent detection
β”‚   β”‚   β”‚   β”œβ”€β”€ tool-registry.ts     # πŸ†• Unified tool management
β”‚   β”‚   β”‚   └── prompts.ts
β”‚   β”‚   β”œβ”€β”€ mcp-servers/
β”‚   β”‚   β”‚   β”œβ”€β”€ places/              # OpenTripMap integration (enhanced)
β”‚   β”‚   β”‚   β”œβ”€β”€ websearch/           # πŸ†• Web search tools
β”‚   β”‚   β”‚   └── transport/           # πŸ†• Distance & routing
β”‚   β”‚   β”œβ”€β”€ routes/           # Express routes
β”‚   β”‚   β”œβ”€β”€ models/           # MongoDB schemas
β”‚   β”‚   β”œβ”€β”€ services/         # Itinerary builder
β”‚   β”‚   └── controllers/      # Request handlers
β”‚   └── package.json
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Chat/         # Real-time chat interface
β”‚   β”‚   β”‚   β”œβ”€β”€ Map/          # Interactive map with pins
β”‚   β”‚   β”‚   └── ui/           # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Chat.tsx      # Main chat page
β”‚   β”‚   β”‚   β”œβ”€β”€ OnboardingPage.tsx
β”‚   β”‚   β”‚   └── LoginPage.tsx
β”‚   β”‚   β”œβ”€β”€ hooks/            # Custom React hooks
β”‚   β”‚   └── contexts/         # Auth & state management
β”‚   └── package.json
β”‚
└── docs/
    β”œβ”€β”€ PHASE1-COMPLETE.md
    β”œβ”€β”€ PHASE1.5-COMPLETE.md
    β”œβ”€β”€ GOOGLE-PLACES-SETUP.md  # πŸ†• Google Maps setup guide
    β”œβ”€β”€ ROADMAP.md
    └── SETUP.md

## Tech Stack

**Frontend**: 
- React 18 + TypeScript
- TailwindCSS for styling
- Socket.io-client for real-time updates
- Axios for API calls

**Backend**: 
- Node.js + Express
- Socket.io for WebSocket
- LangGraph for agent orchestration
- MongoDB + Mongoose
- OpenAI GPT-4o-mini

**MCP Tools**:
- OpenTripMap (tourist attractions, POIs)
- OpenStreetMap (geocoding, no API key)
- DuckDuckGo (web search, no API key)
- Custom tools (distance, routing)

---

## πŸš€ Quick Start

### Prerequisites
- Node.js 18+
- MongoDB (Community Edition)
- OpenAI API key

### Installation

```bash
# Clone repository
git clone https://github.com/Tanish-237/TripWhat.git
cd TripWhat

# Backend setup
cd backend
npm install

# Create .env file
cp .env.example .env
# Add your API keys (see below)

# Frontend setup
cd ../frontend
npm install

# Create frontend .env
cp .env.example .env

Environment Variables

Backend (.env):

# Required
OPENAI_API_KEY=sk-your-openai-key
MONGODB_URI=mongodb://localhost:27017/tripwhat
JWT_SECRET=your-secret-key

# Optional but recommended
OPENTRIPMAP_API_KEY=your-key  # Get free at https://opentripmap.io

# Server config
PORT=5000
FRONTEND_URL=http://localhost:5173

Frontend (.env):

VITE_API_URL=http://localhost:5000

# Optional: Google Places Autocomplete
VITE_GOOGLE_MAPS_API_KEY=your-google-maps-api-key

πŸ“ Note: Google Places Autocomplete is optional. If not configured, the app will use standard text input. See setup guide

Running the App

# Terminal 1: Start MongoDB
mongod

# Terminal 2: Start backend
cd backend
npm run dev

# Terminal 3: Start frontend  
cd frontend
npm run dev

Access the app: http://localhost:5173


✨ Features

  • Smart City Search: Google Places Autocomplete for destination selection
  • Chat-based Planning: Natural language trip planning
  • AI Agent: MCP tool integration with LangGraph orchestration
  • Budget-Aware Itineraries: Personalized day-by-day plans
  • Interactive Maps: Destination pins and route visualization
  • Multi-City Trips: Seamless multi-destination itineraries
  • Saved & Upcoming Trips: Organize and track your travel plans
  • Real-time Updates: WebSocket-powered live itinerary generation

Development roadmap

See ROADMAP.md for detailed feature breakdown.

About

AI Agent for trip planning made using LangGraph

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 66.8%
  • TypeScript 32.7%
  • Other 0.5%