Home / Concepts

How do you give AI agents memory across sessions?

By storing each kind of knowledge in the right place, and turning the important lessons into rules that run.

A fresh agent inherits nothing from the last chat. I use four places. A project wiki for architecture, decisions and history. Repository rules for the failures every agent must read. A memory service for preferences and lessons across sessions. And hooks, which inject context or enforce a rule automatically.

They are not equal. The code that runs and the project’s written rules outrank summaries, the wiki and remembered context. Memory helps an agent get oriented. It does not overrule the system.

The strongest form of memory is enforcement. A lesson written as a test, a permission or a hook does not depend on anyone recalling it.

Lessons that use it

Try “secrets”, “merge”, “handover” or “database”.