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:
- Text Chunking: Documents are split into chunks (500 chars + 50 char overlap)
- QR Generation: Each chunk becomes a QR code using the qrcode library
- Video Creation: QR codes are encoded as video frames using FFmpeg with H.264 compression
- 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:
- Semantic Search: Query is converted to embedding and matched against vector database
- Frame Extraction: Relevant video frames are extracted using FFmpeg
- QR Decoding: QR codes are decoded using jsQR to retrieve original text
- 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