cache_set
Store a prompt/response pair to reuse later. After a cache miss, save the fresh model response; related content is automatically linked for similarity queries.
Instructions
Store a prompt/response pair in the cache. Call this AFTER getting a fresh response from a model that cache_get did not have. New entries are automatically linked in a similarity graph to existing entries with related content, so cache_related and cache_query can surface them later even without an exact key match. Pass derived_from with parent entry ids if this result was built from other cached entries — invalidating a parent with cascade can then clean up anything derived from it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| model | Yes | ||
| params | No | ||
| prompt | Yes | ||
| response | Yes | The response text to cache | |
| ttl_seconds | No | Freshness lifetime in seconds. null = never expires. Default: 1 day | |
| derived_from | No | Ids of parent entries this was built from | |
| stale_while_revalidate_seconds | No | Extra window after TTL expiry where the entry is still returned, marked stale |