Is Cache automatically handled by LangGraph API? + CachePolicy question

Hey team,

Is Cache automatically handled by LangGraph API? Same as store and checkpointer?

Also, I’d like to cache based on the one key only that is pass to the node. How can I do this? I tried with key_func but had errors.

async def get_user_data(state: SupervisorState) -> Dict[str, Any]:

I want to use node caching on get_user_data but only based on the user_uuid that is passed via the state.

What is the right approach?

Hi! LangGraph supports caching per Node. You can see docs here. You can use key_func to specify caching per key.