--- id: langchain-redis version: "0.2.5" license: MIT license_treatment: permissive maintenance: active --- # langchain-redis — An integration package connecting Redis and LangChain for AI working memory License: permissive · Maintenance: active · Downloads: 128.7K/mo ## 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 above — 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 pip install langchain-redis uv add langchain-redis poetry add langchain-redis ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 128.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags redis vector store langchain, semantic cache redis, chat history redis, langchain redis integration, vector database redis, llm caching redis, ai memory redis, vector-search, semantic-cache, chat-history [View on SkillFed](https://skillfed.io/packages/langchain-redis) · [View on PyPI](https://pypi.org/project/langchain-redis/)