Spiritual Video Recommendation Engine

Spiritual Video Recommendation Engine

AI-Powered Content Discovery System with Multi-dimensional Attribute Mapping

Client:
January 2021
Private Repository

This sophisticated Flask-based recommendation engine represents a novel approach to spiritual content discovery. At its core, the system maps videos into a unique 9-dimensional coordinate space, where each dimension represents a specific spiritual or character attribute: Faithfulness, Gentleness, Goodness, Joy, Kindness, Knowledge, Peace, Perseverance, and Self-Control.

The architecture consists of several key components:

  1. Advanced Recommendation Algorithm: Utilizes K-Nearest Neighbors (KNN) algorithm to find similar content based on attribute proximity in the 9D space.

  2. Optimized Data Pipeline: Implements a two-tier storage system:

    • Redis cache for high-speed data access and response time optimization
    • MySQL backend for persistent storage of video metadata and attribute mappings
  3. RESTful API Endpoints:

    • /get_coordinate_by_video_id: Retrieves a video's position in the 9D space
    • /get_videos_by_video_id: Finds similar videos using KNN
    • /get_videos_by_coordinate: Discovers videos based on specific attribute values
    • /get_nearest_coordinates_by_coordinate: Implements directional preference searching
  4. Performance Features:

    • Intelligent caching system with TTL management
    • Performance monitoring and logging
    • Bulk operation support for efficient data processing
  5. Data Models:

    • VideoAttribute: Manages the 9-dimensional coordinate mapping
    • Media: Handles video metadata and content information
    • BibleCitation: Links videos to relevant scripture references

The system excels in providing contextually relevant recommendations while maintaining high performance through its caching layer. It's particularly valuable for platforms focusing on spiritual growth and character development, where content recommendations need to align with specific virtues or teachings.

The architecture is designed for scalability, with separate modules for database interactions, caching, route handling, and core algorithm implementation. This modular approach allows for easy maintenance and future enhancements, such as adding new dimensions or implementing alternative recommendation algorithms.

Technologies Used

PythonPython
FlaskFlask
RedisRedis
NumPyNumPy
DockerDocker

Gallery

9D Coordinate System

Visualization of the multi-dimensional attribute mapping system

9D Coordinate System

API Architecture

Overview of the system's REST API endpoints and data flow

API Architecture

Caching Architecture

Redis-based caching system for optimized performance

Caching Architecture