langchain-ai/langgraph · error · RuntimeError

Cache is only available server-side within the LangGraph Age

Error message

Cache is only available server-side within the LangGraph Agent Server (https://docs.langchain.com/langgraph/deployments).

What it means

Error "Cache is only available server-side within the LangGraph Agent Server (https://docs.langchain.com/langgraph/deployments)." thrown in langchain-ai/langgraph.

Source

Thrown at libs/sdk-py/langgraph_sdk/cache.py:67


__all__ = [
    "SWRResult",
    "cache_get",
    "cache_set",
    "swr",
]


async def cache_get(key: str) -> Any | None:
    """Get a value from the cache.

    Returns the deserialized value, or ``None`` if the key is missing or expired.

    Requires Agent Server runtime version 0.7.29 or later.
    """
    if _cache_get is None:
        raise RuntimeError(
            "Cache is only available server-side within the LangGraph Agent Server "
            "(https://docs.langchain.com/langsmith/deployments)."
        )
    return await _cache_get(key)


async def cache_set(key: str, value: Any, *, ttl: timedelta | None = None) -> None:
    """Set a value in the cache.

    Args:
        key: The cache key.
        value: The value to cache (must be JSON-serializable).
        ttl: Optional time-to-live. Capped at 1 day; ``None`` or zero
            defaults to 1 day.

    Requires Agent Server runtime version 0.7.29 or later.
    """
    if _cache_set is None:

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/sdk-py/langgraph_sdk/cache.py:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26). Data as JSON: /api/errors/e08a7653eb1eaeb0. Report an issue: GitHub.