{"by":"saleban1031","descendants":23,"id":44125598,"kids":[44153538,44153628,44153691,44153670,44153579,44153541,44153526,44157722,44153530,44153679,44153545,44199772,44218987,44158382,44153506],"score":61,"text":"While building a Retrieval-Augmented Generation (RAG) system, I was frustrated by my vector database consuming 8GB RAM just to search my own PDFs. After incurring $150 in cloud costs, I had an unconventional idea: what if I encoded my documents into video frames?<p>The concept sounded absurd—storing text in video? But modern video codecs have been optimized for compression over decades. So, I converted text into QR codes, then encoded those as video frames, letting H.264&#x2F;H.265 handle the compression.<p>The results were surprising. 10,000 PDFs compressed down to a 1.4GB video file. Search latency was around 900ms compared to Pinecone’s 820ms—about 10% slower. However, RAM usage dropped from over 8GB to just 200MB, and it operates entirely offline without API keys or monthly fees.<p>Technically, each document chunk is encoded into QR codes, which become video frames. Video compression handles redundancy between similar documents effectively. Search works by decoding relevant frame ranges based on a lightweight index.<p>You get a vector database that’s just a video file you can copy anywhere.<p>GitHub: <a href=\"https:&#x2F;&#x2F;github.com&#x2F;Olow304&#x2F;memvid\">https:&#x2F;&#x2F;github.com&#x2F;Olow304&#x2F;memvid</a>","time":1748523241,"title":"Show HN: I compressed 10k PDFs into a 1.4GB video for LLM memory","type":"story","url":"https://github.com/Olow304/memvid"}