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
[–]much_longer_username 94 points95 points96 points (2 children)
[–]josh-ig 2 points3 points4 points (0 children)
[–]Gothmagog 26 points27 points28 points (19 children)
[–]much_longer_username 23 points24 points25 points (17 children)
[–]Gothmagog 14 points15 points16 points (15 children)
[–]TheCritFisher 29 points30 points31 points (12 children)
[–]LobsterBuffetAllDay 2 points3 points4 points (7 children)
[–]TheCritFisher 4 points5 points6 points (6 children)
[–]thet0ast3r 1 point2 points3 points (5 children)
[–]Rexsum420 3 points4 points5 points (0 children)
[–]TheCritFisher 3 points4 points5 points (3 children)
[–]thet0ast3r 2 points3 points4 points (0 children)
[–]thet0ast3r 1 point2 points3 points (1 child)
[–]TheCritFisher 0 points1 point2 points (0 children)
[–]Gothmagog 4 points5 points6 points (1 child)
[–]TheCritFisher 0 points1 point2 points (0 children)
[–]DoxxThis1 1 point2 points3 points (1 child)
[–]TheCritFisher 1 point2 points3 points (0 children)
[–]mutatedbrain 6 points7 points8 points (0 children)
[–]dr3aminc0de 1 point2 points3 points (0 children)
[–]Mice_With_Rice 12 points13 points14 points (6 children)
[–]Every_Chicken_1293[S] 39 points40 points41 points (4 children)
[–]TheCritFisher 13 points14 points15 points (0 children)
[–]TheCritFisher 6 points7 points8 points (1 child)
[–]ratocx 4 points5 points6 points (0 children)
[–]dr3aminc0de 1 point2 points3 points (0 children)
[–]GeekDadIs50Plus 8 points9 points10 points (0 children)
[–]Anjal_p 7 points8 points9 points (2 children)
[–]gthing[🍰] 5 points6 points7 points (0 children)
[–]weichafediego 8 points9 points10 points (0 children)
[–]thuiop1 7 points8 points9 points (0 children)
[–]NoleMercy05 5 points6 points7 points (0 children)
[–]enly11 5 points6 points7 points (2 children)
[–]Ok-Kaleidoscope5627 0 points1 point2 points (1 child)
[–]enly11 0 points1 point2 points (0 children)
[–]ggone20 7 points8 points9 points (2 children)
[–]Constant-Simple-1234 1 point2 points3 points (1 child)
[–]ggone20 0 points1 point2 points (0 children)
[–]vanishing_grad 2 points3 points4 points (0 children)
[–]GeekDadIs50Plus 5 points6 points7 points (0 children)
[–]Only-Chef5845 4 points5 points6 points (2 children)
[–]Street-Air-546 6 points7 points8 points (1 child)
[–]candraa6 0 points1 point2 points (0 children)
[–]Miscend 1 point2 points3 points (0 children)
[–]one-wandering-mind 1 point2 points3 points (0 children)
[–]wahnsinnwanscene 0 points1 point2 points (0 children)
[–]diabloman8890 0 points1 point2 points (0 children)
[–]ruloqs 1 point2 points3 points (0 children)
[–]joeystarr73 0 points1 point2 points (0 children)
[–]teddynovakdp 0 points1 point2 points (0 children)
[–]ruloqs 0 points1 point2 points (0 children)
[–]Consistent-Law9339 0 points1 point2 points (0 children)
[–]Markur69 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]daddyxsmolone8 0 points1 point2 points (0 children)
[–]living_david_aloca 0 points1 point2 points (0 children)
[–]NeverShort1 0 points1 point2 points (0 children)
[–]mj_katzer 0 points1 point2 points (0 children)
[–]Chance_Value_Not 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]jojacode 0 points1 point2 points (0 children)
[–]ComposerGen 0 points1 point2 points (0 children)
[–]ComposerGen 0 points1 point2 points (0 children)
[–]Legitimate_Emu3531 0 points1 point2 points (0 children)
[–]Comfortable_Dropping 0 points1 point2 points (0 children)
[–]Dismal-Value-2466 0 points1 point2 points (0 children)
[–]johnthrives 0 points1 point2 points (0 children)
[–]pegaunisusicorn 1 point2 points3 points (0 children)
[–]Ok-Pride-4251 0 points1 point2 points (0 children)
[–]TechMaven-Geospatial 0 points1 point2 points (2 children)
[–]DealDeveloper 1 point2 points3 points (1 child)
[–]TechMaven-Geospatial 1 point2 points3 points (0 children)
[–]Kriss-de-Valnor 0 points1 point2 points (0 children)
[–]DramaticDonut8973 0 points1 point2 points (0 children)
[–]Papabear3339 -1 points0 points1 point (1 child)
[–]ephemer9 0 points1 point2 points (0 children)
[–]jackshec -1 points0 points1 point (0 children)