Change the analysis, reuse the AI results
Suppose you want to identify product failures in Amazon reviews, then count how often they appear. Both queries below classify the same ten short reviews with the same prompt and output schema. Only the final analysis changes.- Inspect the reviews
- Count the results
reviews CTE fixes the logical input records before inference; it does not materialize a saved table. Cached classifications supply the product_failed column, while the second query executes its grouping and count over that column.
What Chowder reuses
Reuse is automatic. You do not need to create a cache table or write a special SQL clause. Error results are not retained as successful AI responses. An
infer result whose confidence couldn’t be computed isn’t cached either, so a later query retries it. Entries that exceed the cache budget may be left uncached without preventing the query from returning its result.
For document and media readers, a limited or interrupted query does not guarantee a reusable complete-source entry. Source verification may still require reading data even when processing results are cached. A compatible complete-media hit can replay frames and transcripts together without repeating decoding or transcription.
When work runs again
Changing the prompt, model, input content, or requested output schema changes the inference operation. Existing results for the old operation do not answer the new one. Parser revisions and media processing settings similarly affect reuse. Changing a downstream aggregation does not itself change an inference result. Adding more input rows computes results for missing inputs while eligible existing results remain reusable. Clearing, eviction, or unavailable entries means the affected work runs again. This is reuse of expensive operations, rather than a cache of arbitrary SQL result tables. File scans, joins, filters, sorting, and aggregations still execute as required by the query.Reuse nearest-neighbor indexes
Chowder’s optimized nearest-neighbor operators build ephemeral indexes over embedding columns on demand for analytical queries and can reuse eligible indexes within the same engine session. The indexes are held in the calling engine’s memory and are not persisted across engine sessions. Repeated queries over unchanged, pointer-stable in-memory embedding columns can avoid rebuilding the index, including when the requested neighbor count changes. Index reuse has a separate, bounded memory cache. It depends on the same source embedding buffers remaining available; do not assume reuse across fresh file scans or different engines. An oversized index may be rebuilt if it cannot be admitted to the memory budget. See Nearest-neighbor joins for the optimized lateral SQL pattern and execution modes.Configure and inspect the result cache
Caching is enabled automatically. Usecache_dir when you want engines to share a specific local result-cache directory:
Engine, including when processing runs on a self-hosted server or Chowder Cloud. Durable result-cache ownership stays with your application when you offload AI compute.
Reuse still requires matching input, model, and processing identities when you change compute destinations. See Architecture for the application and server boundaries.
An existing result-cache root retains its stored budget unless you explicitly configure a new one. The result-cache budget governs retained result payloads; it is not a total disk or process-memory limit.
Results, models, and tokenizers have different lifetimes
Downloaded model weights and runtime binaries are retained separately from query results. Loaded tokenizers and resident model runtimes also have their own reuse rules. For example,tokens() can reuse a loaded tokenizer, but this does not mean every text’s token count is stored in the durable result cache.
To remove cached results while preserving downloaded models and runtime artifacts:
clear_cache() clears durable results; it does not clear the in-memory nearest-neighbor index cache or unload running models. clear_cache(artifacts=True) also removes Chowder-owned downloaded artifacts, so later use may need to download or rebuild them. Neither form clears the third-party Hugging Face cache.
See Core concepts for the columnar data model, Architecture for execution and scheduling, and Configuration for cache settings.