Skip to main content

Module response_cache

Module response_cache 

Source
Expand description

LLM Response Cache โ€” avoid burning tokens on repeated prompts.

Stores LLM responses in a separate SQLite table keyed by a SHA-256 hash of (model, system_prompt_hash, user_prompt). Entries expire after a configurable TTL. The cache is optional and disabled by default โ€” users opt in via TANDEM_RESPONSE_CACHE_ENABLED=true.

Lives alongside memory.sqlite as response_cache.db so it can be independently wiped without touching memory chunks.

Structsยง

ResponseCache
Response cache backed by a dedicated SQLite database.