Skip to main content

Module cache

Module cache 

Source
Expand description

Result caching for tool output.

Large tool results are stored out-of-context and replaced with a compact summary + preview. Agents retrieve slices on demand via a result_cache tool, keeping the context window small while preserving full data access.

§Architecture

ToolResultProcessor → ResultCache::store() → CacheBackend (Text, …)
                                 ↕
                    result_cache tool → CacheBackend::execute()

The CacheBackend trait is the extension point. Each backend knows how to store one kind of data and expose operations on it. The ResultCache manages entries, expiration, and disk budget.

Structs§

CacheEntry
A single cached tool result.
CacheStats
Statistics about a cached result.
ResultCache
Manages cached tool results with expiration and disk budgets.
ResultCacheConfig
Configuration for the result cache.
TextBackend
A cache backend backed by a plain text file.

Enums§

BackendKind
The kind of backend storing a cached result.
CacheError
Errors from cache operations.
CacheOp
Operations that can be performed on a cached result.

Traits§

CacheBackend
A backend that stores and operates on one cached result.