Building Real-Time AI Recommendations and Search with Amplitude and Shaped

In a world where user expectations are shaped by hyper-personalized experiences, the ability to act on behavioral data in real time is a competitive edge. Amplitude captures detailed user interactions, but to truly unlock their value, you need intelligent systems that can translate those events into predictions and personalization. That’s where Shaped comes in — turning raw Amplitude data into real-time recommendations, semantic search, and actionable insights with minimal lift. In this post, we’ll show you exactly how to integrate Amplitude with Shaped using AWS Kinesis, and start powering smarter user experiences instantly.

Leveraging Rich Behavioral Data for Smarter Personalization

In today's digital landscape, understanding user behavior is paramount to creating engaging and personalized experiences. Platforms like Amplitude excel at capturing granular user interactions – every click, view, purchase, and feature usage – providing a rich stream of behavioral data. This data is gold, but unlocking its full potential requires transforming raw events into actionable intelligence that can power real-time personalization across your entire application.

How do you go from knowing a user viewed a product in Amplitude to predicting which product they're most likely to engage with or purchase next? How do you personalize search results or entire "For You" feeds based on their unique, evolving journey captured in your Amplitude events? This is where combining Amplitude's rich behavioral data stream with a sophisticated AI relevance platform like Shaped becomes incredibly powerful.

Shaped specializes in taking event streams like those from Amplitude and using state-of-the-art machine learning models to understand user intent, predict future behavior, and deliver personalized search rankings, recommendations, and insightful analytics via simple APIs. This post will guide you through the value of connecting these two platforms and provide a step-by-step tutorial on how to integrate Amplitude with Shaped using AWS Kinesis.

Why Connect Amplitude to Shaped? Unlocking Tangible Use Cases

Amplitude provides the detailed "what" of user behavior. Shaped provides the "so what" and "what's next" – transforming that behavioral stream into predictive intelligence that powers concrete features and provides deep insights.

By connecting Amplitude to Shaped, you directly enable:

  • Sophisticated Recommendations: Move beyond basic popularity or rule-based suggestions. Use Amplitude data to power:
    • "For You" Feeds: Highly personalized content or product feeds that adapt in real-time.
    • Product Recommendations: Relevant suggestions on product pages, homepages, or category listings.
    • Similar Items: Suggest items based on deep semantic understanding learned from user behavior, not just metadata tags.
    • "What to Watch/Read Next": Context-aware recommendations for media and content platforms.
    • Cart Upsell/Cross-sell: Intelligent suggestions during the checkout process.
    • Any personalized slate of content or products tailored to individual users.
  • Personalized & Semantic Search: Enhance your search functionality beyond simple keyword matching:
    • Personalized Search Ranking: Rank search results based on individual user preferences learned from Amplitude events.
    • Semantic Search: Understand the meaning behind queries, finding relevant items even without exact keyword matches.
    • Keyword Search Enhancement: Improve traditional keyword search relevance using behavioral signals.
    • (Note: While Shaped excels at ranking, initial retrieval might still use tools like Elasticsearch; Shaped provides the personalization layer).
  • Actionable Analytics & Insights: Gain deeper understanding beyond standard Amplitude dashboards:
    • User Journey Analysis: Understand complex paths and predict future actions based on learned patterns.
    • User & Item Catalog Insights: Discover hidden relationships and cohort behaviors through model embeddings.
    • Performance & Uplift Monitoring: Track the direct impact of personalization on key business metrics.
    • Explainable AI: Understand why certain recommendations or rankings are made, providing insights into user preferences and model behavior.
    • Embedding Visualization: Visualize user and item relationships to understand cohorts and influential features.
  • Real-Time Adaptability: Shaped models learn continuously from the live Amplitude event stream, allowing all the above use cases to adapt instantly to user actions within the same session.
  • Simplified ML Workflow: Instead of building complex data pipelines and ML infrastructure to process Amplitude data for these use cases, Shaped provides a managed platform focused purely on relevance and personalization.

Connecting these platforms allows you to directly translate the valuable insights captured in Amplitude into tangible features and analytics that demonstrably improve user engagement, conversion rates, and overall customer satisfaction through AI-driven personalization.

Connecting Amplitude to Shaped via AWS Kinesis

Shaped's real-time infrastructure leverages AWS Kinesis Data Streams. Therefore, the integration path involves setting up Amplitude to stream events to a Kinesis Data Stream destination, which Shaped securely accesses.

Here’s how to set it up:

Step 1: Create the Shaped Dataset

First, you need to create a dataset within Shaped configured to receive Amplitude events. Shaped automatically sets up the correct schema based on the Amplitude event specification when you use the AMPLITUDE schema type.

Create a YAML file (e.g., amplitude_events.yaml) with the following content:

amplitude_events.yaml
1
2
name: amplitude_events
schema_type: AMPLITUDE

Now, use the Shaped CLI to create the dataset:

CLI
1 shaped create-dataset --file amplitude_events.yaml

You can verify that the dataset has been created and is provisioning (it will eventually reach an ACTIVE state) by checking the Shaped Dashboard or using the CLI (shaped list-datasets).

Step 2: Retrieve Shaped Kinesis Details

Once your Shaped dataset is created (it doesn't need to be fully ACTIVE yet to retrieve these details), you need to get the specific AWS Kinesis Data Stream name and the IAM Role ARN that Shaped has provisioned for this dataset. You'll need these to configure Amplitude.

Use the Shaped CLI:

CLI
1 shaped view-dataset --dataset-name amplitude_events

The output will look similar to this (ARNs and stream names will vary):

amplitude_events.yaml
1 dataset_name: amplitude_events
2 dataset_uri: https://api.shaped.ai/v1/datasets/amplitude_events
3 schema_type: AMPLITUDE
4 dataset_schema: <event_schema> # Schema details will be shown here
5 kinesis_stream_arn: arn:aws:kinesis:us-east-2:11111111111:stream/ShapedDatasetStream-abc123
6 kinesis_iam_role_arn: arn:aws:iam::11111111111:role/ShapedDatasetAccessRole-abc123

Note down the kinesis_stream_arn and kinesis_iam_role_arn values. Specifically, you will need:

  • The Stream Name (e.g., ShapedDatasetStream-abc123 from the stream ARN)
  • The full IAM Role ARN (e.g., arn:aws:iam::11111111111:role/ShapedDatasetAccessRole-abc123)

(Note: You can also retrieve these details using the Shaped API by making a GET request to https://api.shaped.ai/v1/datasets/amplitude_events with your API key.)

Step 3: Configure Amplitude Data Destination

Now, log in to your Amplitude account and configure the Kinesis Data Stream destination:

  1. Navigate to Data Destinations in your Amplitude project settings.
  2. Click Add Destination.
  3. Find and select the Kinesis Data Stream - Event Stream destination.
  4. Enter a recognizable Sync Name (e.g., "Shaped Production Events").
  5. Click Create Sync.
  6. Click Edit on the newly created destination.
  7. Enter the following details retrieved from Shaped in Step 2:
    • AWS Kinesis Stream Name:
    • The name part of the kinesis_stream_arn (e.g., ShapedDatasetStream-abc123).
    • AWS IAM Role Resource Name (ARN):
    • The full kinesis_iam_role_arn.
    • AWS Region:
    • Enter us-east-2 (Shaped's Kinesis streams are provisioned in this region for Amplitude integrations).
  8. (Recommended) Filter Events: Use the 'Send Events' filter options. While you can send all events, it's often best practice to select the key events that signify meaningful user engagement with your content or products (e.g., view_item, add_to_cart, complete_purchase, like_article, watch_video_complete). This focuses the AI models on the most impactful interactions.
  9. When finished configuring, Enable the destination using the toggle switch.
  10. Save the changes.

Amplitude will now begin streaming the selected events in real-time to the Kinesis Data Stream managed by Shaped.

What Happens Next? Powering Personalization & Insights

Once the connection is active and events are flowing from Amplitude to Shaped:

  1. Data Ingestion: Shaped securely ingests the real-time event stream.
  2. Model Training: Shaped automatically begins training sophisticated machine learning models based on this live behavioral data. These models learn user preferences, item relationships, sequential patterns, and generate useful embeddings.
  3. API Access: Once models are trained, you can use Shaped's simple API to fetch personalized recommendations, search rankings, or retrieve embeddings for analytics for any user, powered by the insights derived from your Amplitude data.
  4. Continuous Learning: The models continue to update in near real-time as new Amplitude events stream in, ensuring personalization stays fresh and relevant.

Conclusion: Unlock the Predictive Power of Your Amplitude Data

Connecting Amplitude to Shaped provides a streamlined, powerful way to transform your rich behavioral event data into actionable AI-driven personalization and insightful analytics. By following the steps above to configure the Kinesis Data Stream destination, you can quickly bridge these two platforms and begin leveraging state-of-the-art machine learning across a wide range of use cases – from real-time "For You" feeds and personalized search to deep user journey analysis. Stop letting valuable behavioral insights sit only in analytics dashboards – put them to work powering intelligent, adaptive experiences with Shaped.

Ready to turn your Amplitude events into smarter recommendations, search, and insights?

Request a demo of Shaped today to see it in action with your specific use case. Or, start exploring immediately with our free trial sandbox.

Get up and running with one engineer in one sprint

Guaranteed lift within your first 30 days or your money back

100M+
Users and items
1000+
Queries per second
1B+
Requests

Related Posts

Omair Khan
 | 
August 10, 2023

How Threads Built a World-Class Recommendation System in Record Time

Jaime Ferrando Huertas
 | 
October 24, 2022

Why your feeds are getting worse over time

Tullie Murrell
 | 
February 7, 2023

Evaluating Recommendation Systems - Precision@k, Recall@k, and R-Precision