Note: All code in this guide uses the official HydraDB TypeScript SDK. Base URL: https://api.hydradb.com. Get your API key at app.hydradb.com.
Prerequisites
Required knowledge: TypeScript/JavaScript basics, REST APIs, environment variablesRequired tools:
- HydraDB API key
- Node.js 18+ (
node --version) npm install @hydradb/sdk
What You’ll Build
By the end of this cookbook, you’ll be able to:- Upload hotel, flight, restaurant, and activity data into HydraDB with correct database scoping
- Answer complex natural language travel queries like “Plan a 5-day romantic trip to Italy for $3000” using
querywithmode: "thinking" - Store per-user travel preferences and booking history as AI memories for personalized recommendations
- Build family, business, and adventure trip planning flows using semantic search
The Problem with Traditional Travel Planning
Traditional travel platforms force users to think like search engines:- Keyword matching: “Hotels in Paris” or “Flights to Tokyo”
- Filter-heavy interfaces: Complex combinations of dates, prices, and amenities
- Manual research: Hours spent comparing options across multiple sites
- Generic recommendations: One-size-fits-all suggestions that ignore personal preferences
- Fragmented experience: Separate searches for flights, hotels, activities, and restaurants
The AI-Powered Solution
With HydraDB, travelers can plan naturally and get personalized recommendations:- “Plan a 5-day romantic trip to Italy for my anniversary in September with a budget of $3000”
- “Find me a family-friendly resort in Bali with a kids club and water sports activities”
- “I want to experience authentic local cuisine in Bangkok: suggest restaurants and food tours”
- “Plan a solo backpacking trip through Southeast Asia for 3 weeks, focusing on cultural experiences”
- “Find pet-friendly accommodations in San Francisco with easy access to dog parks”
Architecture Overview
Step 1: Travel Data Ingestion Strategy
1.1 Hotel and Accommodation Data
Start by uploading hotel and accommodation data as app knowledge:1.2 Flight and Transportation Data
Upload flight schedules, routes, and transportation options:1.3 Restaurant and Dining Data
Upload restaurant information with cuisine types and reviews:1.4 Activity and Attraction Data
Upload tourist attractions, activities, and experiences:Step 2: Building the AI Travel Assistant
2.1 Natural Language Query Processing
Create a travel query handler that understands complex travel requests:2.2 Personalized Recommendation Engine
Implement AI memories to remember user preferences and past travel patterns:Step 3: Advanced Search Capabilities
3.1 Semantic Search for Travel Experiences
Implement semantic search to understand complex travel desires:3.2 Multi-Modal Travel Search
Support different types of travel queries:Step 4: Real-World Implementation Examples
4.1 Family Vacation Planning
User Query: “Plan a 7-day family vacation to Orlando with kids aged 8 and 12, budget $4000, we love theme parks and want kid-friendly restaurants”4.2 Business Travel Optimization
User Query: “I need to travel to London for business next week, find hotels near financial district with good WiFi and meeting rooms”4.3 Adventure Travel Planning
User Query: “I want to go trekking in Nepal for 2 weeks, suggest routes for intermediate hikers with cultural experiences”Step 5: Contextual Recommendations
5.1 Weather-Based Suggestions
5.2 Cultural Event Integration
Step 6: Learning from User Behavior
6.1 Booking Pattern Analysis
6.2 Search Refinement
Advanced Features
Multi-Language Support
Real-Time Price Monitoring
HydraDB does not watch prices. Store the alert rule as a memory so later queries find it, and run the price checks in your own scheduled job.Example User Interactions
Scenario 1: Spontaneous Weekend Trip
User: “I want to go somewhere warm this weekend, budget $800, flying from New York” AI Response: Based on your budget and preference for warm weather, I recommend:- Miami, Florida: 3-day weekend package with beachfront hotel and flights for $750
- Austin, Texas: Music and food scene with boutique hotel for $680
- Savannah, Georgia: Historic charm with B&B accommodation for $620
Scenario 2: Anniversary Celebration
User: “Plan a romantic anniversary trip to Paris for 5 days in May, we love art museums and fine dining” AI Response: For your romantic Paris anniversary:- Accommodation: Hotel des Grands Boulevards in the 2nd arrondissement
- Day 1: Louvre Museum morning, Seine river cruise evening
- Day 2: Musée d’Orsay, dinner at L’Ambroisie (Michelin 3-star)
- Day 3: Montmartre walking tour, Picasso Museum
- Day 4: Versailles day trip, romantic dinner at Le Meurice
- Day 5: Rodin Museum, farewell lunch at L’Atelier de Joël Robuchon
Scenario 3: Solo Adventure Planning
User: “I’m planning a solo backpacking trip through Southeast Asia for a month, focusing on cultural immersion and budget-friendly options” AI Response: Your month-long Southeast Asia adventure:- Route: Thailand to Vietnam to Cambodia to Laos
- Budget: $2,000-2,500 total
- Accommodation: Mix of hostels and homestays
- Cultural experiences: Cooking classes, temple visits, local festivals
- Transportation: Buses and trains for authentic experience
Integration with Booking Systems
HydraDB returns only what you ingested and does not call booking APIs. Use these queries to find matching listings, then get live availability and prices from your booking provider.Real-Time Availability Checking
Dynamic Pricing Integration
Conclusion
An AI travel planner built on HydraDB turns hours of research into a conversation. With memories, thinking-mode retrieval, and semantic search, your platform can understand what a traveler is asking for and personalize what it returns. Key benefits of this approach:- Natural Language Understanding: Users can express complex travel desires in natural language
- Personalized Recommendations: AI memories ensure recommendations improve over time
- Contextual Awareness: Multi-step reasoning considers all aspects of travel planning
- Booking Integration: Pair HydraDB results with live availability and prices from your booking provider
