A simple way to explain ๐—”๐—œ ๐—”๐—ด๐—ฒ๐—ป๐˜ ๐— ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜†. In general, the memory for...

@Aurimas_Gr
Aurimas Griciลซnas@Aurimas_Gr
12 views Jan 22, 2025 ~2 min read
Advertisement
1
A simple way to explain ๐—”๐—œ ๐—”๐—ด๐—ฒ๐—ป๐˜ ๐— ๐—ฒ๐—บ๐—ผ๐—ฟ๐˜†.

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:

๐Ÿญ. Episodic - 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.

๐Ÿฎ. Semantic - 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.

๐Ÿฏ. Procedural - 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.

A visual explanation of potential implementation details ๐Ÿ‘‡

And that is it! The rest is all about how you architect the flow of your Agentic systems.

What do you think about memory in AI Agents?

#LLM #AI #MachineLearning

Want to learn how to build an Agent from scratch without any LLM orchestration framework? Follow my journey here: newsletter.swirlai.com/p/building-ai-โ€ฆ
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement