Concepts
Memory
Stores and manages conversation history across multiple turns, so a chain or agent can reference what was said earlier.
Why it exists
LLM calls are stateless by default — Memory keeps track of prior messages so multi-turn conversations stay coherent.
educhain.py
from educhain.memory import ChatMessageHistory
history = ChatMessageHistory()
history.add_user_message("What's the capital of France?")
history.add_ai_message("Paris.")