Messages in langchain
-
when we are interacting with model we have following options
- system prompt: This sets the system instructions for a model
- human prompt: This is users question
- llm response: This is response from llm
- tool message: This represents tool response.
-
According to langchain terminology
- System Prompt => SystemMessage
- HumanPrompt => HumanMessage
- LLM Response => AI Message
- Tool Response => ToolMessage

Lets see all messages in action
- note: agent takes messages as input
-
Refer Here for messages demo
-
Note: Model responds to messages passed, it doesn’t remember anything, so while building agents managing memory is our problem.
