langchain-redis
An integration package connecting Redis and LangChain for AI working memory
What it is and what it does
langchain-redis bridges Redis and LangChain, enabling three core capabilities: vector storage with semantic search (via RedisVectorStore), LLM response caching with TTL and semantic matching (via RedisCache and RedisSemanticCache), and session-based chat history with full-text search (via RedisChatMessageHistory). It wraps redisvl for indexing and query operations, and depends on langchain-core for the LangChain integration layer.
The package is designed for developers building AI applications that need persistent, searchable memory layers. It supports multiple Redis deployment modes—standard Redis, Redis with SSL/TLS, and Redis Sentinel for high availability—via connection URL configuration. All three components (vector store, cache, history) accept a RedisConfig object for detailed tuning of index names, distance metrics, key prefixes, and metadata schemas.
Use it for:
- Store and retrieve document embeddings for semantic search in RAG pipelines using RedisVectorStore
- Cache LLM responses by semantic similarity to reduce API calls and latency in production chatbots
- Maintain persistent, searchable chat histories across user sessions with automatic expiration via TTL
- Build high-availability AI systems using Redis Sentinel for failover and multi-node deployments
- Filter vector search results by metadata tags or numeric ranges to narrow retrieval in multi-tenant applications
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Redis with LangChain to provide vector storage, semantic caching, and chat history management for AI applications.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and fills a clear need for Redis-backed memory in LangChain workflows. It is permissively licensed (MIT) and supports current Python versions (3.10–3.12). Install it if you are already running Redis and need vector storage, semantic caching, or chat history for a LangChain application.
Install
langchain-redis on PyPI
pip
pip install langchain-redisuv
uv add langchain-redispoetry
poetry add langchain-redisInstalling langchain-redis
Before you install
Low friction installation with a pure Python wheel. Active maintenance with recent commits and a stable release cycle since first release in 2024. Requires a running Redis instance, which is the primary operational dependency rather than an install-time concern.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for commercial and open-source projects alike.
Quickstart
pip install langchain-redis
from langchain_redis import RedisVectorStore, RedisConfig
from langchain_core.embeddings import Embeddings
config = RedisConfig(index_name="my_vectors", redis_url="redis://localhost:6379")
vector_store = RedisVectorStore(embeddings=Embeddings(), config=config)
vector_store.add_texts(["Document 1", "Document 2"])
docs = vector_store.similarity_search("query", k=2)
Requires a running Redis instance accessible at the configured REDIS_URL
Verify before relying
- Whether the package handles connection pooling or retry logic automatically for production deployments
- Performance characteristics and scaling limits for vector search on large datasets
- Compatibility with Redis Cluster deployments beyond the Sentinel examples shown
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<3.14,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 10 — anyio, certifi, hf-xet, httpcore, jinja2, langchain-core, python-ulid, redisvl, typing-extensions, urllib3 |
| Maintenance | actively maintained — 262 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 128,711/month — #11,700 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langchain_redis-0.2.5-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
langchain-elasticsearchIntegrates Elasticsearch with LangChain to…
permissive · top 15,000 on PyPI
langchain-cerebrasIntegrates Cerebras AI inference services with…
permissive · top 15,000 on PyPI
redisvlRedisVL is a Python client for building AI…
permissive · top 5,000 on PyPI
langchain-milvusIntegrates LangChain with Milvus vector…
permissive · top 15,000 on PyPI
langgraph-checkpoint-redisProvides Redis-backed checkpoint storage and…
permissive · top 5,000 on PyPI
langchain-qdrantConnects LangChain applications to Qdrant…
permissive · top 5,000 on PyPI
llama-index-vector-stores-redisIntegrates Redis as a vector store backend for…
permissive · top 15,000 on PyPI
ramp-packerBundles Redis modules into distributable…
permissive · top 15,000 on PyPI
langchain-mongodbConnects MongoDB Atlas Vector Search to…
unclear · top 5,000 on PyPI
RLTestRLTest is a test framework for Redis and Redis…
permissive · top 15,000 on PyPI