skillfed

langchain-redis

An integration package connecting Redis and LangChain for AI working memory

langchain-redis v0.2.5 128.7K downloads/30d#11,700 on PyPI68
Permissive license MIT Active released

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-redis

uv

uv add langchain-redis

poetry

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

License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12

Tags

redis vector store langchainsemantic cache redischat history redislangchain redis integrationvector database redisllm caching redisai memory redis
vector-searchsemantic-cachechat-history

More Artificial Intelligence packages