Skip to content

Message history is not durable memory

For one model call, the model can use only the context supplied to that call. Your application—or a provider-managed conversation service—decides what to save and supply next time.1

history = [{"role": "user", "content": "My name is Maya."}]
history.append({"role": "assistant", "content": call_model(history)})
history.append({"role": "user", "content": "What is my name?"})
answer = call_model(history[-20:])

The second request contains the earlier message, so the model can answer “Maya.” The Python list is the application’s memory mechanism. The model did not update its weights or privately remember Maya between calls.

Some APIs can store conversation objects or link responses for you. That changes who manages the state, not what the model can infer from the context it receives.

Concept Plain meaning Support-assistant example
Model context Tokens supplied to this call Current question, instructions, and retrieved policy
Message history Stored transcript of prior turns User and assistant messages from this chat
Working context The selected part of history sent now Last 20 messages plus a running summary
Structured state Fields the workflow reads and updates Account ID, current step, tool results, retry count
Checkpoint Persisted snapshot of state State immediately before a human approval
Long-term store Approved information available across threads The user’s saved language preference

LangGraph persists thread-scoped state through checkpointers and uses a store for application-defined information shared across threads.2 A message list may be part of state, but state can also contain values that should never be shown to the model.

Raw conversation history grows until it is expensive, distracting, or too large for the context window. Common policies are:

recent window keep the last N turns
filter remove irrelevant tool chatter
summary compress older turns
structured state extract durable facts into typed fields
retrieval fetch only memories relevant to this request

Each policy can lose information. A summary can silently change a customer number; a recent window can drop the instruction that governs the current task. Test long and branching conversations, not only two-turn demos.

Before storing a “memory,” answer:

  • Did the user consent to retaining it?
  • Is it scoped to a thread, user, tenant, or organization?
  • Who can read, correct, and delete it?
  • How long is it retained and encrypted?
  • Can untrusted content write durable instructions?
  • What happens when a summary or extracted fact is wrong?

Do not automatically convert every conversation sentence into long-term memory. Save the smallest approved fact with provenance and an expiration or deletion policy.

Next: compare state, checkpoints, threads, and stores or build a durable LangGraph workflow.

  1. OpenAI, conversation state, distinguishes manually supplied history, linked responses, and durable conversation objects.

  2. LangChain, LangGraph persistence and memory overview.