This skill should be used when the user asks to "enable semantic caching", "cache LLM responses", "reduce API costs", "speed up AI responses", "configure LangCache", "search the semantic cache", "store responses in cache", or mentions Redis LangCache, semantic similarity caching, or LLM response caching. Provides integration with Redis LangCache managed service for semantic caching of prompts and responses.
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install openclaw-langcache或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install openclaw-langcache⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/openclaw-langcache/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: langcache description: This skill should be used when the user asks to "enable semantic caching", "cache LLM responses", "reduce API costs", "speed up AI responses", "configure LangCache", "search the semantic cache", "store responses in cache", or mentions Redis LangCache, semantic similarity caching, or LLM response caching. Provides integration with Redis LangCache managed service for semantic caching of prompts and responses. version: 1.0.0 tools: Read, Bash, WebFetch ---
This skill integrates Redis LangCache, a fully-managed semantic caching service, into OpenClaw workflows. LangCache stores LLM prompts and responses, returning cached results for semantically similar queries to reduce costs and latency.
Before using LangCache, ensure the following environment variables are configured:
LANGCACHE_HOST=<your-langcache-host>
LANGCACHE_CACHE_ID=<your-cache-id>
LANGCACHE_API_KEY=<your-api-key>
Store these in ~/.openclaw/secrets.env or configure them in the OpenClaw settings.
Before calling an LLM, check if a semantically similar response exists:
./scripts/langcache.sh search "What is semantic caching?"
With similarity threshold (0.0-1.0, higher = stricter match):
./scripts/langcache.sh search "What is semantic caching?" --threshold 0.95
With attribute filtering:
./scripts/langcache.sh search "What is semantic caching?" --attr "model=gpt-5"
After receiving an LLM response, cache it for future use:
./scripts/langcache.sh store "What is semantic caching?" "Semantic caching stores responses based on meaning similarity..."
With attributes for filtering/organization:
./scripts/langcache.sh store "prompt" "response" --attr "model=gpt-5" --attr "user_id=123"
By entry ID:
./scripts/langcache.sh delete --id "<entry-id>"
By attributes:
./scripts/langcache.sh delete --attr "user_id=123"
Clear all entries (use with caution):
./scripts/langcache.sh flush
The recommended pattern for integrating LangCache into agent workflows:
1. Receive user prompt
2. Search LangCache for similar cached response
3. If cache hit (similarity >= threshold):
- Return cached response immediately
- Log cache hit for observability
4. If cache miss:
- Call LLM API
- Store prompt + response in LangCache
- Return LLM response
This policy is enforced automatically. All cache operations MUST respect these rules.
| Category | Examples | Threshold | |----------|----------|-----------| | Factual Q&A | "What is X?", "How does Y work?" | 0.90 | | Definitions / docs / help text | API docs, command help, explanations | 0.90 | | Command explanations | "What does git rebase do?" | 0.92 | | Reusable reply templates | "polite no", "follow-up", "scheduling", "intro" | 0.88 | | Style transforms | "make this warmer/shorter/firmer" | 0.85 | | Generic communication scripts | negotiation templates, professional responses | 0.88 |
These patterns are blocked at the code level - cache operations will refuse to store them.
| Category | Patterns to Detect | Reason | |----------|-------------------|--------| | Temporal info | today, tomorrow, this week, deadline, ETA, "in X minutes", appointments, schedules | Stale immediately | | Credentials | API keys, tokens, passwords, OTP, 2FA codes, secrets | Security risk | | Identifiers | phone numbers, emails, addresses, account IDs, order numbers, message IDs, chat IDs, JIDs | Privacy / PII | | Personal context | names + relationships, private history, "who said what", specific conversations | Privacy / context-dependent |
The following regex patterns trigger a hard block:
# Temporal
\b(today|tomorrow|tonight|yesterday)\b
\b(this|next|last)\s+(week|month|year|monday|tuesday|...)\b
\b(in\s+\d+\s+(minutes?|hours?|days?))\b
\b(deadline|eta|appointment|schedule[d]?)\b
# Credentials
\b(api[_-]?key|token|password|secret|otp|2fa)\b
\b(bearer|auth[orization]*)\s+\S+
# Identifiers
\b\d{10,}\b # phone numbers, long IDs
\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+ # emails
\b(order|account|message|chat)[_-]?id\b
# Personal context
\b(my\s+(wife|husband|partner|friend|boss|mom|dad|brother|sister))\b
\b(said\s+to\s+me|told\s+me|between\s+us)\b
Use attributes to partition the cache:
model: LLM model used (useful when switching models)category: factual, template, style, commandskill: Which skill generated the responseversion: API or prompt versionLangCache supports two search strategies:
Combine both for hybrid search:
./scripts/langcache.sh search "prompt" --strategy "exact,semantic"
Monitor cache performance:
安装 Langcache Semantic Caching for OpenClaw 后,可以对 AI 说这些话来触发它
Help me get started with Langcache Semantic Caching for OpenClaw
Explains what Langcache Semantic Caching for OpenClaw does, walks through the setup, and runs a quick demo based on your current project
Use Langcache Semantic Caching for OpenClaw to this skill should be used when the user asks to "enable semantic ca...
Invokes Langcache Semantic Caching for OpenClaw with the right parameters and returns the result directly in the conversation
What can I do with Langcache Semantic Caching for OpenClaw in my ai agent & automation workflow?
将技能文件夹放到 ~/.claude/skills/openclaw-langcache/ 目录(个人级,所有项目可用),或 .claude/skills/openclaw-langcache/(项目级)。重启 AI 客户端后,用 /openclaw-langcache 主动调用,或让 AI 根据上下文自动发现并使用。
Langcache Semantic Caching for OpenClaw 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Langcache Semantic Caching for OpenClaw 可免费安装使用。请查阅仓库了解许可证信息。
This skill should be used when the user asks to "enable semantic caching", "cache LLM responses", "reduce API costs", "speed up AI responses", "configure LangCache", "search the semantic cache", "store responses in cache", or mentions Redis LangCache, semantic similarity caching, or LLM response caching. Provides integration with Redis LangCache managed service for semantic caching of prompts and responses.
Lists the top use cases for Langcache Semantic Caching for OpenClaw, with example commands for each scenario
Automate my ai agent & automation tasks using Langcache Semantic Caching for OpenClaw
Identifies repetitive steps in your workflow and sets up Langcache Semantic Caching for OpenClaw to handle them automatically
Langcache Semantic Caching for OpenClaw 属于「AI Agent & Automation」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。