Skip to content
redis avatar

Redis Semantic Cache

Redis LangCache guidance for semantic caching of LLM responses, tuning thresholds, and isolating workloads.

CCM score
76 of 100
skills.sh installs
2.2K
GitHub stars
176
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers the cache-aside flow: search first, then call the LLM and set the response on a miss
  • Includes SDK and REST samples for search and set, plus attribute-based storage for filtering entries
  • Provides a similarity threshold guide from 0.8 for loose matches to 0.95 for near-exact matches, with 0.9 as the default
  • Designed for teams caching LLM completions or RAG answers on Redis Cloud, currently in preview

Install

$ npx -y skills add redis/agent-skills --skill redis-semantic-cache -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Redis Semantic Cache

Semantic caching for LLM responses with Redis Cloud's LangCache service. Stores prompts as embeddings; subsequent semantically-similar prompts return the cached response without re-calling the model.

LangCache is currently in preview on Redis Cloud. Features and behavior may change.

When to apply

  • Wrapping an LLM call (OpenAI, Anthropic, etc.) with a cache layer to cut cost and latency.
  • Caching RAG answers, classification outputs, or any deterministic LLM workload.
  • Tuning the precision/hit-rate trade-off for a semantic cache.
  • Splitting one application's LLM workloads across multiple cache instances.

1. The cache-aside flow

LangCache fits in front of any LLM call as a standard cache-aside pattern:

  1. Send the user's prompt to LangCache's search.
  2. Cache hit — return the stored response directly.
  3. Cache miss — call the LLM, then set the response so future similar prompts hit.
from langcache import LangCache
import os

lang_cache = LangCache(
    server_url=f"https://{os.getenv('HOST')}",
    cache_id=os.getenv("CACHE_ID"),
    api_key=os.getenv("API_KEY"),
)

Details

Repository
github.com/redis/agent-skills
Categories
AI Agents & LLM Apps, Databases
First seen
Jul 14, 2026

Questions

What does the redis-semantic-cache skill do?

It guides an agent to add semantic caching of LLM responses using Redis Cloud's LangCache service, so similar prompts return stored answers without a new model call. It covers the cache-aside flow through the SDK or REST API, tuning the similarity threshold, and separating caches per task type.

How do I install the redis-semantic-cache skill?

Run npx -y skills add redis/agent-skills --skill redis-semantic-cache -y in your project. This lets the agent wrap LLM calls with a LangCache layer to cut cost and latency.

Who should use the redis-semantic-cache skill?

It suits developers caching LLM completions or RAG answers, or building a cache-aside layer in front of providers such as OpenAI or Anthropic. It also fits teams tuning hit rate against precision or splitting LLM workloads across several caches. LangCache is in preview on Redis Cloud, so behavior may change.

How does redis-semantic-cache compare with other AI agent skills?

It sits in the AI Agents & LLM Apps category alongside microsoft-foundry, azure-ai and several Google agent skills. This skill is specific to Redis LangCache, covering cache-aside lookups and similarity threshold tuning.

More from redis/agent-skills

All 6

Similar to Redis Semantic Cache

More AI Agents & LLM Apps