Agent Memory: How AI Stops Forgetting You
A regular chat lives by one conversation: close the tab — and it's all forgotten. An agent with memory works differently. It remembers your tasks, preferences, and conclusions from past conversations.
Three Types of Memory
- Short-term — this is the conversation itself. Everything that fits into the context window.
- Working — notes for the duration of one task.
- Long-term — what lives between sessions: facts about the user, project outcomes.
Where Long-term Memory is Stored
Most often — in a vector database. Facts are turned into embeddings and searched for by meaning, not exact word match. There are also stricter options: a regular database or simply files that the agent reads and writes.
How It Works in Practice
You say: "Remind me where we left off on the website project." The agent: 1. Searches long-term memory for records about the website. 2. Retrieves relevant facts. 3. Adds them to the context. 4. Responds to the point — as if it remembers.
flowchart LR
A[Question] --> B[Search in long-term memory]
B --> C[Relevant facts]
C --> D[Add to context]
D --> E[Respond to the point]
The Main Danger — Pollution
If everything is saved indiscriminately, memory turns into noise. Good memory should be able to decide what to remember and what to discard. This is a separate non-trivial task.
Getting Started
The easiest way is to set up a RAG with a vector database and connect it to the agent. More details — in the Agents section. 💙