Content Personalization AI Assistant

Content Personalization AI Assistant

Overview

This guide explains how to use an AI coding assistant to implement the Fire TV Content Personalization integration into your Vega app via provided documentation and prompts. Our goal is to enable your AI coding assistant to become a Content Personalization expert that helps you navigate the integration process more efficiently, reducing the implementation timeline from days into hours.

Note: This functionality is experimental and may produce unanticipated or incorrect results. Please use your best judgement when using code directly from the AI Assistant. Be sure to save any existing work to source control and inspect the LLM’s changes carefully. If you face issues, revert to the Content Personalization documentation & your Amazon contact.

What This AI Assistant Can Do

:bullseye: Core Capabilities

  • Analyze your existing codebase and identify integration points for Content Personalization
  • Generate implementation code for headless services, data handlers, and event reporting
  • Debug integration issues and provide troubleshooting guidance
  • Validate your implementation against best practices
  • Create proper data structures using the correct builders and interfaces
  • Set up manifest configurations with required privileges and service declarations

:books: Knowledge Base

When provided with the documentation, the AI assistant gains comprehensive knowledge of:

Getting Started

Note: Please ensure you’ve read the documentation & confirmed your app meets the required prerequisites.

Step 1: Set Up Your AI Assistant

  1. Choose Your AI Assistant: This guide works with various AI coding assistants including:

    a. VS Code extensions (Cline, GitHub Copilot, etc.)
    b. Standalone AI tools (ChatGPT, Claude, etc.)
    c. Integrated development environment AI features

  2. Configure Your Environment:

    a. Open your Vega project in Vega Studio
    b. Ensure your AI assistant has access to your codebase
    c. Configure the AI assistant with preferred settings (if applicable)

Note: This guide was created and tested with Cline using the Claude Sonnet 4 model.

Step 2: Project Setup

  1. Open Your Project: Load your Vega project in your development environment

  2. Gather Documentation: Download the following product steering document:

    a. content-personalization-ai-assistant.md (43.7 KB) - Complete integration guide & API documentation to provide context to your AI assistant.

  3. Provide Context to AI: Share the Content Personalization documentation with your AI assistant by:

    a. Uploading/attaching the documents (if supported)
    b. Copy the document into your codebase and referencing the documentation in your prompts

These documents provide your AI assistant with comprehensive knowledge of the Content Personalization APIs, implementation patterns, and troubleshooting guidance.

Step 3: Initial Analysis

Start by asking your AI assistant to analyze your project:

“Using the Content Personalization guidelines provided as reference, analyze my Fire TV React Native project and identify what needs to be implemented for Content Personalization integration. Look at my existing code structure and suggest the best approach.”

The AI will:

  • Examine your current file structure
  • Identify existing personalization-related code
  • Suggest implementation strategy
  • Highlight potential integration points

:light_bulb: Hint: If your AI assistant supports planning modes, use that feature for this step since you’re gathering information and planning your approach before making any code changes.

results

Step 4: Implementation Guidance

For Complete Integration (Starting from Scratch):

“I need to implement Content Personalization integration from scratch in my Fire TV React Native app. My codebase currently has no Content Personalization implementation. Please create a complete integration including: manifest configuration, headless service setup, playback event reporting, watch activity, watchlist integration, and all necessary files and dependencies.”

For Headless Service Setup:

“Help me implement the headless service for Content Personalization data pull. I need the service registration, handlers, and proper data formatting.”

For Playback Event Reporting:

“Show me how to implement playback event reporting in my video player. I need to track watch progress and handle different playback states.”

For Watchlist Integration:

“Help me integrate watchlist functionality with Content Personalization. I need to report additions and removals properly.”

Step 5: Debugging and Troubleshooting

When you encounter issues, provide specific error details:

“I’m getting service timeout errors in my Content Personalization integration. Here are the device logs: [paste logs]. Help me debug this issue.”

The AI can help with:

  • Service connectivity problems
  • Implementation issues
  • Data format validation errors
  • Manifest configuration issues

Step 6: Validation and Testing

Ask for validation guidance:

“Help me validate my Content Personalization integration. What should I check in the device logs and how can I test the Continue Watching functionality?”

Testing the Integration in Your App

Monitoring Personalization Logs

To verify that Personalization is running in your app, use this command to monitor device logs:

vda shell loggingctl log --follow | grep -Ei 'kepler.tv.personalization'

Expected Log Output:

Sep 17 16:36:47.232953 firestick-2225f01c5b90fe61 local0.info com.amazondeveloper.keplervideoapp[4639]: 2550088132 INFO kepler.tv.personalization.ancp.turbomodule: reportNewPlaybackEvent called
Sep 17 16:36:47.234186 firestick-2225f01c5b90fe61 local0.info com.amazondeveloper.keplervideoapp[4639]: 2550088132 INFO kepler.tv.personalization: reportNewPlaybackEvent async call received
Sep 17 16:36:47.235271 firestick-2225f01c5b90fe61 local0.info com.amazondeveloper.keplervideoapp[4639]: 2550088132 INFO kepler.tv.personalization: sendPlaybackEvents is submitted to thread pool
Sep 17 16:36:47.615747 firestick-2225f01c5b90fe61 local0.info com.amazondeveloper.keplervideoapp[4639]: 1791407519 INFO kepler.tv.personalization: sendPlaybackEvents async call completed successfully

:light_bulb: Hint: Try asking the AI Assistant to verify for you with a prompt:
“Run the below command for 60 seconds and tell me if you see playback events occurring correctly”
vda shell loggingctl log --follow | grep -Ei 'kepler.tv.personalization'

testing

Testing Playback Events

To verify that playback events are being properly transmitted, use this command to monitor device logs:

vda shell loggingctl log -f | grep "alberto-service:\|PlaybackEvents\|ceviche"

Expected Log Output:
When playback events are working correctly, you should see logs similar to:

INFO com.amazon.com_amazon_tv_developer_dataservice.vega.vega_alberto_service:VegaAlbertoBinderService PlaybackEventsVegaMessage → message.sent_timestamp: <your_time_stamp>, page_index : 0, total_page_count: 1, content_id id : <your_content_id>, content_id namespace : cdf_id, event_timestamp_ms: <your_time_stamp>, playback_state :0, duration_ms : <your_content_duration>, credits_position_ms :<your_content_credit_position>

Best Practices for Working with AI Assistants

:bullseye: Be Specific with Your Requests

Instead of:

“Help me with Content Personalization”

Try:

“I need to implement playback event reporting for my video player that tracks watch progress every 60 seconds and reports state changes”

:file_folder: Provide Context About Your Project

  • Share relevant code snippets
  • Mention your current implementation status
  • Include error messages and device logs

:magnifying_glass_tilted_left: Ask for Step-by-Step Guidance

The AI can break down complex implementations:

“Give me a step-by-step implementation plan for Content Personalization integration, starting with the manifest configuration and ending with testing validation.”

:performing_arts: Use Planning vs Implementation Modes Strategically

Many AI assistants offer different interaction modes that are optimal for different phases of your integration:

gif

Planning/Analysis Mode - Use for:

  • Initial project analysis and architecture planning
  • Discussing implementation approaches and trade-offs
  • Getting detailed explanations of Content Personalization concepts
  • Reviewing and refining your integration strategy before coding

Implementation/Action Mode - Use for:

  • Actually implementing code changes and file modifications
  • Running tests and debugging issues
  • Making configuration changes to manifest files
  • Executing commands and validating your implementation

Best Practice: Start with planning to understand the scope and create a solid implementation plan, then switch to implementation mode to execute the changes. This approach prevents costly mistakes and ensures you have a clear roadmap before making code changes.

:bug: Include Error Details for Debugging

When asking for help with issues:

  • Include complete error messages
  • Share relevant device log excerpts
  • Mention what you were trying to accomplish
  • Describe what you expected vs. what happened

Common Use Cases and Example Prompts

:rocket: Getting Started

“I’m starting a new Content Personalization integration. Analyze my project structure and create a complete implementation plan with all required files and configurations.”

:wrench: Implementation Help

“I have an incomplete Content Personalization integration where I’ve done [insert]. Help me create a plan to finish out the remaining parts of the integration.”

:clipboard: Manifest Configuration

“Help me configure my manifest.toml file for Content Personalization. I need the correct privileges, service declarations, and component configurations.”

:clapper_board: Video Player Integration

“Show me how to integrate Content Personalization reporting into my existing video player component. I need to track playback position, state changes, and completion events.”

:bug: Debugging Service Issues

“My headless service is not receiving data pull requests. Here’s my service registration code and device logs. Help me identify the problem.”

:white_check_mark: Testing and Validation

“Create a testing checklist for my Content Personalization integration. Include device log commands, validation steps, and common issues to check for.”

Tips for Maximum Effectiveness

:light_bulb: Iterative Development

Work with the AI in iterations:

  1. Start with basic implementation
  2. Add error handling and edge cases
  3. Optimize for performance and reliability
  4. Implement comprehensive testing

:light_bulb: Learn from Examples

Ask for multiple implementation approaches:

“Show me three different ways to implement playback event reporting, with pros and cons for each approach.”

:light_bulb: Stay Updated

When provided with the latest documentation, the AI assistant can help you:

  • Implement & validate the integration
  • Adopt new best practices
  • Identify integration issues

Be sure to update your documentation set from this page after new Vega SDK releases to ensure your AI assistant has the latest information.

Getting Help

If you encounter issues that the AI assistant can’t resolve:

  1. Drop a comment on this post for support
  2. Reach out to your Amazon contact
3 Likes