AWS Lambda Hackathon Submission - TimeBrew

Inspiration

I'm obsessed with Morning Brew - I read it religiously every day. Their witty, engaging writing style makes complex news digestible and actually fun to read. But here's what frustrated me: I love their voice, but I wanted it personalized to MY interests - AI breakthroughs, fintech innovations, emerging technologies.

Traditional news aggregators either lack personality or fail at true personalization. I realized that with AI and serverless architecture, I could solve both problems: deliver Morning Brew quality writing, but tailored to individual interests. Why settle for generic when AI can create content that feels like it was written specifically for you?

TimeBrew was born from this simple idea: combine the engaging voice of Morning Brew with intelligent, AI-powered personalization - all built on AWS Lambda for scalability and cost efficiency.

What it does

TimeBrew is an AI-powered personalized news curation platform that delivers Morning Brew-style briefings tailored to your exact interests. Users create "brews" - personalized news briefings focused on topics they care about (AI, fintech, healthcare, etc.), set their delivery time and timezone, then receive daily briefings that read like they were written by their favorite newsletter, but covering exactly what matters to them.

Key Features:

  • Intelligent Curation: AI searches and filters news based on user preferences and feedback history
  • Editorial AI: Transforms raw articles into engaging, Morning Brew-style content with personality
  • Smart Scheduling: Timezone-aware delivery system that respects global user preferences
  • Learning System: Improves personalization based on user feedback and engagement
  • Professional Email: Responsive HTML templates delivered via Amazon SES

The platform solves information overload by providing quality over quantity - instead of generic news feeds, users get carefully curated, personally relevant content delivered when they want it.

How we built it

Architecture: Pure serverless using AWS Lambda as the core compute service with 14+ Lambda functions across two architectural layers:

Core AI Pipeline (Event-Driven)

  • EventBridge Scheduler: Triggers every 15 minutes to check for due deliveries
  • Step Functions Orchestration: Manages 3-stage AI pipeline with error handling and retry logic
    • News Curator Lambda: Uses Perplexity Sonar API for real-time news search, applies user preferences and temporal context
    • News Editor Lambda: Transforms articles using OpenAI GPT-4 into Morning Brew-style content
    • Email Dispatcher Lambda: Converts JSON to HTML email templates, delivers via Amazon SES

RESTful API Layer

  • 11 Lambda Functions serving REST endpoints via API Gateway
  • User Management: Registration, authentication with AWS Cognito
  • Brew Management: CRUD operations for personalized news configurations
  • Content Access: Retrieve briefing history and analytics
  • Feedback System: Continuous learning from user interactions

Infrastructure

  • Serverless Framework: Complete Infrastructure as Code
  • PostgreSQL: External database for user data, run tracking, content logs
  • CloudWatch: Monitoring, logging, and error tracking
  • Multi-environment: Dev/prod deployments with environment-specific configurations

AI Integration: Configurable AI providers (OpenAI, Perplexity) with sophisticated prompt engineering for content curation and editorial voice consistency.

Challenges we ran into

AI Prompt Engineering

Spent countless hours crafting prompts that consistently produce Morning Brew-style voice while maintaining factual accuracy. Getting AI to follow constraints (article count, duplicate avoidance, temporal relevance) required extensive testing and iteration.

Timezone Complexity

Building a global scheduling system where users receive briefings at their local delivery time was surprisingly complex. Had to handle edge cases like daylight saving transitions, international date lines, and database UTC conversions.

Serverless Cold Starts

AI processing functions have longer execution times (up to 600 seconds). Optimizing memory allocation, connection pooling, and timeout management for cost efficiency while maintaining performance was challenging.

Step Functions Error Handling

Designing robust error recovery for the 3-stage AI pipeline. Each function can fail for different reasons (API limits, parsing errors, email delivery issues), requiring comprehensive retry logic and failure tracking.

Content Quality Consistency

Ensuring AI-generated content maintains high quality across different topics and news availability days. Building fallback strategies for "slow news days" and maintaining voice consistency across various subject matters.

Accomplishments that we're proud of

Production-Grade Serverless Architecture

Built a complete, scalable platform using serverless-first design principles. The system auto-scales from 0 to millions of users without server management overhead.

Multiple Lambda Trigger Patterns

Successfully implemented all major AWS Lambda trigger types:

  • EventBridge: Scheduled cron-based execution
  • API Gateway: REST API endpoints
  • Step Functions: Complex workflow orchestration
  • Manual: On-demand testing and debugging

Real AI Innovation

This isn't just API calls - developed sophisticated prompt engineering that consistently produces high-quality, personalized content. The AI understands user preferences, avoids repetition, and maintains editorial voice across topics.

Live Production Deployment

TimeBrew is deployed and functional at timebrew.news with:

  • Custom domain with SSL via CloudFront
  • Professional authentication flows
  • Real-time monitoring and error tracking
  • Cost-optimized infrastructure ($0.02 per briefing generated)

Comprehensive Observability

Built-in monitoring, logging, and error tracking across all Lambda functions. Every execution is tracked with performance metrics, enabling continuous optimization.

What we learned

Serverless Architecture Mastery

Learned to think in events rather than servers. Understanding when to use different trigger types, how to optimize for cold starts, and designing stateless functions fundamentally changed how I approach system architecture.

AI as a Development Partner

Discovered that AI isn't just a feature - it's a development methodology. Prompt engineering is becoming as important as traditional coding. The iterative process of refining AI behavior through prompts is a new skill set.

Cost-Optimization Strategies

Lambda pricing model taught me to think differently about resource allocation. Optimizing memory allocation per function type, minimizing execution time, and designing efficient retry strategies significantly impacts costs.

Event-Driven Design Patterns

Step Functions opened up new architectural possibilities. Learning to decompose complex workflows into discrete, recoverable steps with proper error handling creates more resilient systems.

Global Scale Considerations

Building for multiple timezones, handling eventual consistency, and designing for international users requires different thinking than single-region applications.

What's next for TimeBrew

Advanced AI Architecture

Reasoning Models: Upgrade to OpenAI o1 or Claude 3.5 Sonnet for better constraint following and more nuanced content generation.

Multi-Agent System: Replace single AI calls with specialized agents:

  • Research Agent for article discovery
  • Quality Agent for relevance filtering
  • Voice Agent for style consistency
  • Fact-Checking Agent for accuracy verification

Enhanced Personalization

Machine Learning Pipeline: Build ML models trained on user interaction data (reading time, click-through rates, feedback) for smarter content selection.

Behavioral Learning: Track user patterns to optimize delivery timing, content length, and topic mixing.

Platform Expansion

Mobile Applications: React Native apps using the same Lambda backend for native mobile experience.

Enterprise Features: Team briefings, custom source integration, white-label solutions for corporations.

API Marketplace: Offer personalized content curation as a service to other platforms.

Infrastructure Evolution

Global Distribution: Multi-region Lambda deployments for reduced latency worldwide.

Real-time Features: WebSocket integration for live briefing updates and real-time personalization adjustments.

Advanced Analytics: User engagement dashboards, content performance metrics, and A/B testing for continuous improvement.

TimeBrew represents the future of personalized content - where AI doesn't just aggregate information, but creates meaningful, engaging experiences tailored to individual needs. AWS Lambda made this vision possible by providing the scalable, cost-effective foundation needed to deliver AI-powered personalization at any scale.

Built With

Share this project:

Updates