messages=[SystemMessage(content="You are a flight booking specialist. Provide concise options."),HumanMessage(content=step),]result=llm.invoke(messages)
How would you define system, human, and AI messages?
Click here to see the answer
In LangChain and LangGraph, messages are typically categorized by who is speaking and what role they play in guiding the conversation:
System message: Sets the rules and context for the AI’s behavior. It defines instructions, constraints, tone, and goals that guide how the model should respond throughout the interaction.
Human message: Input from the user. It contains questions, requests, or information that the AI should respond to.
AI message: The model’s response. It represents the assistant’s generated output based on the system instructions and human input.