convex-dev-action-cache

Cache successful AI and third-party API results in Convex actions.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/jcdiv47/cool-paper --skill convex-dev-action-cache
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convex-dev-action-cache
Source: https://github.com/jcdiv47/cool-paper/tree/main/.claude/skills/convex-dev-action-cache
Command: npx skills add https://github.com/jcdiv47/cool-paper --skill convex-dev-action-cache

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates repeated expensive AI and third-party API calls in Convex actions by storing successful results with configurable TTL, reducing latency and API costs.

Core Features & Use Cases

  • Transparent Caching: Wrap expensive action logic so identical inputs return cached results instead of re-running slow operations.
  • Configurable TTL & Invalidation: Set expiration per namespace and manually invalidate entries when external data changes.
  • Error-safe Storage: Only successful results are cached; errors propagate and are not stored to avoid poisoning the cache.
  • Use Case: Cache OpenRouter/LLM responses or third-party API results in Convex backend actions to lower cost and improve response times.

Quick Start

Use the convex-dev-action-cache component to cache an AI API response inside a Convex action with a configurable TTL so repeated requests return instantly.

Frequently Asked Questions about convex-dev-action-cache

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I cache AI API responses in Convex actions to reduce costs?

Cache AI API responses in Convex by wrapping expensive action logic with a caching layer that stores successful results using deterministic keys derived from input parameters, returning cached data for identical requests instead of re-running operations.

Can I set a custom TTL for cached Convex action results?

Yes, you can set a configurable TTL for cached Convex action results on a per-namespace basis. This allows you to control how long expensive AI or third-party API responses persist before expiring and triggering a fresh request.

Does the Convex action cache store failed API responses?

No, the Convex action cache avoids storing failed API responses to prevent cache poisoning. Only successful results are persisted, while errors propagate normally without being cached in the Convex backend.

How do I manually invalidate cached data in Convex when external data changes?

You can manually invalidate cached Convex action entries to clear stored results when external data changes. This manual invalidation support works alongside configurable TTLs to ensure cached AI API responses stay accurate.

What is the best way to avoid redundant LLM API calls in a Convex backend?

The best way to avoid redundant LLM API calls in a Convex backend is to apply a transparent caching layer that generates deterministic cache keys from input parameters, instantly returning previously stored successful results for repeated requests.