Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

redis-semantic-cache

Skill by redis

Guides AI assistants through semantic caching of LLM responses with Redis LangCache on Redis Cloud. Useful for developers who want to cut LLM API cost and latency by reusing answers to similar prompts.

  • Score 82
  • 176 stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install redis-semantic-cache

Built from the published package, never by AI.

git clone --depth 1 https://github.com/redis/agent-skills /tmp/agent-skills && mkdir -p ~/.claude/skills && cp -r /tmp/agent-skills/skills/redis-semantic-cache ~/.claude/skills/redis-semantic-cache

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install redis-semantic-cache in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

This skill gives AI assistants guidance for semantic caching of LLM responses using LangCache on Redis Cloud. It stores prompts as embeddings, so semantically similar later prompts return a cached response instead of calling the model again. The guidance covers the cache-aside flow, where a search runs first and a set stores the response after a miss.

The skill explains how to call search and set through the SDK or the REST API, and how to tune the similarity threshold between 0.8 and 0.95. It recommends separate caches per task type, or custom attributes for filtering within one cache. It is aimed at developers caching OpenAI, Anthropic or similar LLM calls, RAG answers or classification outputs to reduce API cost and latency. LangCache is in preview, so behavior may change.

Written from the project's SKILL.md and checked against it.

What it can do

  • Cache-aside flowShows how to search the cache first, then call the LLM and store the response on a miss.
  • Search and set callsCovers calling search and set through the LangCache SDK or REST API.
  • Similarity threshold tuningExplains how the threshold trades hit rate against precision, with suggested values.
  • Separate caches per task typeAdvises using distinct cache IDs for different LLM workloads.
  • Attribute-based filteringDescribes storing and searching with custom attributes to isolate subtopics in one cache.

What you need

  • Redis Cloud account with a LangCache cache
  • LangCache API key and cache ID
  • Python with the LangCache SDK, as shown in the examples

Try asking

  • Add a LangCache cache-aside layer in front of my OpenAI calls.
  • Help me choose a similarity threshold for my FAQ cache.
  • Split my app's LLM prompts into separate caches for support and code.

Good to know

  • LangCache is in preview on Redis Cloud and behavior may change.
  • Lower similarity thresholds raise hit rate but risk off-topic answers.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: skills/redis-semantic-cache/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md4 KB
  • references/best-practices.md2 KB
  • references/langcache-usage.md2 KB

Alternatives to redis-semantic-cache

All alternatives →
hugging-face-datasetssickn33
94

Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.

AAA Skill 50k
db-repairgarrytan
94

Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.

AAA Skill 34k
alloydb-basicsgoogle
94

Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.

AAA Skill 26k
clickhouse-logs-queriessupabase
94

Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.

AAA Skill 116k
fix-slow-queriespaperclipai
94

Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.

AAA Skill 119k
prisma-8prisma
94

Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.

AAA Skill 48k

Compare with hugging-face-datasets, db-repair or alloydb-basics

redis-semantic-cache: common questions

What does the similarity threshold do in LangCache?

It sets how close a new prompt must be in embedding cosine distance to a cached prompt to count as a hit. Higher values require stricter matches and produce fewer false positives.

Should I use one cache or several for LLM workloads?

The source recommends separate caches per task type, since unrelated prompts can return wrong answers if they share a cache. Custom attributes can also isolate tasks within one cache.

Can I use LangCache without an SDK?

Yes. The source says the search and set operations are available through the REST API at the cache entries endpoints.

How do I install redis-semantic-cache?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is redis-semantic-cache free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is redis-semantic-cache safe to use?

It scores 82 of 100. Grades: maintenance A, licence A, quality B. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to redis-semantic-cache?

Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.

redis-semantic-cache Install

Add to stack

Loading.