An intelligent travel recommendation platform leveraging Neo4j knowledge graphs, Snowflake data warehouse, and LLM-powered natural language interfaces.
This system uses triple validation methodology to extract and validate travel data, creating a comprehensive knowledge graph of Massachusetts attractions. It combines Graph RAG (Retrieval-Augmented Generation) with LLMs to provide personalized travel recommendations and intelligent query capabilities.
- πΊοΈ Knowledge Graph: 57,877 nodes, 55,131+ relationships across 352 cities
- π€ AI-Powered Chat: Natural language travel assistant using Graph RAG
- π¬ Cypher Generation: Convert natural language to Neo4j queries
- π Travel Insights: Analytics and visualizations
- π Day Trip Planner: Interactive itinerary builder with maps
- π User Authentication: Secure login and trip management
Traditional travel recommendation systems using Vector RAG rely on document embeddings and semantic similarity, which often lose crucial relationship information. Our system leverages Graph RAG for superior performance:
- β Uses document embeddings
- β Retrieves by semantic similarity
- β Loses relationship structure
- β Fuzzy, imprecise matches
- β Can't traverse connections efficiently
- β Uses structured entities and relationships
- β Retrieves by graph traversal
- β Preserves relationship structure
- β Exact, precise matches
- β Natural multi-hop queries
Travel planning is fundamentally about relationships:
- Which attractions are near each other?
- Which restaurants are within walking distance from museums?
- Which cities contain specific types of attractions?
- What's the optimal route between multiple locations?
Graph RAG excels at these queries because it preserves the spatial, categorical, and hierarchical relationships between entities. For example:
// Find restaurants within 2km of Boston museums
MATCH (m:Museum)-[:LOCATED_IN]->(c:City {name: 'Boston'})
MATCH (r:Restaurant)-[:LOCATED_IN]->(c)
WHERE point.distance(m.location, r.location) < 2000
RETURN r.name, m.name, point.distance(m.location, r.location) as distanceThis type of spatial relationship query is impossible with traditional vector RAG but natural with Graph RAG.
- Frontend: Streamlit
- Graph Database: Neo4j (Knowledge Graph)
- Data Warehouse: Snowflake (User data, LLM hosting)
- AI/ML: Snowflake Cortex (Mistral-Large2), LangChain
- Visualization: Plotly
- Cities: 352
- Attractions: 19,883
- Total Nodes: 57,877
- Relationships: 55,131+
- Node Types: Restaurant, Park, Museum, Beach, Historic, Theatre, and more
- Python 3.10+
- Neo4j Database
- Snowflake Account
- Git
For detailed setup instructions, see:
- π Quick Setup Guide - 5-minute setup
- π Deployment Guide - Complete deployment instructions
- Clone the repository
git clone https://github.com/Hotragn/TravelGraph-AI.git
cd TravelGraph-AI- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
pip install -r requirements.txt- Set up credentials
- Copy your Snowflake private key (
rsa_key.p8) to a secure location - Create
.streamlit/secrets.tomlwith your credentials (see QUICK_SETUP.md)
Example .streamlit/secrets.toml:
[neo4j]
uri = "your-neo4j-uri"
username = "your-username"
password = "your-password"
[snowflake]
account = "your-account"
user = "your-user"
warehouse = "COMPUTE_WH"
database = "TRAVEL_DB"
schema = "PUBLIC"
role = "ACCOUNTADMIN"
private_key_path = "path/to/your/rsa_key.p8"- Run the application
streamlit run app.pyTravel-Recommend/
βββ app.py # Main application entry point
β
βββ pages/ # Streamlit pages (6 pages)
β βββ 1_π _Dashboard.py # User dashboard
β βββ 2_π¬_Travel_Assistant.py # AI chat interface
β βββ 3_π‘_KG_Assistant.py # Knowledge graph explorer
β βββ 4_π€_AI_Cypher_Chat.py # Natural language to Cypher
β βββ 5_π_Travel_Insights.py # Analytics & visualizations
β βββ 6_π
_Day_Trip_Planner.py # Interactive trip planner
β
βββ src/ # Core application modules
β βββ connections.py # Database connection management
β βββ graph_rag.py # Graph RAG engine
β
βββ utils/ # Utility functions
β βββ __init__.py
β βββ auth_utils.py # User authentication
β βββ llm_utils.py # LLM integration & Cypher generation
β βββ neo4j_utils.py # Neo4j helper functions
β βββ settings_manager.py # Application settings
β βββ visualization.py # Graph visualization utilities
β
βββ sql/ # SQL scripts for Snowflake
β βββ create_user_trips_table.sql
β βββ insert_sample_users_and_trips.sql
β βββ verify_sample_data.sql
β βββ verify_saved_trips.sql
β
βββ config/ # Configuration & setup scripts
β βββ generate_keys.py # Generate RSA keys
β βββ generate_snowflake_keys.ps1 # PowerShell key generation
β βββ generate_password_hashes.py # Password hash generator
β
βββ tests/ # Test files
β βββ test_auth.py # Authentication tests
β βββ test_password_verification.py
β
βββ docs/ # Documentation
β βββ TECHNICAL_DOCUMENTATION.md # Complete technical docs
β βββ PROJECT_MANAGEMENT.md # Team & project management
β βββ NEO4J_SCHEMA_REFERENCE.md # Knowledge graph schema
β βββ QUERY_RESULTS_SUMMARY.md # Query examples
β βββ MANUAL_KEY_SETUP.md # Key setup guide
β βββ SNOWFLAKE_KEYPAIR_SETUP.md # Snowflake auth setup
β βββ SNOWFLAKE_SETUP_GUIDE.md # Snowflake configuration
β
βββ .streamlit/ # Streamlit configuration
β βββ secrets.toml # Credentials (not in repo)
β
βββ Frontend Wireframe References/ # UI design references
β
βββ .gitignore # Git ignore rules
βββ README.md # This file
βββ requirements.txt # Python dependencies
Building this system presented several technical challenges that required innovative solutions:
Challenge: Missing or incomplete attraction data from OpenStreetMap APIs.
- Missing URLs, descriptions, and operating hours
- Inconsistent data formats across different sources
- Null values and incomplete address information
Solution:
- Implemented triple validation methodology combining multiple data sources
- Created fallback mechanisms using LLM-generated summaries for missing descriptions
- Built robust data cleaning pipelines to handle nulls and standardize formats
Challenge: Ensuring LLM-generated Cypher queries were syntactically valid and semantically correct.
- Complex spatial queries using
point.distance() - Multi-hop relationship traversals
- Handling ambiguous natural language inputs
Solution:
- Fine-tuned prompts with Neo4j schema context and relationship patterns
- Implemented query validation layer with error handling
- Created comprehensive example set for few-shot learning
- Added fallback mechanisms for query failures
Challenge: Balancing context window size with relevant information retrieval.
- Knowledge graph has 57,877 nodes - too large for direct LLM context
- Need to retrieve relevant subgraphs without overwhelming the model
- Maintaining conversation history while adding graph context
Solution:
- Developed smart subgraph extraction based on query intent
- Implemented tiered retrieval (entity β relationships β neighbors)
- Created context pruning strategies to stay within token limits
Challenge: Efficient proximity-based queries across thousands of locations.
point.distance()calculations on 19,883+ attractions- Real-time route optimization for day trip planning
- Handling varying distance units and coordinate systems
Solution:
- Optimized Neo4j spatial indexes
- Implemented query result caching for common patterns
- Pre-computed distances for frequently accessed routes
This project was developed as part of a graduate-level course on LLMs and Knowledge Graphs.
Team Members:
- Hotragn - Lead Developer (Research, Triple Validation, Graph RAG, AI Integration)
- Tirdesh - Backend Engineer (Snowflake, Authentication, Data Processing)
- Amantha - Frontend Developer (UI/UX, Visualizations, All 6 Pages)
Timeline:
- Phase 1 (Sep 15 - Oct 22): Research & Triple Validation Implementation
- Phase 2 (Oct 23 - Nov 10): End-to-End System Development
- Phase 3 (Nov 11 - Dec 11): Testing & Refinement
- Phase 4 (Dec 12): Final Presentation
- π Comprehensive Project Documentation - START HERE!
- What we built (in simple language)
- Why we built it (problems solved)
- How we built it (step-by-step)
- Research insights & future scope
- Academic references (APA 7 format)
- Technical Documentation - Complete system architecture and design
- Project Management - Team roles, timeline, and Git workflow
- Neo4j Schema Reference - Knowledge graph schema
- Setup Guides - Configuration and deployment guides
Explore comprehensive visualizations and analysis of our knowledge graph structure:
-
9 Publication-Quality Visualizations
- Entity-relationship matrix heatmap
- Node distribution charts
- Geographic distribution maps
- Advanced Plotly visualizations (radar, sunburst, treemap, bubble charts)
-
Comprehensive Statistics
- 57,877 nodes across 300+ entity types
- 156,877 relationships across 58 types
- 352 cities with 19,883 attractions
- Detailed breakdown by category and location
-
Interactive Analysis
- Hierarchical structure visualization (State β City β Attraction)
- City diversity analysis (attraction count vs. type diversity)
- Relationship flow diagrams
- All data exported to CSV for reproducibility
Generated from real Neo4j data using Python (matplotlib, seaborn, plotly).
- Python 3.14
- Streamlit 1.40.2 - Web framework
- Neo4j 5.x - Graph database
- Snowflake - Data warehouse & LLM hosting
- LangChain 0.3.13 - LLM framework
- Plotly 5.24.1 - Visualizations
- Pandas 2.2.3 - Data processing
- β Implemented triple validation for data extraction
- β Built comprehensive knowledge graph with 57,877 nodes
- β Developed Graph RAG engine for contextual AI responses
- β Created dynamic Cypher query generation from natural language
- β Implemented spatial proximity queries (point.distance)
- β Built 6 fully functional interactive pages
- β Achieved 95%+ accuracy in entity extraction through validation
- β Reduced query response time through optimized graph traversal
Important: Never commit sensitive files to the repository:
.streamlit/secrets.toml- Contains database credentials*.pem,*.key- RSA private keys.envfiles - Environment variables
These are already excluded in .gitignore.
This project is licensed under the MIT License - see below for details.
MIT License
Copyright (c) 2025 Hotragn, Tirdesh, Amantha
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- Research based on LLM KG papers on triple validation methodology
- Neo4j for graph database technology
- Snowflake for Cortex LLM integration
- OpenStreetMap for attraction data
- Course instructors and peers for valuable feedback
For questions or collaboration:
- GitHub: Hotragn
- Email: pettugani.h@northeastern.edu
- Project Team: Hotragn, Tirdesh, Amantha
Last Updated: December 2025
Version: 2.0.0
Status: β
Production Ready