LangChain's cache is exact-match. Here's the two-line upgrade.
LangChain's built-in caches are great until a user rephrases the question. Swap in a semantic cache and the paraphrases start hitting, without changing a line of your chains.
LangChain ships caching out of the box, and it works, as long as the prompt matches the last one exactly. In the real world it rarely does. Users reword, agents template, and the exact-match cache quietly misses almost everything, sending each variation back to the model at full cost.
from langchain_core.globals import set_llm_cache from crowkis.integrations.langchain import CrowkisCache set_llm_cache(CrowkisCache(tenant="my-app", ttl=3600)) # that's it, rephrased prompts now hit the cache
Nothing else changes. Your chains, your prompts, your models all stay exactly as they are. The only difference is that 'how do I cancel?' and 'where's the cancel button?' now share one answer instead of two bills. It's the smallest possible diff for the biggest slice of your caching wins.
The bottom line
Keep LangChain. Swap the cache. Two lines, and the paraphrases you were paying for turn into cache hits.