Skip to main content

Resources

Resources are what DIAL Core stores for users and applications: files, conversations, prompts, applications, toolsets, and folder-like resources such as skills and projects. Core can hold a changed resource in Redis and write it back to blob storage later. These static settings set size limits, caching, the sync from Redis to blob storage, and the cleanup of folder-like resources. This page is for platform engineers who size Redis and blob storage.

For what "accepted" and "persisted" mean for a write, see State and data lifecycle.

Size, cache, and sync​

SettingDefaultDescription
resources.maxSize67108864The maximum size of a resource, in bytes.
resources.maxSizeToCache1048576The maximum size of a resource that Core caches in Redis, in bytes.
resources.syncPeriod60000How often Core checks for resources to sync to blob storage, in milliseconds.
resources.syncDelay120000How long after its last change a resource is written back to blob storage, in milliseconds.
resources.syncBatch4096How many resources Core syncs in one go.
resources.cacheExpiration300000How long a synced resource stays in Redis, in milliseconds.
resources.compressionMinSize256Core compresses a resource with gzip when its size is at least this many bytes.

A resource changed within resources.syncDelay may not be in blob storage yet. Plan Redis durability with that window in mind; see Backup and restore.

Expiration per resource type​

resources.resourceTypesExpiration sets the expiration per resource type, in milliseconds.

SettingDefault
resources.resourceTypesExpiration.FILE5 minutes
resources.resourceTypesExpiration.CONVERSATION5 minutes
resources.resourceTypesExpiration.PROMPT5 minutes
resources.resourceTypesExpiration.APPLICATION30 days
resources.resourceTypesExpiration.TOOL_SET30 days
resources.resourceTypesExpiration.RULES30 days (public access rules)

Folder-like resources​

Skills and projects are stored as folders of files. Core enforces these limits on a whole-resource PUT and on a single-file PUT. A request over a limit is rejected and nothing is written. The limits also bound listing reads, ZIP download size, and how long a change holds the resource lock: a single-file PUT copies the whole current version under the lock.

SettingDefaultDescription
complexResource.maxFiles100The maximum number of files in one resource.
complexResource.maxTotalBytes16777216The maximum combined size of all files in one resource, in bytes.
complexResource.maxFileSizeBytes1048576The maximum size of one file in a resource, in bytes.
complexResource.types.<group>See belowAn override per URL group (skills, projects) with any of maxFiles, maxTotalBytes, and maxFileSizeBytes. Unset fields fall back to the values above.

The built-in projects override allows 1000 files, 67108864 bytes in total, and 5242880 bytes per file. Setting complexResource.types replaces it.

Cleanup sweep​

A periodic job reclaims storage for folder-like resources. It finishes deleting resources that were deleted, and removes stale versions left behind by a failed or interrupted write.

SettingDefaultDescription
complexResourceSweep.period10000The time between sweeps, in milliseconds.
complexResourceSweep.batch1000How many references a sweep lists, and can process, per batch.
complexResourceSweep.activeBatches5The maximum number of batches one Core instance processes in parallel. The limit is per instance, not across the cluster.
complexResourceSweep.gracePeriod3600000The minimum age, in milliseconds, of a deleted resource or a replaced version before the sweep deletes it. It protects readers that started before the change.

Example​

{
"resources": {
"maxSize": 67108864,
"syncDelay": 120000,
"resourceTypesExpiration": {
"FILE": 300000
}
},
"complexResource": {
"types": {
"skills": { "maxFiles": 200 }
}
}
}

The bundled defaults also set resources.heartbeatPeriod to 60000; the Core documentation does not describe it.

Further reading​