AI Travel Recommendation App

GitHub:

Value statement: Serverless full-stack application delivering personalized travel recommendations using AWS Bedrock and Claude 3 Sonnet with GraphQL API and Cognito authentication.

Overview

Built a serverless travel recommendation app leveraging AWS Bedrock’s Claude 3 Sonnet for intelligent destination suggestions. Users input interests and receive personalized travel recommendations with destinations, activities, and itineraries.

The application demonstrates modern cloud-native architecture: React/TypeScript frontend hosted on AWS Amplify, AWS AppSync GraphQL API, Lambda functions for AI inference, and Amazon Cognito for authentication. Fully serverless design with Git-based CI/CD workflow.

Architecture

AI Travel App Architecture Additional Image

Technology Stack

LayerTechnologies
FrontendReact 18, TypeScript, Vite, Amplify UI
AuthenticationAmazon Cognito (Amplify Auth)
APIAWS AppSync (GraphQL)
BackendAWS Lambda
AI/MLAWS Bedrock (Claude 3 Sonnet)
HostingAWS Amplify (CloudFront + S3)
CI/CDAWS Amplify Git-based workflow

Implementation Details

AWS Bedrock + Claude 3 Sonnet: Lambda function invokes Bedrock with prompt engineering for travel recommendations:

response = bedrock_runtime.invoke_model(
modelId='anthropic.claude-3-sonnet-20240229-v1:0',
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"messages": [{"role": "user", "content": prompt}],
"max_tokens": 2000
})
)

AWS AppSync GraphQL API:

React/TypeScript Frontend:

Amazon Cognito (Amplify Auth):

Amplify CI/CD: Git-based workflow with automatic deployments on push to main, preview environments for PRs, and global CDN distribution.

Features

Performance & Cost

MetricValue
Response Time2-4 seconds (Bedrock inference)
Concurrent Users1000+ (Lambda auto-scaling)
Monthly Cost~$15-30 (low usage)
Bedrock Cost$0.015 per 1000 input tokens

Lessons Learned

Prompt engineering is critical: Initial prompts produced verbose, unstructured responses. Iterative refinement with output format specifications improved quality significantly.

Claude 3 Sonnet vs Haiku: Started with Haiku for cost savings but switched to Sonnet for better reasoning. Cost increase (2x) justified by quality improvement.

Amplify simplifies DevOps: Compared to manual CloudFront/S3/Lambda setup, Amplify reduced deployment complexity by 80% while providing preview environments and atomic deployments.

Future Improvements