Skip to content

Hrishikesh332/Twelve-Labs-Content-Recommendation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 

Repository files navigation

Qdrant Content Recommendation

Intelligent content recommendation system powered by Twelve Labs and Qdrant vector database for personalized content discovery.

Overview

Content Recommendation is an open source platform that makes use of vector similarity search to provide highly relevant content recommendations. The system uses Twelve Labs, for embedding creation and Qdrant, a vector similarity search engine, to store and retrieve content based on semantic similarity rather than just keywords. This enables more intuitive and personalized content discovery for users.

Prerequisites

Features

  1. Video Content are processed and converted into vector embeddings
  2. Embeddings are stored in Qdrant vector database
  3. Qdrant performs efficient similarity search to find relevant content
  4. Top matches are returned as personalized recommendations

Core Workflow Architecture

Core Workflow Architecture

Search Endpoint Flow

Search Endpoint Flow

File Strcuture

The frontend is developed using Next.js, while the backend is powered by Flask API with CORS enabled.

├── backend-api
    ├── .gitignore
    ├── app.py
    ├── notebooks
    │   └── Video_Content_Embedding_Creation_and_Qdrant.ipynb
    ├── requirements.txt
    └── src
    │   └── Content Reccomendation Core Architecture.png
└── www.content-reccomender.vercel.app
    ├── .gitignore
    ├── README.md
    ├── app
        ├── explore
        │   ├── background.png
        │   ├── loading.tsx
        │   └── page.tsx
        ├── favicon.ico
        ├── global.css
        ├── globals.css
        ├── layout.tsx
        └── page.tsx
    ├── components.json
    ├── components
        ├── navbar.tsx
        ├── optimized-video-grid.tsx
        ├── style-selector.tsx
        ├── ui
        │   ├── button.tsx
        │   ├── drawer.tsx
        │   ├── input.tsx
        │   └── select.tsx
        ├── video-grid.tsx
        └── video-player.tsx
    ├── eslint.config.mjs
    ├── lib
        ├── api.ts
        └── utils.ts
    ├── next.config.ts
    ├── package-lock.json
    ├── package.json
    ├── postcss.config.mjs
    ├── public
        ├── file.svg
        ├── globe.svg
        ├── next.svg
        ├── vercel.svg
        └── window.svg
    ├── tailwind.config.ts
    └── tsconfig.json
├── README.md

API Key Setup

Qdrant Setup

  1. You can either use Qdrant Cloud or run Qdrant locally

  2. Generate the API KEY from the Twelve Labs Playground

  3. Configure your connection in the .env file:

QDRANT_URL=your_qdrant_url
QDRANT_API_KEY=your_qdrant_api_key
API_KEY=your_twelvelabs_api_key

Installation

Clone the repository

git clone https://github.com/Hrishikesh332/Twelve-Labs-Content-Recommendation-.git

For Backend -

  1. To the Backend Directory
cd backend-api
  1. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install dependencies
pip install -r requirements.txt
  1. Configure environment variables -
QDRANT_URL=your_qdrant_url
QDRANT_API_KEY=your_qdrant_api_key
API_KEY=your_twelvelabs_api_key
  1. Run the backend application -
python app.py
  1. Navigate to http://localhost:5000 in your browse

For Frontend

  1. To the Frontend Directory
cd www.content-reccomender.vercel.app
  1. Install frontend dependencies
npm install
  1. Set up environment variables

Create a .env.local file in the frontend directory:

NEXT_PUBLIC_API_URL=http://localhost:5000
  1. Run the application -
npm run dev
  1. Navigate to http://localhost:3000 in your browse

API Usage

The backend provides search Endpoint -

# Search for videos
curl -X POST http://localhost:5000/search \
  -H "Content-Type: application/json" \
  -d '{"query": "Sci Fi Robot Animation"}'

Queries

For any doubts or help you can reach out to me via [email protected] or ask in the Discord Channel

About

Content Recommendation is an open source platform that makes use of vector similarity search to provide highly relevant content recommendations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published