LangGraph uses “Annotated” to tell the framework how to update the state, so that we can save a few keystrokes when implementing graph nodes *. Nodes operate on State, so “Annotated” allows you to enforce an update rule like appending to the message queue. I’m not sure what else it’s good for, but I do know that this unique application of the “Annotated” feature confuses AI coding models. I am wondering if there are plans to remove it and implement state updates in a more straightforward way.
Edit: * presumably there are other reasons but I don’t see them.