A Langchain implementation for Memvid, enabling efficient video-based document storage and retrieval using vector embeddings.
Memvid revolutionizes AI memory management by encoding text data into videos, enabling lightning-fast semantic search across millions of text chunks with sub-second retrieval times. Unlike traditional vector databases that consume massive amounts of RAM and storage, Memvid compresses your knowledge base into compact video files while maintaining instant access to any piece of information.
Saleban Olow, author of memvid, 5th of June, 2025
Langchain Memvid is a powerful tool that combines the capabilities of Langchain with video-based document storage. It allows you to store text chunks in video frames using QR codes and retrieve them efficiently using vector similarity search. This approach provides a unique way to store and retrieve information while maintaining visual accessibility.
- Vector Store Integration: Seamless integration with Langchain's vector store interface
- Video-based Storage: Store text chunks in video frames using QR codes
- Efficient Retrieval: Fast similarity search using FAISS indexing
- Flexible Configuration: Customizable settings for encoding, indexing, and retrieval
- Multiple Embedding Models: Support for various embedding models through Langchain
- Granular Control: Access to low-level components for fine-tuned control
- Comprehensive Testing: Extensive test suite with performance benchmarks
pip install langchain-memvidFor development and testing:
pip install -e ".[test]"For a complete quick start guide, see our quickstart.py example.
For detailed explanations and interactive examples, check out quickstart.ipynb.
For enhanced Jupyter notebook and IPython experience, use the optional IPython extension:
%pip install langchain-memvid
%load_ext ipykernel_memvid_extensionThe extension provides magic commands for:
- Displaying data as bullet lists and tables (
%as_bullet_list,%as_table) - Automatic cleanup of temporary files (
%cleanup) - Package installation with visual feedback (
%pip_install) - Sound notifications for cell completion
- Enhanced progress bars
For detailed usage instructions, see IPYTHON_EXTENSION.md.
We provide comprehensive examples in multiple formats to help you get started:
The most detailed examples with explanations and visual outputs:
- quickstart.ipynb - Basic tutorial demonstrating core functionality
- advanced.ipynb - Advanced features and customization options
Auto-generated Python files from the notebooks:
- quickstart.py - Basic usage example
- advanced.py - Advanced usage example
- Interactive (Recommended): Open the
.ipynbfiles in Jupyter - Script: Run the
.pyfiles directly with Python
The Python files are automatically generated when notebooks are executed, ensuring they stay in sync.
For comprehensive testing information, including unit tests, test coverage, and continuous integration details, see TESTING.md.
For detailed benchmarking information, including performance tests, benchmark categories, and result interpretation, see BENCHMARKING.md.
For comprehensive advanced usage examples, see our advanced.py example.
For detailed explanations and interactive examples, check out advanced.ipynb.
- Python >= 3.12
- OpenCV or/and ffmpeg
- FAISS
- Langchain
- Other dependencies as specified in pyproject.toml
This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.
For information about third-party licenses, see LICENSES.md.