Skip to content

Mielone2Good/ai-recommendation-engine-aws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues License LinkedIn


AWS Logo

AI-Powered Recommendation Engine on AWS

Serverless, low-latency product recommendation engine powered by Amazon Bedrock and DynamoDB.
Explore the code »

Report Bug · Request Feature

📌 About The Project

A fully serverless, AI-driven recommendation system built on AWS.
The platform automatically generates normalized, reusable product tags using Amazon Bedrock (GPT-OSS-20B) and computes personalized recommendations based on user interaction signals.

Designed for high performance and scalability, the system delivers personalized product rankings with an average end-to-end latency of ~280 ms, making it suitable for real-time e-commerce and content platforms.

🧠 Recommendation Logic (High-Level)

User interactions are translated into tag-level preference scores stored in DynamoDB.
Product relevance is calculated by aggregating user scores across shared tags and ranking products accordingly. User actions generate credits that influence recommendation scores. Each action updates the user's tag affinity:

Action Credits
Click +5
Add to Favorites +20
Purchase +40
Dislike -20

🗺️ Architecture Overview

Architecture API Gateway → Lambda → DynamoDB → Bedrock → CloudWatch

⚙️ Core Components

AWS Services

Service Purpose
Amazon Bedrock AI-based product tag generation (GPT-OSS-20B)
AWS Lambda Serverless compute for tagging and recommendations
Amazon DynamoDB Product catalog & user preference storage
Amazon API Gateway Secure HTTP endpoints
Amazon EventBridge Scheduled background processing
Amazon CloudWatch Logging, metrics, and monitoring

🚀 Performance

  • Average recommendation latency: ~280 ms
  • 📈 Horizontally scalable: Lambda auto-scales with traffic
  • 💰 Cost-efficient: Pay-per-request, no idle infrastructure

🔐 Security & Access

  • API Gateway throttling and rate limits
  • IAM-based Lambda permissions
  • No public database access
  • Environment variables for configuration
  • CloudWatch monitoring and alarms

🧾 DynamoDB Schema

Table: Products

Attribute Type Description
PK String Product ID
tags List Normalized product tags
other product attributes String Title, description, metadata

Table: UserTagScores

Attribute Type Description
PK String USER#<user_id>
SK String TAG#<tag_name>
score Number User affinity score

🤖 AI Tag Generation

Amazon Bedrock is used to generate generalized, reusable product tags optimized for recommendation engines (e.g. Book, Romance, Electronics, Sci-Fi).

This ensures:

  • High tag reusability
  • Better collaborative filtering
  • Reduced sparsity in user preference data

🔎 Authentication Note

For simplicity, the current implementation passes the user_id directly in the request body.

This is not considered a production-ready authentication approach, but a conscious trade-off to focus on building and optimizing the recommendation engine itself.
In a production environment, this would be replaced with JWT-based authentication (e.g. Cognito, Auth0, or a custom identity provider) enforced at the API Gateway or Lambda level.

Photos & Videos

Demo

Screen.Recording.2026-01-03.at.3.59.40.PM.online-video-cutter.com.mp4

🖥️ Frontend

The frontend for this project was vibe-coded.

The primary focus of this repository is backend architecture, data modeling, and recommendation logic, not UI development.
Frontend implementation is intentionally minimal to keep attention on the recommendation engine and AWS system design.

🎯 Use Cases

  • E-commerce product recommendations
  • Content personalization platforms
  • Cold-start mitigation using AI tagging
  • Behavioral analytics systems

About

Serverless AI-powered product recommendation engine built on AWS using Amazon Bedrock (GPT-OSS-20B) and DynamoDB. Generates generalized product tags and personalized recommendations with low-latency (~280ms).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors