๐๐ ๐๐ด๐ฒ๐ป๐โ๐ ๐ ๐ฒ๐บ๐ผ๐ฟ๐ is the most important piece of ๐๐ผ๐ป๐๐ฒ๐
๐ ๐๐ป๐ด๐ถ๐ป๐ฒ๐ฒ๐ฟ๐ถ๐ป๐ด, this is how we define it ๐
In general, the memory for an agent is something that we provide via context in the prompt passed to LLM that helps the agent to better plan and react given past interactions or data not immediately available.
It is useful to group the memory into four types:
๐ญ. ๐๐ฝ๐ถ๐๐ผ๐ฑ๐ถ๐ฐ - This type of memory contains past interactions and actions performed by the agent. After an action is taken, the application controlling the agent would store the action in some kind of persistent storage so that it can be retrieved later if needed. A good example would be using a vector Database to store semantic meaning of the interactions.
๐ฎ. ๐ฆ๐ฒ๐บ๐ฎ๐ป๐๐ถ๐ฐ - Any external information that is available to the agent and any knowledge the agent should have about itself. You can think of this as a context similar to one used in RAG applications. It can be internal knowledge only available to the agent or a grounding context to isolate part of the internet scale data for more accurate answers.
๐ฏ. ๐ฃ๐ฟ๐ผ๐ฐ๐ฒ๐ฑ๐๐ฟ๐ฎ๐น - This is systemic information like the structure of the System Prompt, available tools, guardrails etc. It will usually be stored in Git, Prompt and Tool Registries.
๐ฐ. Occasionally, the agent application would pull information from long-term memory and store it locally if it is needed for the task at hand.
๐ฑ. All of the information pulled together from the long-term or stored in local memory is called short-term or working memory. Compiling all of it into a prompt will produce the prompt to be passed to the LLM and it will provide further actions to be taken by the system.
We usually label 1. - 3. as Long-Term memory and 5. as Short-Term memory.
And that is it! The rest is all about how you architect the topology of your Agentic Systems.
Any war stories you have while managing Agentโs memory? Let me know in the comments ๐
#AI #LLM #MachineLearning


