Open your agent in the console and select Functions, then open the Caches tab.
This page documents the Caches tab. Related pages:
What a cache does
A cache stores a structured value for a fixed amount of time.
Caches are used for two main purposes:
- store Function results for reuse
- store tokens generated by a JSON Web Token configuration
Caches tab
The tab shows a table with these columns:
NameDescriptionCache IDTTL
Available actions:
CreateValueEditDelete
Create or edit a cache
Select Create or Edit to open the cache modal.
Name
Use a short, descriptive name.
Recommended style:
- lowercase
- underscores between words
Examples:
order_status_cacheacme_api_jwtcrm_lookup_cache
Description
Description is required.
Use it to explain exactly what the cache is for. Keep it clear enough that an operator can tell it apart from other caches at a glance.
Good examples:
Most recent order status lookup resultBearer token for Acme service requestsLatest CRM contact lookup result
TTL
TTL is the cache lifetime in seconds.
Use shorter TTLs when the value changes frequently. Use longer TTLs when the value is expensive to regenerate and can safely be reused.
View a cache value
Select Value to open the current cache contents in a read-only viewer.
If the cache does not currently contain a value, the viewer shows an empty state.
The UI does not provide a direct way to edit a cache value manually.
How caches work with Functions
When you select a cache in a Function:
- Leilani checks that cache before running the Function.
- If the cache has a current value, Leilani can return that value instead of running the Function again.
- If the cache is empty or expired, the Function runs normally.
- The new result is stored in the cache.
This is useful for:
- repeated lookups
- integrations with expensive or rate-limited backends
- data the agent may need again during later calls
If a Function uses Hide function output, the result can still be stored in the cache.
How caches work with JSON Web Tokens
Each JSON Web Token writes its signed token into a selected cache.
That means:
- the cache TTL controls the token lifetime
- Functions can rely on that cache when they need a current token
Use a dedicated cache for each token.
Cache design rules
Use one cache per purpose.
Do not reuse the same cache for unrelated data.
In particular:
- do not use a JWT cache as a Function result cache
- do not use one cache for several unrelated integrations
Operator guidance
- Name caches by purpose, not by implementation detail.
- Write descriptions that make the intended use obvious.
- Use a separate cache for credentials and a separate cache for Function results.
- Choose TTL values that match the freshness requirements of the integration.
Limitations and notes
- Cache values are view-only in the current UI.
- Cache IDs are shown in the table so you can identify the exact cache when reviewing configurations.