npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

openclaw-langcache

v1.0.2

Published

Semantic caching skill for OpenClaw using Redis LangCache

Downloads

681

Readme

@openclaw/langcache

Semantic caching skill for OpenClaw using Redis LangCache.

Reduce LLM costs and latency by caching responses for semantically similar queries, with built-in privacy and security guardrails.

Features

  • Semantic similarity matching - Cache hits for similar (not just identical) queries
  • Hard block enforcement - Automatically blocks caching of sensitive data:
    • Temporal info (today, tomorrow, deadlines, appointments)
    • Credentials (API keys, passwords, tokens, OTP)
    • Identifiers (emails, phone numbers, account IDs)
    • Personal context (relationships, private conversations)
  • Category-aware thresholds - Different similarity thresholds for factual Q&A vs style transforms
  • CLI and Python integration - Use from shell scripts or embed in Python agents

Installation

Via npm (Recommended)

npm install openclaw-langcache

The skill will be automatically installed to your OpenClaw workspace.

Via Git

git clone https://github.com/openclaw/langcache.git ~/.openclaw/workspace/skills/langcache

Manual

Download and extract to ~/.openclaw/workspace/skills/langcache/

Configuration

Add your Redis LangCache credentials to ~/.openclaw/secrets.env:

LANGCACHE_HOST=your-instance.redis.cloud
LANGCACHE_CACHE_ID=your-cache-id
LANGCACHE_API_KEY=your-api-key

Get these from Redis Cloud Console after creating a LangCache instance.

Usage

Automatic (via OpenClaw agent)

The skill triggers automatically when you mention:

  • "cache LLM responses"
  • "semantic caching"
  • "reduce API costs"
  • "configure LangCache"

CLI

# Search for cached response
langcache.sh search "What is Redis?"

# With similarity threshold
langcache.sh search "What is Redis?" --threshold 0.9

# Store a response
langcache.sh store "What is Redis?" "Redis is an in-memory data store..."

# Check if content would be blocked
langcache.sh check "What's on my calendar today?"
# Output: BLOCKED: temporal_info

# Delete entries
langcache.sh delete --id <entry-id>
langcache.sh delete --attr model=gpt-4

Python Integration

from examples.agent_integration import CachedAgent, CacheConfig

agent = CachedAgent(config=CacheConfig(
    enabled=True,
    model_id="gpt-5",
))

# Automatically uses cache with policy enforcement
response = await agent.complete("What is semantic caching?")

Caching Policy

Cacheable (white-list)

| Category | Examples | Threshold | |----------|----------|-----------| | Factual Q&A | "What is X?", "How does Y work?" | 0.90 | | Definitions / docs | API docs, command help | 0.90 | | Command explanations | "What does git rebase do?" | 0.92 | | Reply templates | "polite no", "follow-up", "intro" | 0.88 | | Style transforms | "make this warmer/shorter" | 0.85 |

Never Cached (hard blocks)

| Category | Examples | |----------|----------| | Temporal | today, tomorrow, deadline, ETA, "in 20 minutes" | | Credentials | API keys, passwords, tokens, OTP/2FA | | Identifiers | emails, phone numbers, account IDs, UUIDs | | Personal | "my wife said", private conversations, relationships |

File Structure

skills/langcache/
├── SKILL.md              # Skill definition and instructions
├── scripts/
│   └── langcache.sh      # CLI wrapper with policy enforcement
├── references/
│   ├── api-reference.md  # Complete REST API documentation
│   └── best-practices.md # Optimization techniques
└── examples/
    ├── basic-caching.sh      # Simple cache workflow
    └── agent-integration.py  # Python integration pattern

API Reference

See references/api-reference.md for complete REST API documentation.

Key Endpoints

| Endpoint | Method | Description | |----------|--------|-------------| | /v1/caches/{id}/entries/search | POST | Search for cached response | | /v1/caches/{id}/entries | POST | Store new entry | | /v1/caches/{id}/entries/{entryId} | DELETE | Delete by ID | | /v1/caches/{id}/flush | POST | Clear all entries |

Requirements

  • OpenClaw 2024.1.0+
  • Redis Cloud account with LangCache enabled
  • Node.js 18+ (for npm installation)
  • jq and curl (for CLI usage)

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see LICENSE for details.

Resources