A Langchain implementation for Memvid, enabling efficient video-based document storage and retrieval using vector embeddings. https://sarumaj.github.io/langchain-memvid/
  • Python 99.5%
  • Shell 0.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-20 15:17:22 +00:00
.forgejo/workflows ci: the test results as a comment on the pull request 2026-11-20 14:23:37 +01:00
.github Move CI jobs to Forgejo; add the AI review 2026-10-12 12:10:53 +00:00
docs fix sphinx warnings 2025-06-21 21:28:50 +02:00
examples fix docs pipeline 2025-06-20 23:28:24 +02:00
licenses add ffmpeg license 2025-06-18 17:40:55 +02:00
scripts add ffmpeg license 2025-06-18 17:40:55 +02:00
src fix bullet lists in docstrings 2025-06-21 21:51:12 +02:00
tests test: reset the package's loggers fully for each logging test and restore them after: since pytest 9.1 the log capture hands its handlers to a non-propagating logger, so setup_logger found it configured 2026-11-09 15:40:36 +01:00
.cz.toml ci: the release bot's Commitizen configuration 2026-11-05 19:30:33 +01:00
.gitignore Initial commit 2025-06-16 10:35:44 +02:00
BENCHMARKING.md setup sphinx 2025-06-20 16:50:51 +02:00
CHANGELOG.md chore(release): 0.1.12 2026-11-16 06:31:17 +00:00
IPYTHON_EXTENSION.md setup sphinx 2025-06-20 16:50:51 +02:00
LICENSE Initial commit 2025-06-16 10:35:44 +02:00
LICENSES.md setup sphinx 2025-06-20 16:50:51 +02:00
pyproject.toml fix(deps): update dependency pydantic to v2.14.3 2026-11-05 09:27:01 +00:00
README.md docs(readme): replace retired and obsolete badges 2026-11-09 22:46:51 +01:00
renovate.json ci: test every push to main and renovate/all-patch and every pull request, so Renovate's patches merge only when they pass (no ignoreTests); publish with twine, as pypa/gh-action-pypi-publish fails on Forgejo writing the step summary 2026-11-09 15:40:36 +01:00
TESTING.md ci: the test results as a comment on the pull request 2026-11-20 14:23:37 +01:00

test Release Libraries.io dependency status for GitHub repo


Langchain Memvid

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

Overview

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.

Features

  • 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

Installation

pip install langchain-memvid

For development and testing:

pip install -e ".[test]"

Quick Start

For a complete quick start guide, see our quickstart.py example.

For detailed explanations and interactive examples, check out quickstart.ipynb.

IPython Extension (Optional)

For enhanced Jupyter notebook and IPython experience, use the optional IPython extension:

%pip install langchain-memvid
%load_ext ipykernel_memvid_extension

The 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.

Examples

We provide comprehensive examples in multiple formats to help you get started:

📓 Jupyter Notebooks (Interactive)

The most detailed examples with explanations and visual outputs:

📄 Python Scripts (Executable)

Auto-generated Python files from the notebooks:

Running the Examples

  1. Interactive (Recommended): Open the .ipynb files in Jupyter
  2. Script: Run the .py files directly with Python

The Python files are automatically generated when notebooks are executed, ensuring they stay in sync.

Testing

For comprehensive testing information, including unit tests, test coverage, and continuous integration details, see TESTING.md.

Benchmarking

For detailed benchmarking information, including performance tests, benchmark categories, and result interpretation, see BENCHMARKING.md.

Advanced Usage

For comprehensive advanced usage examples, see our advanced.py example.

For detailed explanations and interactive examples, check out advanced.ipynb.

Requirements

  • Python >= 3.12
  • OpenCV or/and ffmpeg
  • FAISS
  • Langchain
  • Other dependencies as specified in pyproject.toml

License

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.

Acknowledgments

  • Langchain for providing the framework and tools for building LLM applications
  • Memvid for the original video-based document storage concept
  • FAISS for efficient similarity search
  • OpenCV for video processing capabilities
  • QRCode for QR code generation
  • Pydantic for data validation