{"record":{"id":"e08a7653eb1eaeb0","repo":"langchain-ai/langgraph","slug":"cache-is-only-available-server-side-within-the-lan","errorCode":null,"errorMessage":"Cache is only available server-side within the LangGraph Agent Server (https://docs.langchain.com/langgraph/deployments).","messagePattern":"Cache is only available server-side within the LangGraph Agent Server \\(https://docs\\.langchain\\.com/langgraph/deployments\\)\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/cache.py","lineNumber":67,"sourceCode":"\n\n__all__ = [\n    \"SWRResult\",\n    \"cache_get\",\n    \"cache_set\",\n    \"swr\",\n]\n\n\nasync def cache_get(key: str) -> Any | None:\n    \"\"\"Get a value from the cache.\n\n    Returns the deserialized value, or ``None`` if the key is missing or expired.\n\n    Requires Agent Server runtime version 0.7.29 or later.\n    \"\"\"\n    if _cache_get is None:\n        raise RuntimeError(\n            \"Cache is only available server-side within the LangGraph Agent Server \"\n            \"(https://docs.langchain.com/langsmith/deployments).\"\n        )\n    return await _cache_get(key)\n\n\nasync def cache_set(key: str, value: Any, *, ttl: timedelta | None = None) -> None:\n    \"\"\"Set a value in the cache.\n\n    Args:\n        key: The cache key.\n        value: The value to cache (must be JSON-serializable).\n        ttl: Optional time-to-live. Capped at 1 day; ``None`` or zero\n            defaults to 1 day.\n\n    Requires Agent Server runtime version 0.7.29 or later.\n    \"\"\"\n    if _cache_set is None:","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/cache.py#L49-L85","documentation":"Error \"Cache is only available server-side within the LangGraph Agent Server (https://docs.langchain.com/langgraph/deployments).\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/cache.py:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}