Lou Montulli had the idea of using cookies in web communications in June 1994, while Netscape was building an e-commerce application for MCI. HTTP kept no state between requests, and a cookie gave a shopping cart somewhere to live.

A model call is stateless in that way too, so what an agent should know from last week has to be put into the request. A cookie holds a value the server wrote on purpose, though, and agent memory is distilled from conversation, where a later fact can contradict an earlier one.

I ran a team of 13 writers at Mem0, which sells a memory layer, so weigh this topic with that in mind.

Memory is a pipeline the application owns from the write to the read, and each stage has its own failure.

What memory is

Short-term memory and compression

Persistence and audit

Several agents, and voice

The field and its tools

Does an agent need memory if it has RAG and a large context window?

Yes, when state has to survive across requests. The page on context window vs memory treats context as a per-request budget, and RAG vs memory shows that RAG selects evidence for one request.

A memory read path is a retrieval problem, and the RAG pipeline topic covers the search stack it runs on.

Context window limits are the reason memory exists, and the LLM inference topic covers what a long context costs.

Claude Code's memory files are one product's version of this design, covered in the coding agents topic.