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.
npx skills add majiayu000/claude-skill-registry --skill semantic-caching --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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),
- Cache Hierarchy
- Redis Semantic Cache
- Similarity Thresholds
- Multi-Level Lookup
- Key Decisions
- Common Mistakes
- Related Skills
- Capability Details
- redis-vector-cache
- similarity-threshold
- skillforge-integration
- cache-service
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.
