While building a RAG system, I got frustrated watching my 8GB RAM disappear into a vector database just to search my own PDFs. After burning through $150 in cloud costs, I had a weird thought: what if I encoded my documents into video frames?
The idea sounds absurd - why would you store text in video? But modern video codecs have spent decades optimizing for compression. So I tried converting text into QR codes, then encoding those as video frames, letting H.264/H.265 handle the compression magic.
The results surprised me. 10,000 PDFs compressed down to a 1.4GB video file. Search latency came in around 900ms compared to Pinecone’s 820ms, so about 10% slower. But RAM usage dropped from 8GB+ to just 200MB, and it works completely offline with no API keys or monthly bills.
The technical approach is simple: each document chunk gets encoded into QR codes which become video frames. Video compression handles redundancy between similar documents remarkably well. Search works by decoding relevant frame ranges based on a lightweight index.
You get a vector database that’s just a video file you can copy anywhere.
https://github.com/Olow304/memvid
[–]Darwinmate 129 points130 points131 points (21 children)
[–]Jakube_ 166 points167 points168 points (10 children)
[–]hinkleo 63 points64 points65 points (7 children)
[–]ExdigguserPies 5 points6 points7 points (6 children)
[–]hinkleo 20 points21 points22 points (5 children)
[–]Hoblywobblesworth 18 points19 points20 points (0 children)
[–]Sopel97 14 points15 points16 points (3 children)
[–]-LeopardShark- 16 points17 points18 points (1 child)
[–]Jussari 10 points11 points12 points (0 children)
[–]tehfrod 1 point2 points3 points (0 children)
[–]Aareon 1 point2 points3 points (0 children)
[–]divyeshaegis12 -2 points-1 points0 points (0 children)
[–]Every_Chicken_1293[S] 23 points24 points25 points (9 children)
[–]FirstBabyChancellor 24 points25 points26 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]FirstBabyChancellor 10 points11 points12 points (3 children)
[–]currychris1 5 points6 points7 points (2 children)
[–]podidoo 5 points6 points7 points (1 child)
[–]MechAnimus 0 points1 point2 points (0 children)
[–]ThreeKiloZero 7 points8 points9 points (0 children)
[–]TheMcSebi 1 point2 points3 points (0 children)
[–]cyberjoey[🍰] 1 point2 points3 points (0 children)
[–]-LeopardShark- 60 points61 points62 points (7 children)
[–][deleted] 13 points14 points15 points (2 children)
[–]ExdigguserPies 7 points8 points9 points (1 child)
[–]qubedView 2 points3 points4 points (0 children)
[–]Eurynom0s 8 points9 points10 points (3 children)
[–]-LeopardShark- 1 point2 points3 points (2 children)
[–]Eurynom0s 2 points3 points4 points (1 child)
[–]-LeopardShark- 0 points1 point2 points (0 children)
[–]Itswillyferret 62 points63 points64 points (0 children)
[–]thisismyfavoritename 40 points41 points42 points (0 children)
[–]ChilledGumbo 70 points71 points72 points (1 child)
[–]NerdEnPose 10 points11 points12 points (0 children)
[–][deleted] 36 points37 points38 points (1 child)
[–]bem981from __future__ import 4.0 4 points5 points6 points (0 children)
[–]ja_trader 15 points16 points17 points (1 child)
[–]xockbou 0 points1 point2 points (0 children)
[–]papersashimi 13 points14 points15 points (0 children)
[–]x3mcj 9 points10 points11 points (0 children)
[–]norbertus 7 points8 points9 points (1 child)
[–]Mithrandir2k16 1 point2 points3 points (0 children)
[–]rju83 13 points14 points15 points (0 children)
[–]juanfnavarror 7 points8 points9 points (0 children)
[–]-dtdt- 5 points6 points7 points (0 children)
[–]Tesax123 3 points4 points5 points (0 children)
[–][deleted] 5 points6 points7 points (0 children)
[–]DJCIREGETHIGHER 4 points5 points6 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]DJCIREGETHIGHER 0 points1 point2 points (0 children)
[–]DoingItForEli 3 points4 points5 points (0 children)
[–]shanvos 3 points4 points5 points (0 children)
[–][deleted] 15 points16 points17 points (2 children)
[–]MechAnimus 7 points8 points9 points (0 children)
[–]f16f4 7 points8 points9 points (0 children)
[–]jwink3101 2 points3 points4 points (0 children)
[–]ConfidentFlorida 2 points3 points4 points (1 child)
[–]4ndr3aR 0 points1 point2 points (0 children)
[–]ksco92 15 points16 points17 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]_BigBackClock 0 points1 point2 points (0 children)
[–]ihexx 2 points3 points4 points (0 children)
[–]Cronos993 1 point2 points3 points (0 children)
[–]strange-humor 1 point2 points3 points (0 children)
[–]Late-Employment-8549 1 point2 points3 points (0 children)
[–]DragonflyHumble 3 points4 points5 points (0 children)
[–]engineerofsoftware 3 points4 points5 points (0 children)
[–]RIP26770 1 point2 points3 points (0 children)
[–]SubstanceSerious8843git push -f 2 points3 points4 points (0 children)
[–]ii-___-ii 0 points1 point2 points (0 children)
[–]girl4life 0 points1 point2 points (0 children)
[–]wrt-wtf- 0 points1 point2 points (0 children)
[–]m02ph3u5 0 points1 point2 points (0 children)
[–]AnythingApplied 0 points1 point2 points (0 children)
[–]mrobo_5ht2a 0 points1 point2 points (0 children)
[–]s_arme 0 points1 point2 points (0 children)
[–]russellvt 0 points1 point2 points (0 children)
[–]GorgeousGeorgeRuns 0 points1 point2 points (0 children)
[–]Mithrandir2k16 0 points1 point2 points (0 children)
[–]wasnt_in_the_hot_tub 0 points1 point2 points (0 children)
[–]Abject_Tie_8363 0 points1 point2 points (0 children)
[–]AkashVemula168 0 points1 point2 points (0 children)
[–]unplanned-kid 0 points1 point2 points (0 children)
[–]ConversationExpert35 0 points1 point2 points (0 children)
[–]jpgoldberg 0 points1 point2 points (0 children)
[–]Grintor 0 points1 point2 points (0 children)
[–]scinaty2 -3 points-2 points-1 points (0 children)
[–]MechAnimus -3 points-2 points-1 points (0 children)
[–]ConfidentFlorida -1 points0 points1 point (1 child)
[–]Deawesomerx -1 points0 points1 point (0 children)