Architecture

Understand the QR-Video approach and how QRyptoRAG transforms text into searchable MP4 videos.

Encoding Process: Text → QR → Video

The encoding process transforms raw text documents into compressed MP4 videos:

  1. Text Chunking: Documents are split into chunks (500 chars + 50 char overlap)
  2. QR Generation: Each chunk becomes a QR code using the qrcode library
  3. Video Creation: QR codes are encoded as video frames using FFmpeg with H.264 compression
  4. Vector Indexing: Embeddings are stored in a vector database for semantic search

Retrieval Process: Query → Frames → Text

The retrieval process extracts relevant content from MP4 videos:

  1. Semantic Search: Query is converted to embedding and matched against vector database
  2. Frame Extraction: Relevant video frames are extracted using FFmpeg
  3. QR Decoding: QR codes are decoded using jsQR to retrieve original text
  4. Content Return: Retrieved text chunks are returned to the user

Key Components

  • QRVideoStoreEncoder: Handles text encoding and video creation
  • QRVideoStoreRetriever: Manages semantic search and content retrieval
  • Database Adapters: Support for Supabase, in-memory, file-based, and custom databases
  • Embedder Adapters: Integration with Gemini, Cohere, Hugging Face, and other embedding providers