Agent skill · Databases

semantic-caching

Redis semantic caching for LLM applications. Use when implementing vector similarity caching, optimizing LLM costs through cached responses, or building multi-level cache hierarchies.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill semantic-caching --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 4 KB
Bundled scripts: none
Version: 1.0.0
Declared author: SkillForge
Path: skills/ai-llm/semantic-caching/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Semantic Caching Cache LLM responses by semantic similarity. ## Cache Hierarchy ``` Request → L1 (Exact) → L2 (Semantic) → L3 (Prompt) → L4 (LLM) ~1ms ~10ms ~2s ~3s 100% save 100% save 90% save Full cost ``` ## Redis Semantic Cache ```python from redisvl.index import SearchIndex from redisvl.query import VectorQuery class SemanticCacheService: def __init__(self, redis_url: str, threshold: float = 0.92): self.client = Redis.from_url(redis_url) self.threshold = threshold async def get(self, content: str, agent_type: str) -> dict | None: embedding = await embed_text(content[:2000]) query = VectorQuery( vector=embedding, vector_field_name="embedding", filter_expression=f"@agent_type:{{{agent_type}}}", num_results=1 ) results = self.index.query(query) if results: distance = float(results[0].get("vector_distance", 1.0)) if distance <= (1 - self.threshold): return json.loads(results[0]["response"]) return None async def set(self, content: str, response: dict, agent_type: str): embedding = await embed_text(content[:2000]) key = f"cache:{agent_type}:{hash_content(content)}" self.client.hset(key, mapping={ "agent_type": agent_type, "embedding": embedding, "response": json.dumps(response),

What's inside
Steps it walks through
  1. Cache Hierarchy
  2. Redis Semantic Cache
  3. Similarity Thresholds
  4. Multi-Level Lookup
  5. Key Decisions
  6. Common Mistakes
  7. Related Skills
  8. Capability Details
  9. redis-vector-cache
  10. similarity-threshold
  11. skillforge-integration
  12. cache-service
Ships with 1 file
  • metadata.json
More from claude-skill-registry
All skills →
About this skill
What does the semantic-caching skill do?

Redis semantic caching for LLM applications. Use when implementing vector similarity caching, optimizing LLM costs through cached responses, or building multi-level cache hierarchies.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill semantic-caching --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going