# Send Langcache Semantic Caching for OpenClaw to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-langcache",
    "name": "Langcache Semantic Caching for OpenClaw",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/manvinder01/openclaw-langcache",
    "canonicalUrl": "https://clawhub.ai/manvinder01/openclaw-langcache",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/openclaw-langcache",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-langcache",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/langcache.sh",
      "examples/basic-caching.sh",
      "examples/agent-integration.py",
      "references/best-practices.md",
      "references/api-reference.md"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "openclaw-langcache",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-04T20:41:22.535Z",
      "expiresAt": "2026-05-11T20:41:22.535Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-langcache",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-langcache",
        "contentDisposition": "attachment; filename=\"openclaw-langcache-1.0.0.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "openclaw-langcache"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openclaw-langcache"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openclaw-langcache",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-langcache",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-langcache/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-langcache/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-langcache/agent.md"
  }
}
```
## Documentation

### Redis LangCache Semantic Caching

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.

### Prerequisites

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.

### Search for Cached Response

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"

### Store New Response

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"

### Delete Cached Entries

By entry ID:

./scripts/langcache.sh delete --id "<entry-id>"

By attributes:

./scripts/langcache.sh delete --attr "user_id=123"

### Flush Cache

Clear all entries (use with caution):

./scripts/langcache.sh flush

### Integration Pattern

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

### Default Caching Policy

This policy is enforced automatically. All cache operations MUST respect these rules.

### CACHEABLE (white-list)

CategoryExamplesThresholdFactual Q&A"What is X?", "How does Y work?"0.90Definitions / docs / help textAPI docs, command help, explanations0.90Command explanations"What does git rebase do?"0.92Reusable reply templates"polite no", "follow-up", "scheduling", "intro"0.88Style transforms"make this warmer/shorter/firmer"0.85Generic communication scriptsnegotiation templates, professional responses0.88

### NEVER CACHE (hard blocks)

These patterns are blocked at the code level - cache operations will refuse to store them.

CategoryPatterns to DetectReasonTemporal infotoday, tomorrow, this week, deadline, ETA, "in X minutes", appointments, schedulesStale immediatelyCredentialsAPI keys, tokens, passwords, OTP, 2FA codes, secretsSecurity riskIdentifiersphone numbers, emails, addresses, account IDs, order numbers, message IDs, chat IDs, JIDsPrivacy / PIIPersonal contextnames + relationships, private history, "who said what", specific conversationsPrivacy / context-dependent

### Detection Patterns

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

### Attribute Strategies

Use attributes to partition the cache:

model: LLM model used (useful when switching models)
category: factual, template, style, command
skill: Which skill generated the response
version: API or prompt version

### Search Strategies

LangCache supports two search strategies:

semantic (default): Vector similarity matching
exact: Case-insensitive exact match

Combine both for hybrid search:

./scripts/langcache.sh search "prompt" --strategy "exact,semantic"

### Observability

Monitor cache performance:

Track hit/miss ratios
Log similarity scores for hits
Alert on high miss rates (may indicate threshold too high)
Review stored entries periodically for relevance

### References

API Reference - Complete REST API documentation
Best Practices - Optimization techniques

### Examples

examples/basic-caching.sh - Simple cache workflow
examples/agent-integration.py - Python integration pattern
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: manvinder01
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-04T20:41:22.535Z
- Expires at: 2026-05-11T20:41:22.535Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/openclaw-langcache)
- [Send to Agent page](https://openagent3.xyz/skills/openclaw-langcache/agent)
- [JSON manifest](https://openagent3.xyz/skills/openclaw-langcache/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/openclaw-langcache/agent.md)
- [Download page](https://openagent3.xyz/downloads/openclaw-langcache)