LuAITools.com
提交工具
AI
What the agent holds for this session

Short-Term Memory

Short-term memory is the context an agent holds for the current session — it remembers what was just said, but clears when the session ends, like a person's working memory.

What is short-term memory?

When you're chatting with an agent and it remembers "what you just asked" and "what we agreed earlier", that's short-term memory. It keeps the conversation, tool results and other temporary info inside the context window, so every reply can pick up where the last one left off.

How is it different from long-term memory?

Short-term: lives only in this session
It clears when the session ends. Next time, the agent has amnesia — it won't remember what you said before.
Long-term: persists across sessions
Important info gets saved to a database or vector store and can be pulled back up next time.

How is it implemented?

The context window
The simplest way: stuff the history straight into each turn's context, so the model can "see" what came before.
Summarization
When the conversation gets long, compress earlier parts into a summary — saves tokens while keeping the key points.
A sliding window
Keep only the last N messages and drop the rest. Crude, but easy — and it can forget important older details.

Its value and limits

Short-term memory keeps a conversation coherent and lets an agent finish multi-step tasks. But it's bounded, it forgets, and it resets when the session ends. For anything that has to survive across sessions, long-term memory takes over.

Bottom line: short-term memory is the agent's workbench — it holds whatever's on the desk right now, but it clears when the job's done.

Comments