langchain-ai/langgraph · error

Must have langchain-core>=0.3.11 installed to use automatic

Error message

Must have langchain-core>=0.3.11 installed to use automatic message formatting (format='langchain-openai'). Please update your langchain-core version or remove the 'format' flag. Returning un-formatted messages.

What it means

Error "Must have langchain-core>=0.3.11 installed to use automatic message formatting (format='langchain-openai'). Please update your langchain-core version or remove the 'format' flag. Returning un-formatted messages." thrown in langchain-ai/langgraph.

Source

Thrown at libs/langgraph/langgraph/graph/message.py:386

        )
        super().__init__(Annotated[list[AnyMessage], add_messages])  # type: ignore[arg-type]


class MessagesState(TypedDict):
    messages: Annotated[list[AnyMessage], add_messages]


def _format_messages(messages: Sequence[BaseMessage]) -> list[BaseMessage]:
    try:
        from langchain_core.messages import convert_to_openai_messages
    except ImportError:
        msg = (
            "Must have langchain-core>=0.3.11 installed to use automatic message "
            "formatting (format='langchain-openai'). Please update your langchain-core "
            "version or remove the 'format' flag. Returning un-formatted "
            "messages."
        )
        warnings.warn(msg)
        return list(messages)
    else:
        return convert_to_messages(convert_to_openai_messages(messages))


def push_message(
    message: MessageLikeRepresentation | BaseMessageChunk,
    *,
    state_key: str | None = "messages",
) -> AnyMessage:
    """Write a message manually to the `messages` / `messages-tuple` stream mode.

    Will automatically write to the channel specified in the `state_key` unless `state_key` is `None`.
    """

    from langchain_core.callbacks.base import (
        BaseCallbackHandler,
        BaseCallbackManager,

View on GitHub (pinned to 38031739e5)

When it happens

Trigger: Thrown at libs/langgraph/langgraph/graph/message.py:386 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/26568bd26ecf0285. Report an issue: GitHub.