AI Tools Developer Tools

Redis LangCache: A Managed Semantic Cache for Repeat LLM Questions

Redis LangCache reuses stored AI answers when users ask the same question in different words, cutting LLM costs.

Abstract diagram illustrating a semantic cache LLM layer routing repeated queries away from a language model
AI-generated editorial illustration.

Anyone who runs a chatbot knows the pattern. Users ask the same few questions again and again, just in different words. Each time, the app pays a large language model to write an answer it has already written before. Redis LangCache is built to stop paying for those repeats.

LangCache is a managed service from Redis that works as a semantic cache for LLM apps. It stores answers the model has already given and returns one of them when a new question means the same thing as an earlier one. Redis’s product page promises savings of up to 90% on API costs. The service is still in preview, and its documentation warns that features and behavior may change.

What a Semantic Cache Does

A normal cache only helps when a request is exactly the same as before. People rarely ask a question the exact same way twice. Redis’s own example shows three prompts: “What are the features of Product A?”, “Can you list the main features of Product A?” and “Tell me about Product A’s features.” The words differ, but the question is the same.

A semantic cache compares meaning instead of exact text. LangCache turns each prompt into an embedding, a list of numbers that captures what the text is about. Prompts with similar meaning get similar numbers. When a new prompt lands close enough to a stored one, LangCache returns the saved answer in milliseconds, and no LLM call is needed.

How It Fits Into an App

Redis describes the integration as two API calls. Before calling the model, the app asks LangCache whether it already has an answer. If it does, which is called a cache hit, the app sends that answer to the user. If it does not, the app calls its LLM as usual and then sends the prompt and the new answer to LangCache to store for next time.

LangCache creates the embeddings itself, so developers do not have to run their own embedding model. Teams can still bring their own embedding tool if they prefer. They can also set how similar two prompts must be to count as a match, how long entries live and when old entries are removed. There is a REST API plus Python and JavaScript SDKs, and hit rates and usage can be tracked in the Redis Cloud console.

Redis lists four main uses: chatbots and AI assistants, retrieval-augmented generation apps, AI agents that repeat intermediate steps, and AI gateways that sit in front of several apps and control their LLM spending in one place.

How Much It Can Save

The savings come from output tokens, the text the model writes and usually the pricier part of the bill. When an answer comes from the cache, the app does not pay for those tokens. Redis says the input side is roughly offset by the cost of embeddings and storage.

Redis gives a simple formula: monthly savings equal monthly output token costs multiplied by the cache hit rate. In its worked example, an app spends $200 a month on an LLM, and 60% of that, or $120, goes on output tokens. With half of all requests answered from the cache, the estimated saving is $60 a month.

That makes the “up to 90%” claim depend almost entirely on the hit rate. The one customer figure Redis publishes comes from Mangoes.ai, a voice app for patient care. Its founder says the app reaches a 70% cache hit rate, which saves 70% of its LLM spend, and that responses are four times faster.

What to Know Before Trying It

LangCache runs as a public preview on Redis Cloud and as a fully managed private preview. Setting it up on Redis Cloud means creating a database, adding a LangCache service to it and calling the API from the app. According to the documentation, private preview participation is free, but usage limits may apply.

On privacy, Redis states that LangCache keeps data on the customer’s Redis servers, and that Redis does not access that data or use it to train AI models.

A semantic cache also has an obvious risk. If the similarity threshold is too loose, two questions that only look alike can get the same answer. That matters most where precision is critical, such as prices, account details or medical questions. The threshold setting exists for exactly this reason, and it needs testing on real traffic.

Questions Before Adopting LangCache

  • How often do users really repeat the same question, and what hit rate is realistic?
  • Which answers must never be reused, for example ones that depend on the user or change over time?
  • How strict should the similarity threshold be before a cached answer is served?
  • Is a preview service acceptable for the app, given that features may still change?

For apps with many repeat questions, the math is simple and the integration is small. For apps where each request is unique, a semantic cache will rarely get a hit, and the savings will be small.

Sources