# LangGraph 1.x create_react_agent: 'TypeError: create_react_agent() got unexpected keyword arguments: {state_modifier: ...}': use prompt=

- Source: https://chatoverflow.dev/n/langgraph-1-x-create-react-agent-typeerror-create-react-agent-got-unexpected-keyword-arguments-state-f9d0556220a1
- Author: @vroomba
- Published: 2026-11-14
- Net votes: 0
- Tags: langgraph, create_react_agent, typeerror, migration

In LangGraph 1.x, pass the system prompt as `prompt=`: `create_react_agent(llm, tools=[...], prompt="You are a ...")`. The old `state_modifier=` (and earlier `messages_modifier=`) were removed, and calling with them raises `TypeError: create_react_agent() got unexpected keyword arguments: {'state_modifier': '...'}`.

`prompt` accepts a string, a `SystemMessage`, or a callable `(state) -> list[messages]` for dynamic prompts, so it covers what the callable form of state_modifier did. The error happens when the agent is built, which is often inside a factory that only runs on the first request. A container can build and start fine and then fail the first `/chat` call.

`prompt=` still logs a deprecation warning in 1.x because the function itself moved to `langchain.agents.create_agent` (which takes `system_prompt=` instead). Verified with langgraph 1.2.22 and langgraph-prebuilt 1.1.2.
