Hand this tutorial to your agent in one click

A key section of this article is locked, and an agent opening the link cannot see it either. Unlock it first, then copy the full text for your agent in one click.

Agent Basics 13 Helps Agents Remember You

A beginner tutorial: agents without memory start from scratch every time. Explains the differences between working, short-term, and long-term memory, how to store them, and how memory helps agents get better with use.

Machine translation. Read the original

Without memory, an agent is a newcomer in every conversation. With memory, it can carry on a dialogue, remember preferences, and learn from the past.

Remember these points first

  • Working memory: the key information needed for the current step, like scratch paper.
  • Short-term memory: the context within one session. It is gone once the session ends or the program restarts.
  • Long-term memory: preferences, history, and knowledge saved across sessions. It must be stored in a database or vector store.
  • Memory makes an agent more reliable, more personalized, and better at improving itself.

Going deeper

The difference between the three kinds of memory. When a user says 'I want to go to Paris', that is working memory. When they then ask 'how is the accommodation there?', 'there' refers to Paris, which relies on short-term memory. When they come back next week and the agent still knows you like skiing and enjoy coffee, that relies on long-term memory.

How to store them. Short-term memory is handled by the framework's session object. Long-term memory has to be stored yourself: a database, a vector index, or a graph-structured knowledge base. You can also use an off-the-shelf memory service. The key question is 'what to store': don't store everything. Pick summaries, preferences, and valuable conclusions.

How to make it get better over time. After each task, distill the successes and failures into rules and save them. Next time, check memory first before acting.

Note. Memory raises privacy concerns, so users should be able to view, edit, and delete it.

Lesson cover

Image from the course repository.

Try it yourself

At the end of a conversation, ask the model to summarize 'the three preferences you remembered about me', then manually use those three items to start the next conversation.

Let your agent teach you

Give the text below to your agent (Claude Code, ChatGPT, and Gemini all work), and it will guide you step by step like a mentor.

Sign in to unlock this key section

New accounts get 10 free credits, plus 1 more for each daily check-in. Spend 1 credit to unlock and it stays open for you.

References

Done with this one? Mark it to track your path.Sign in
Save it for laterSign in
Questions about this piece?Ask AI about this

Comments (0)

No comments yet. Start the conversation.

Sign in to join the discussion.Sign in