Live Demo β’ Documentation β’ API Reference β’ Contributing
Transform your travel dreams into detailed, personalized itineraries powered by cutting-edge AI.
AI Travel Planner is a production-grade, self-improving travel planning application powered by Groq's Llama 3.1 70B, Streamlit, and PostgreSQL. It automatically generates itineraries and learns from user feedback to continuously improve.
- π§ Self-Improving AI β learns from user ratings
- ποΈ Dual Storage Architecture β PostgreSQL + JSON backups
- β‘ Real-time Auto-Training β database triggers
- π Cloud-Native Deployment
- π° Smart, AI-powered budgeting
- πΈ High-quality images (Unsplash)
- π Real analytics dashboard
- π Production-ready architecture
|
|
|
|
|
|
The app learns automatically using PostgreSQL triggers that prepare training samples whenever high-quality itineraries are detected.
graph LR A[User Rates Itinerary] --> B[Update Quality Score] B --> C[PostgreSQL Trigger] C --> D{Quality >= 4.0?} D -->|Yes| E[Mark as Training Sample] E --> F{Count >= 3?} F -->|Yes| G[Trigger Training Cycle] G --> H[Model Improvement] H --> A
yaml Copy code
- Zero manual intervention
- Real-time learning
- Threshold-based training cycles
- Automated data collection
| Primary Storage (PostgreSQL) | Backup Storage (JSON) |
|---|---|
| High-performance queries | Easy inspection |
| ACID compliant | Disaster-proof |
| Analytics-ready | Portable backups |
| Referential integrity | Dev-friendly |
Sync Logic:
- Every write β JSON backup
- Timestamped archives
- Easy rollback
USER ββ> Streamlit Cloud ββ> Streamlit App β +-------+---------+ | | Groq API Neon PostgreSQL β β βββββ Unsplash API (Images)
yaml Copy code
| Technology | Purpose |
|---|---|
| Streamlit | UI |
| Markdown | Content |
| HTML/CSS | Styling |
| Technology | Purpose |
|---|---|
| Python 3.11 | Core |
| LangChain | LLM chains |
| Groq API | AI inference |
| psycopg2 | PostgreSQL driver |
| ReportLab | PDF export |
| Technology | Purpose |
|---|---|
| PostgreSQL 17 | Primary DB |
| Neon | Cloud hosting |
| JSON | Backups |
| Service | Purpose |
|---|---|
| Groq | AI inference |
| Unsplash | Photos |
| Google Maps | Links & embeds |
- Python 3.11+
- pip
- Git
Optional: - PostgreSQL 17+
git clone https://github.com/ShadyNights/ai-travel-planner.git
cd ai-travel-planner
2. Create Virtual Environment
Windows
bash
Copy code
python -m venv venv
.\venv\Scripts\activate
macOS/Linux
bash
Copy code
python3 -m venv venv
source venv/bin/activate
3. Install Dependencies
bash
Copy code
pip install -r requirements.txt
4. Setup Environment
bash
Copy code
cp .env.example .env
Edit .env and add API keys.
5. Setup Database (Optional)
bash
Copy code
python setup_database.py
6. Run App
bash
Copy code
streamlit run app.py
π Usage Guide
Generate Your First Itinerary
Go to Generate Itinerary
Enter:
Destination
Duration
Budget
Interests
Travel style
Click Generate
View:
Daily plans
Photos
Maps
Budget report
Export PDF
Rating & Training the AI
Open Rate & Train
Choose itinerary
Rate 1β5 stars
Optionally add text
Submit β Added to training pipeline
ποΈ Project Structure
arduino
Copy code
ai-travel-planner/
β app.py
β requirements.txt
β README.md
β .env.example
β Dockerfile
β setup.py
β
βββ src/
β βββ config/
β βββ core/
β βββ chains/
β βββ database/
β βββ utils/
β
βββ data/
β βββ archive/
β
βββ .streamlit/
β βββ config.toml
β
βββ scripts/
βββ sql/
π API Reference
TravelPlanner Usage
python
Copy code
from src.core.planner import TravelPlanner
planner = TravelPlanner()
itinerary = planner.generate_itinerary({
"destination": "Tokyo, Japan",
"duration": 7,
"budget_level": "moderate",
"interests": ["culture", "food"],
})
π Data Management
Quick Stats
bash
Copy code
python check_cloud_stats.py
Full Data Manager
bash
Copy code
python data_manager.py
π Deployment
Streamlit Cloud Deployment
Push repo to GitHub
Go to Streamlit Cloud
Connect repo
Add secrets
Deploy
Docker
bash
Copy code
docker build -t ai-travel-planner .
docker run -p 8501:8501 ai-travel-planner
π€ Contributing
We welcome contributions!
Steps
bash
Copy code
git clone https://github.com/YOUR-USERNAME/ai-travel-planner.git
git checkout -b feature/my-feature
Follow PEP8, include type hints, write tests.
πΊοΈ Roadmap
v1.1 (Next 2 Weeks)
User authentication
Weather integration
Currency converter
v2.0 (1β2 Months)
Mobile app
Booking integrations
v3.0 (3β6 Months)
Fine-tuned custom models
Voice/AR features
π Performance Benchmarks
Metric Value
Itinerary Gen 15β20s
PDF Export 2s
Photo Loading 2β3s
π Security
Env vars for all secrets
SSL everywhere
Parameterized SQL
No credential leaks
π License
MIT β see LICENSE
π Acknowledgments
Built with:
Streamlit
LangChain
Groq
Neon DB
Unsplash
ReportLab
<div align="center">
Made with β€οΈ by ShadyNights
β If you like this project, please star it!
β¬ Back to Top
</div> ```
β
ALSO READY-TO-PASTE SUPPORT FILES
π LICENSE
text
Copy code
MIT License
Copyright (c) 2025 ShadyNights
Permission is hereby granted, free of charge, to any person obtaining a copy...
(Full MIT text included exactly as required.)
π CONTRIBUTING.md
markdown
Copy code
# Contributing to AI Travel Planner
Thank you for your interest in contributing!
## Code of Conduct
Be respectful, inclusive, and professional.
## How to Contribute
1. Fork repo
2. Create branch
3. Commit changes
4. Push
5. Open PR
## Style Guidelines
- PEP8
- Type hints
- Docstrings
- Small, focused functions
## Testing
- Add tests for new features
- Ensure all tests pass
π .env.example
text
Copy code
# Groq API
GROQ_API_KEY=your_groq_api_key_here
# PostgreSQL
USE_POSTGRES=true
DATABASE_URL=postgresql://user:password@host.neon.tech/database?sslmode=require
# Unsplash API (optional)
UNSPLASH_ACCESS_KEY=your_unsplash_access_key_here