Official agent skill

Redis Semantic Cache

by redis in redis/agent-skills

Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search/set via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and…

OfficialMITAuto-check passedDatabases

Install Redis Semantic Cache

skills CLI
$ npx skills add redis/agent-skills --skill redis-semantic-cache -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install redis/agent-skills redis-semantic-cache --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/redis/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/redis-semantic-cache .claude/skills/redis-semantic-cache && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
redis-semantic-cache
GitHub stars
165
Used in
1 other repo
Token cost
~1k tokens
SKILL.md length
349 words
Files
3 (incl. references)
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search/set via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and…

  • Works in 3 steps: The cache-aside flow → Tune the similarity threshold → Separate caches per task type
  • Caching LLM completions
  • SKILL.md covers When to apply, 1. The cache-aside flow, 2. Tune the similarity threshold and 3. Separate caches per task type, plus 1 more section
  • Needs API_KEY

What it does

Redis Semantic Cache is an agent skill from redis/agent-skills, published by the product's own GitHub organization. Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search/set via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and filtering with custom attributes. Use when caching LLM completions or RAG answers to cut API cost and latency, building a cache-aside layer in front of OpenAI / Anthropic / etc., tuning hit rate vs precision, or splitting one app's LLM workloads into multiple LangCache caches.

Its SKILL.md is about 1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/best-practices.md` and `references/langcache-usage.md`).

It sits in Databases, covering Caching, REST APIs and Retrieval-augmented generation. It works with Redis and OpenAI. The repository describes itself as: Redis' official collection of agent skills. The licence is MIT.

When your agent uses it

  • Caching LLM completions
  • RAG answers to cut API cost and latency
  • Building a cache-aside layer in front of OpenAI / Anthropic / etc.
  • Tuning hit rate vs precision

Example prompts

  • “/redis-semantic-cache”

Requirements

  • Python 3
  • A credential in API_KEY

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. The cache-aside flow
  2. Tune the similarity threshold
  3. Separate caches per task type

What it can do on your machine

Read from SKILL.md and the folder at commit a84871d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • redis.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Redis Semantic Cache loads about 1k tokens when it runs, and up to ~2k if it reads all its reference files. Until then it costs about 123 tokens; SKILL.md has 349 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~123
When it runs · the whole SKILL.md, loaded when a task matches
~1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from redis/agent-skills at commit a84871d, republished under its MIT licence (© redis). 349 words, ~1,022 tokens.

Download SKILL.mdSave it as .claude/skills/redis-semantic-cache/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
redis-semantic-cache
description
Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search/set via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and filtering with custom attributes. Use when caching LLM completions or RAG answers to cut API cost and latency, building a cache-aside layer in front of OpenAI / Anthropic / etc., tuning hit rate vs precision, or splitting one app's LLM workloads into multiple LangCache caches.
license
MIT
metadata.author
Redis, Inc.
metadata.version
0.1.0

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.
python
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"),
)

result = lang_cache.search(prompt="What is Redis?", similarity_threshold=0.9)
if result:
    response = result[0]["response"]
else:
    response = llm.generate("What is Redis?")
    lang_cache.set(prompt="What is Redis?", response=response)

The same operations are available via REST (POST /v1/caches/{cacheId}/entries/search and POST /v1/caches/{cacheId}/entries) when an SDK isn't an option.

See references/langcache-usage.md for full SDK + REST samples and attribute-based storage.

2. Tune the similarity threshold

The threshold controls how close (in embedding cosine distance) a new prompt must be to a cached one to count as a hit. Higher = stricter match, fewer false positives. Lower = more hits, more risk of returning an off-topic answer.

ThresholdBehaviorUse when
0.95+Near-exact match requiredCustomer-facing answers where wrong responses are costly
0.9Balanced defaultMost workloads — start here
0.8Loose semantic matchInternal tools, exploratory queries, FAQ deduplication
python
# Stricter — fewer false positives
result = lang_cache.search(prompt="What is Redis?", similarity_threshold=0.95)

# Looser — higher hit rate
result = lang_cache.search(prompt="What is Redis?", similarity_threshold=0.8)

Adjust by watching the actual cache-hit rate and spot-checking that returned answers are still relevant.

See references/best-practices.md.

3. Separate caches per task type

Different LLM workloads should not share one cache — a "code question" prompt is semantically close to other code questions but has nothing to do with a password-reset support query, and crossing them returns garbage.

python
support_cache = LangCache(server_url=..., cache_id="support-cache-id", api_key=...)
code_cache    = LangCache(server_url=..., cache_id="code-cache-id",    api_key=...)

Create distinct cache IDs in Redis Cloud per task, and route each call to the right one. As a finer-grained alternative, store and search with custom attributes (e.g. {"category": "database"}) to keep tasks in the same cache but isolated by attribute filter — useful when the same prompt format spans subtopics.

References

© redis, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/redis-semantic-cache of redis/agent-skills.

  • SKILL.md
  • references/best-practices.md
  • references/langcache-usage.md

Open the folder on GitHubat commit a84871d

Used in 1 other repository

We found 3 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in redis/agent-skills, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Redis Semantic Cache next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Redis Semantic Cache compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Redis Semantic Cache this skillredis/agent-skills1651 repos~1kAutomated safety check: PassMIT
Upstash Redis Kvintellectronica/agent-skills295—~2.8kAutomated safety check: WarnCC0-1.0
Cohesivityaiskillstore/marketplace4302 repos~3.7kAutomated safety check: PassNone
Caching Architecturemajiayu000/litellm-rs116—~2kAutomated safety check: PassMIT
Configure REST Cachestrapi-community/plugin-rest-cache155—~1.1kAutomated safety check: PassMIT
Commandkit Cacheneplexlabs/commandkit165—~506Automated safety check: PassMIT

Similar skills

  • Upstash Redis Kv

    intellectronica/agent-skills

    Read and write to Upstash Redis-compatible key-value store via REST API.

    295 GitHub stars~2.8k tokensUpdated 5 mo ago
    DatabasesAuto-check: warnings
  • Cohesivity

    aiskillstore/marketplace

    Backend and infra for a project via Cohesivity (cohesivity.ai).

    430 GitHub starsUsed in 2 repos~3.7k tokens
    Productivity & AutomationAuto-check passed
  • Caching Architecture

    majiayu000/litellm-rs

    LiteLLM-RS response caching architecture. An agent skill from majiayu000/litellm-rs.

    116 GitHub stars~2k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Configure REST Cache

    strapi-community/plugin-rest-cache

    Choose and write a Strapi REST Cache configuration for a specific use case.

    155 GitHub stars~1.1k tokensUpdated 9 days ago
    DatabasesAuto-check passed
  • Commandkit Cache

    neplexlabs/commandkit

    Implement deterministic caching with @commandkit/cache. An agent skill from neplexlabs/commandkit.

    165 GitHub stars~506 tokensUpdated 10 days ago
    DatabasesAuto-check passed
  • Redis

    sickn33/agentic-awesome-skills

    Configure Redis for caching and data storage. An agent skill from sickn33/agentic-awesome-skills.

    47k GitHub starsUsed in 2 repos~2.6k tokens
    DatabasesAuto-check: notes

More from redis/agent-skills

All 8 skills in this repo
  • Redis Core

    redis/agent-skills

    Official

    Core Redis modeling guidance — choose the right data structure (String, Hash, List, Set, Sorted Set, JSON, Stream, Vector Set) and use consistent colon-separated key names.

    165 GitHub starsUsed in 2 repos~759 tokens
    Auto-check passed
  • Redis Observability

    redis/agent-skills

    Official

    Redis observability guidance — which metrics to monitor (memory, connections, hit ratio, ops/sec, rejected connections), which built-in commands to reach for during incident triage (SLOWLOG, INFO…

    165 GitHub starsUsed in 2 repos~911 tokens
    Auto-check passed
  • Redis Clustering

    redis/agent-skills

    Official

    Redis Cluster and replication guidance covering hash tags for multi-key operations, avoiding CROSSSLOT errors, and reading from replicas to scale read-heavy workloads.

    165 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Redis Connections

    redis/agent-skills

    Official

    Redis client and connection guidance covering connection pooling, multiplexing, pipelining, client-side caching with RESP3, avoiding slow commands (KEYS, SMEMBERS, HGETALL), and tuning socket…

    165 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Redis Search

    redis/agent-skills

    Official

    Redis Search guidance covering FT.CREATE schema design, field type selection (TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR, JSON path), DIALECT 2 query syntax, FT.SEARCH / FT.AGGREGATE / FT.HYBRID…

    165 GitHub starsUsed in 1 repo~2.9k tokens
    Auto-check passed
  • Redis Security

    redis/agent-skills

    Official

    Redis security guidance covering authentication (requirepass and ACL users), TLS, ACL-based least-privilege access control, restricting network exposure via bind and protected-mode, firewall rules…

    165 GitHub starsUsed in 1 repo~918 tokens
    Auto-check passed

Works with

Questions about Redis Semantic Cache

What does Redis Semantic Cache do?

Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search/set via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and…. Redis Semantic Cache is an agent skill from redis/agent-skills, published by the product's own GitHub organization. Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search/set via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and filtering with custom attributes.

When should I use Redis Semantic Cache?

Redis Semantic Cache fits situations like: caching LLM completions; RAG answers to cut API cost and latency; building a cache-aside layer in front of OpenAI / Anthropic / etc; tuning hit rate vs precision.

How do I install Redis Semantic Cache in Claude Code?

Run `npx skills add redis/agent-skills --skill redis-semantic-cache -a claude-code`. Or copy the skill folder (skills/redis-semantic-cache in redis/agent-skills) into .claude/skills/redis-semantic-cache in your project. Claude Code loads it when a task matches its description.

How do I install Redis Semantic Cache in Codex?

Run `npx skills add redis/agent-skills --skill redis-semantic-cache -a codex`. Or copy the skill folder (skills/redis-semantic-cache in redis/agent-skills) into .agents/skills/redis-semantic-cache in your project. Codex loads it when a task matches its description.

Can I use Redis Semantic Cache in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add redis/agent-skills --skill redis-semantic-cache -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/redis-semantic-cache, .gemini/skills/redis-semantic-cache, .github/skills/redis-semantic-cache and .opencode/skills/redis-semantic-cache in your project.

What does Redis Semantic Cache need to run?

Going by SKILL.md and its folder, Redis Semantic Cache needs credentials named API_KEY. Our summary lists: Python 3; A credential in API_KEY.

Does Redis Semantic Cache access the network?

SKILL.md names 1 domain. As links in the text: redis.io. This is read from the text; nothing was executed.

Is Redis Semantic Cache safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Redis Semantic Cache use?

Redis Semantic Cache is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Redis Semantic Cache use?

About 1k tokens (SKILL.md is roughly 4.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 965 tokens, read only when the agent opens those files.

What are the alternatives to Redis Semantic Cache?

Skills that share tags, products or a category with Redis Semantic Cache: Upstash Redis Kv (intellectronica/agent-skills, 295 stars), Cohesivity (aiskillstore/marketplace, 430 stars), Caching Architecture (majiayu000/litellm-rs, 116 stars) and Configure REST Cache (strapi-community/plugin-rest-cache, 155 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Redis Semantic Cache?

redis (a GitHub organization, an official publisher) maintains it in redis/agent-skills, which has 165 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on September 8, 2026.

Source: redis/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.