Memory is what an agent carries between tasks rather than within one.
Short-term memory is the working context of the current run.
Long-term memory is facts and preferences kept for future runs.
The user prefers metric units is a long-term fact worth keeping.
The usual implementation is a vector store queried at the start of a turn.
Relevant memories are retrieved and placed in the context, which is RAG over your own history.
The hard question is not storage but what deserves to be remembered.
Storing everything fills the store with noise and retrieval quality collapses.
A common approach is to have the model propose what is worth keeping.
That needs review, since models save trivia and miss the important line.
Memories go stale, and a preference from six months ago may be wrong now.
Store a timestamp and let recency influence retrieval.
Conflicting memories are a real problem, since two contradictory facts can both be retrieved.
Let users see and edit what has been remembered about them.
Anything remembered about a person is personal data with the obligations that follow.