Memory and Knowledge
Short-Term Memory
Short-term memory is the conversation history an agent carries within a single session: the messages array passed to each API call, which persists across turns but resets when the session ends. Without it, every agent response would be stateless and context-blind, making multi-step tasks impossible since the agent would forget what it was doing between each tool call. The failure mode of poor short-term memory management is subtle: an agent with a naively pruned or summarized history loses track of decisions it made two steps ago and either contradicts itself or repeats work it already completed, so production systems use relevance-weighted pruning and targeted summarization to keep the right context, not just the most recent context.
connected to
resources
LLM Powered Autonomous Agentslilianweng.github.ioLilian Weng's analysis of short-term and working memory in agent systems (lilianweng.github.io)LangChain: Conversation Memorypython.langchain.comImplementing conversation-scoped memory with different strategies (python.langchain.com)Anthropic: Multi-Turn Conversationsdocs.anthropic.comBest practices for managing conversation history with Claude (docs.anthropic.com)OpenAI: Chat Completionsplatform.openai.comUnderstanding message history management in the chat completions API (platform.openai.com)