Back to stack index

Database

Redis

Caching, queues, and rate limits for multi-user apps.

Short answer

Redis is an in-memory data store used by most self-hosted AI platforms for job queues, caching, rate limiting and session data. In our directory, Dify, Langfuse, LiteLLM and n8n use it, mainly to pass work to background workers and to share state between server instances. The current release is Redis 8.10.2, from September 17, 2026. Since Redis 8, the open-source edition is available under a choice of three licenses: the Redis Source Available License v2, the Server Side Public License v1, or the OSI-approved GNU AGPLv3. Redis 8 also folds in vector search, JSON and other modules that used to be separate. Valkey, a fork created by the Linux Foundation in 2024 under the BSD license, is a drop-in alternative that many cloud providers now offer. Redis Cloud has a free 30 MB database, Essentials plans from $5 a month and Pro plans from $200 a month.

Latest release
Redis 8.10.2, September 17, 2026
Redis GitHub
License
RSALv2, SSPLv1 or AGPLv3 (your choice)
redis.io
Redis Cloud
Free 30 MB; Essentials from $5/mo; Pro from $200/mo
redis.io/pricing
Open fork
Valkey, BSD-3-Clause, Linux Foundation
valkey.io

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (4)

  • Dify

    Visual builder for RAG apps and agents with deployable API endpoints.

  • Langfuse

    Open LLM engineering hub for traces, prompts, scores, and datasets.

  • LiteLLM

    OpenAI-compatible proxy that unifies dozens of model providers behind one key.

  • n8n

    n8n accelerates app backends or internal tools with frameworks you can self-host.

Redis in open-source AI tools: caching, queues and vector search for Dify, Langfuse, LiteLLM and n8n in 2026

What Redis does in an AI stack

Redis keeps data in memory and answers in well under a millisecond. In AI apps it rarely holds the main records, which live in PostgreSQL or another database. It does the coordination work around them:

JobExample
Task queue brokerDify's Celery workers pick up document indexing and workflow jobs
CacheStore embeddings, model responses or settings to avoid repeat calls
Rate limiting and budgetsLiteLLM tracks requests and spend per key across proxy instances
Pub/sub and streamsPush workflow progress to the browser; fan out events
Sessions and locksShare login sessions and prevent duplicate jobs across servers
Semantic cacheReturn a stored answer when a new prompt is similar enough to an old one

Which directory projects use it

ProjectRedis role
DifyCelery broker and cache; required in the default Docker Compose
LangfuseQueue for ingesting traces and cache; required for v3 and later
LiteLLMShared rate limits, budgets and response caching across proxy instances
n8nQueue mode, which splits workflow executions across worker processes

In each case the project works with a standard Redis or Valkey instance. You do not need Redis Stack or Redis 8 features unless the project documents them.

Redis 8 and 8.10

Redis 8.0, released in 2025, merged the former Redis Stack modules into the main distribution, so JSON documents, time series, probabilistic data structures and the Redis Query Engine with vector search ship in one package. It also introduced vector sets, a data type designed for similarity search with a simpler API than the query engine. Later 8.x releases continued performance work, and 8.10.2, on September 17, 2026, is the current release.

Licensing history

Redis licensing has changed twice, and it matters for some organizations:

PeriodLicense
Until March 2024BSD-3-Clause, fully open source
March 2024 to Redis 8RSALv2 or SSPLv1, source-available, not OSI-approved
Redis 8 onwardRSALv2, SSPLv1 or AGPLv3, at the user's choice

The 2024 change prompted the Linux Foundation, with support from AWS, Google Cloud, Oracle and others, to fork Redis 7.2.4 as Valkey under the original BSD license. Salvatore Sanfilippo, Redis's creator, returned to Redis in late 2024, and the company added the AGPL option with Redis 8, which made Redis open source by the OSI definition again.

For self-hosting an AI tool internally, any of these licenses permits use. The differences matter mainly to companies offering Redis itself as a hosted service.

Valkey

Valkey has continued development independently. It has added multi-threaded I/O improvements and new features of its own, and AWS ElastiCache, Google Memorystore and others now offer Valkey, often at lower prices than their Redis options. For the queue and cache roles that Dify, Langfuse, LiteLLM and n8n need, Valkey is a drop-in replacement. Choose Redis 8 if you want its built-in vector search and JSON features; choose Valkey if you want a BSD-licensed server and broad cloud support.

Hosted options

ServiceStarting priceNotes
Redis CloudFree 30 MB; Essentials from $5/mo; Pro from $200/moRun by Redis Ltd., includes Redis 8 features
AWS ElastiCachePay per node or serverlessRedis OSS and Valkey engines
Google MemorystorePay per GB-hourRedis and Valkey
UpstashFree tier, pay per requestServerless Redis with an HTTP API, popular with Vercel apps

Self-hosting Redis for AI tools

  • Keep it private. Redis was designed for trusted networks. Never expose port 6379 publicly; attackers scan for open Redis servers and abuse them within hours. Set a password with requirepass or ACLs.
  • Persistence for queues. Turn on AOF persistence if Redis holds jobs, so a restart does not lose queued work. Cache-only instances can run without it.
  • Memory limits. Set maxmemory and an eviction policy such as allkeys-lru for caches. For queues, use noeviction so jobs are never silently dropped.
  • Separate instances. If one Redis serves both cache and queues, a full cache can push out jobs. Larger installs use two instances or separate databases with care.
  • Monitor. Track memory, connected clients and queue lengths. A queue that keeps growing means workers cannot keep up.

Semantic caching with Redis

Model calls are slow and cost money, and many users ask nearly the same questions. A semantic cache stores each prompt's embedding with its answer; when a new prompt arrives, it searches for a stored prompt within a similarity threshold and returns the cached answer if one is close enough. Redis's vector search makes this fast. LiteLLM supports Redis semantic caching through configuration, and RedisVL, the Redis vector library for Python, provides a ready-made semantic cache class. Set the threshold carefully: too loose and users get answers to questions they did not ask.

Redis versus alternatives for queues

OptionStrength
Redis or ValkeyFast, simple, supported by Celery, BullMQ, RQ and Sidekiq
PostgreSQL-based queuesOne less service; pg-boss, Graphile Worker, Procrastinate
RabbitMQRich routing, delivery guarantees
Kafka or RedpandaVery high-throughput event streams
TemporalDurable workflows with retries and state

Small self-hosted installs increasingly use Postgres-backed queues to avoid running Redis at all, but the AI platforms in our directory still expect Redis.

Redis in multi-instance deployments

A single server running Dify or LiteLLM can keep some state in memory. Once you run two or more instances behind a load balancer, they must share that state, and Redis is where it goes. LiteLLM needs Redis to enforce a team's budget correctly when requests land on different proxy instances; without it, each instance counts separately and the team can spend several times its limit. Langfuse uses Redis queues so web containers accept traces quickly while worker containers write them to ClickHouse. n8n's queue mode puts each workflow execution on a Redis queue so a pool of workers can run them in parallel, which is how large n8n installs handle thousands of executions an hour.

For high availability, run Redis with replicas and Redis Sentinel, or use a managed service that handles failover. Check that the AI tool supports Sentinel or cluster mode before relying on it; some only accept a single Redis URL.

Common problems

SymptomLikely cause
Documents stuck "indexing" in DifyWorker not connected to Redis, or worker crashed
LiteLLM budgets not enforced across instancesRedis not configured, so each instance tracks its own counts
Out-of-memory errorsNo maxmemory limit, or a cache with no expiry
Lost jobs after restartPersistence disabled

Related: PostgreSQL stack, LiteLLM stack, n8n stack, Docker stack, Qdrant stack, Stack index.

Frequently asked questions

Why do AI platforms need Redis?

To split work between web servers and background workers. When you upload documents to Dify, the API puts an indexing job on a Redis-backed queue and a worker processes it. Redis also caches model responses and settings, enforces rate limits and budgets in gateways like LiteLLM, and lets several server instances share state.

Is Redis open source again?

Since Redis 8 in 2025, the Redis Open Source edition can be used under the AGPLv3, an OSI-approved license, as one of three options. Between March 2024 and that change, Redis was available only under source-available licenses. The AGPL requires sharing source if you offer a modified Redis as a network service.

Can I use Valkey instead of Redis for Dify or Langfuse?

Usually yes. Valkey is compatible with the Redis protocol and commands up to Redis 7.2, which covers what queues and caches in these tools need. Features added only in Redis 8, such as its built-in vector sets and query engine, are not in Valkey.

Does Redis do vector search?

Yes. Redis 8 includes the Redis Query Engine, which supports vector similarity search with HNSW and flat indexes, plus a newer vector set data type. It suits semantic caching and small to medium retrieval workloads where low latency matters.

How much memory does Redis need for a self-hosted AI app?

For queues and caching in a small Dify or n8n install, 256 MB to 1 GB is typical. Set a maxmemory limit and an eviction policy for cache use, and turn on persistence for queues so jobs survive a restart.

Sources

  1. Redis releases
  2. Redis licensing
  3. Redis pricing
  4. Valkey