{"componentChunkName":"component---src-templates-blog-post-js","path":"/agentic_memory/","result":{"data":{"site":{"siteMetadata":{"title":"Aparna's Personal Space","author":"Aparna Ravindra"}},"markdownRemark":{"id":"9e140278-c1ad-5ce1-8e0d-d7c5a90bd797","excerpt":"Agentic Memory Evolution 1. Mem0 Mem0 uses a dedicated middleware layer to manage memory before and after an LLM call. The memory layer could be deterministic…","html":"<h1>Agentic Memory Evolution</h1>\n<h2>1. Mem0</h2>\n<p>Mem0 uses a dedicated middleware layer to manage memory before and after an LLM call.</p>\n<p>The memory layer could be deterministic or not. It can potentially incorporate different types of memory, such as conversational, session, user, and agentic memory.</p>\n<p>The memory layer is pluggable and can be used with any agent.</p>\n<h3>Conversational memory</h3>\n<p>Conversational memory stays only in the context.</p>\n<p>As the context window fills up, older messages in the session are truncated from the context.</p>\n<p>However, facts from previous conversations are not necessarily lost. At every turn, the memory management layer extracts relevant facts and persists them in a database.</p>\n<p>The exact conversation itself is not persisted (unless infer=False).</p>\n<h3>Episodic memory</h3>\n<p>Episodic memory is scoped at the <code class=\"language-text\">run_id</code> level.</p>\n<p>The extraction pipeline extracts metadata such as timestamps and graph snapshots.</p>\n<h3>Semantic memory</h3>\n<p>Semantic memory is scoped at the <code class=\"language-text\">user_id</code> level.</p>\n<p>The extraction layer persists this information in a vector store.</p>\n<h3>Knowledge graph</h3>\n<p>Mem0 has four layers of memory based on how long the information lives:</p>\n<ol>\n<li><strong>User memory</strong> — permanent</li>\n<li><strong>Session memory</strong> — episodic memory</li>\n<li><strong>Agentic memory</strong> — shared knowledge base across users and sessions</li>\n<li><strong>Sensory memory</strong> — immediate conversation buffer that sits in the context window and is not persisted anywhere</li>\n</ol>\n<p>User memory and agent memory are stored in vector databases, with relationships between them.</p>\n<hr>\n<h2>2. MemGPT</h2>\n<p>MemGPT is inspired by operating systems that have different layers of memory, such as RAM and hard disk.</p>\n<p>The idea is to create a hierarchical memory system.</p>\n<p>It has:</p>\n<ul>\n<li><strong>Core memory</strong> — part of every LLM call</li>\n<li><strong>Archival memory</strong> — searchable</li>\n<li><strong>Recall memory</strong> — sequential raw conversation</li>\n</ul>\n<p>The key difference is that the memory content is completely handled by the agent using tools.</p>\n<p>There is no intermediate memory layer managing the memory for the agent. Memory management is therefore tightly coupled to the agent itself.</p>\n<h3>Conversational memory</h3>\n<p>Conversational memory is present in a FIFO queue.</p>\n<p>When the context starts filling up, older conversation is summarized.</p>\n<h3>Episodic memory</h3>\n<p>This is the recall memory.</p>\n<p>It is essentially a literal database of raw chronological events.</p>\n<p>No semantic search is performed here.</p>\n<h3>Semantic memory</h3>\n<p>Semantic memory is stored in the working context as human memory and persona memory.</p>\n<p>If it gets too large, it is pushed to archival memory.</p>\n<p>The context window therefore looks roughly like:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">+------------------------------------------------------+\n| System prompt | Working context (persona) | FIFO queue |\n+------------------------------------------------------+\n                     Context window</code></pre></div>\n<hr>\n<h2>3. A-mem</h2>\n<p>A-mem is inspired by note-taking methods such as <strong>Zettelkasten</strong>, where notes form a hierarchy and are connected to one another.</p>\n<h3>Atomic memories</h3>\n<p>Every fact is atomic and can be connected to other facts.</p>\n<p>Every memory an atomic memory.</p>\n<p>The immediate next step is to enrich the text with a structured schema so that it becomes a better base for semantic memory.</p>\n<h3>Creating links</h3>\n<p>Next, links are generated.</p>\n<p>The top <code class=\"language-text\">k</code> existing notes are compared with the new note, and links are created if a relationship exists.</p>\n<p>If a link is made, older notes can also be edited with additional information such as tags or keywords if needed.</p>\n<h3>Context handling</h3>\n<p>Only one or two turns of conversation are persisted in the context window.</p>\n<p>After the context window slides, the conversation is converted into an atomic note and becomes part of the knowledge graph with a <code class=\"language-text\">session_id</code> tag.</p>\n<p>Small language models are used for fast note-taking.</p>\n<p>Both A-mem and Mem0 use LLMs/SLMs for the memory layer.</p>\n<h2>Mem0 vs A-mem</h2>\n<p>One way I see the difference between Mem0 and A-mem:</p>\n<p><strong>Mem0:</strong></p>\n<ul>\n<li>Every conversation extracts facts to be stored or updated.</li>\n<li>Mem0 has a more structured approach to creating links between facts.</li>\n<li>It extracts entities to identify common entities before creating edges.</li>\n</ul>\n<p><strong>A-mem:</strong></p>\n<ul>\n<li>Stores atomic notes and relationships between them.</li>\n<li>It does not use the same explicit entity-extraction structure as Mem0.</li>\n</ul>\n<table>\n<thead>\n<tr>\n<th></th>\n<th>Mem0</th>\n<th>A-MEM</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Basic unit</td>\n<td>Memory/fact</td>\n<td>Note</td>\n</tr>\n<tr>\n<td>Organization</td>\n<td>Retrieval-oriented memory store</td>\n<td>Interconnected memory network</td>\n</tr>\n<tr>\n<td>Linking</td>\n<td>Entity-aware relationships / graph mechanisms</td>\n<td>Similarity-based note links</td>\n</tr>\n<tr>\n<td>Evolution</td>\n<td>Extract/update/deduplicate memories</td>\n<td>New memories can modify existing notes</td>\n</tr>\n<tr>\n<td>Memory management</td>\n<td>Dedicated memory layer</td>\n<td>Agentic memory construction</td>\n</tr>\n<tr>\n<td>Core idea</td>\n<td><strong>Remember useful facts</strong></td>\n<td><strong>Build an evolving network of notes</strong></td>\n</tr>\n</tbody>\n</table>\n<hr>\n<h2>Mem0 vs MemGPT vs A-mem</h2>\n<p>One way to think about the evolution is:</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">    MemGPT\n      ↓\n    Hierarchical memory\n      ↓\n    Agent manages memory using tools\n\n\n    Mem0\n      ↓\n    Dedicated memory management layer\n      ↓\n    Memory extraction + storage happens around LLM calls\n\n\n    A-mem\n      ↓\n    Memory as interconnected atomic notes\n      ↓\n    New memories create links and evolve existing notes</code></pre></div>\n<p>The interesting progression is that memory moves from being primarily a <strong>storage hierarchy</strong> toward becoming an <strong>active, evolving knowledge structure</strong>.</p>\n<img width=\"1312\" height=\"1199\" alt=\"image\" src=\"https://github.com/user-attachments/assets/535789e1-1954-4b67-bfbb-5c5acb292dd6\">","fields":{"slug":"/agentic_memory/"},"frontmatter":{"title":"Agentic Memory - Mem0, MemGPT, A-Mem","date":"2026, Sep 20","tags":["tech"],"memorydata":null,"practicedata":null,"img":{"childImageSharp":{"resize":{"src":"/static/c641efa396a6e4ec1e5e13a7595af860/f3583/agentic_memory.png","height":675,"width":1200},"gatsbyImageData":{"layout":"fullWidth","placeholder":{"fallback":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAACK0lEQVQoz03SSU/bQAAFYP//ayV6qCq1UisOVF2oQkEkJVASQ0II4ITESRzv23gZj2f3klSUS6Xv8C7vnZ4SIR4UDFO2r1graVuxpmKNZLvqRSNZI+lO8layVrKCQrMI1tBf5c4auopb8CXg25RtM75JmB6VQrB9zSgXhPNasrbipUBU4qZ+6TccCRJBmptFoECEhpPZdL6ZaHp/eG97QVNLUAp1k97ZRUrqEAF1q02thZV5FQ6pPc3nfRkuaxwrpIQH7z69efvxvHt5eHT8+KQ1dWXmsjdZXWt2SHYODHv3ake91BO7Kmxs3c+Gp9ia7HGooCI/eH/YOb340emedq/Ozi9zCFO5Pxmv+5oTkV0q4O/l3dFNL6BJXfrEvLHHHWqNdzhSsgR8+f7r50n32/HZ0beTD5+/LvWNEZfXmnm79ELSWlkwfH4YrbR16pZg684GtjaAm1FbBkpZwIvBuPdn1B+Mr9RJrz9Y6puFmw7n1mBmbgE2E199frhdPq4Sp4gNY3oV6KNgocrcVSpO4ySNk9TxAi+IEgDqSlgZf3KLRUjWMXWLaB4aOrAMHMBIx+ZEBrPGnzaZqUhO9ZXh2I7vea7jBL5fCRoX1E5KPytBjhIEvDwIYWQnXpl5HBg43pJQlyhSahTloSsZ3jeyrXlb80ayWuAXHDeCNJJyghDMEcxjAECSlKhgFAtGlDYx9rm5g27D0Ouf/mH/Z8kJI0iwsuKkFqR6HRXkLwQWTuRnKt9JAAAAAElFTkSuQmCC"},"images":{"fallback":{"src":"/blog/static/c641efa396a6e4ec1e5e13a7595af860/56785/agentic_memory.png","srcSet":"/blog/static/c641efa396a6e4ec1e5e13a7595af860/0dee1/agentic_memory.png 750w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/8beaa/agentic_memory.png 1080w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/a4198/agentic_memory.png 1366w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/56785/agentic_memory.png 1672w","sizes":"100vw"},"sources":[{"srcSet":"/blog/static/c641efa396a6e4ec1e5e13a7595af860/ba386/agentic_memory.avif 750w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/8adb1/agentic_memory.avif 1080w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/a3131/agentic_memory.avif 1366w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/bc8d5/agentic_memory.avif 1672w","type":"image/avif","sizes":"100vw"},{"srcSet":"/blog/static/c641efa396a6e4ec1e5e13a7595af860/a66aa/agentic_memory.webp 750w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/65dd5/agentic_memory.webp 1080w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/f9724/agentic_memory.webp 1366w,\n/blog/static/c641efa396a6e4ec1e5e13a7595af860/52a32/agentic_memory.webp 1672w","type":"image/webp","sizes":"100vw"}]},"width":1,"height":0.562799043062201}}}}}},"pageContext":{"slug":"/agentic_memory/","previous":{"fields":{"slug":"/tiny_experiments/"},"frontmatter":{"title":"Tiny Experiments","tags":["book","non-fiction"],"img":{"childImageSharp":{"gatsbyImageData":{"layout":"fullWidth","placeholder":{"fallback":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAACqklEQVQozwGfAmD9ADM4PDxAQ0JGSVhYV15dWV9dWWZhXGxnYIR5bpuMfaWXiLSklca3p9XHuNvNwNzRxN3SxdzSxNrRxNbNwgBJSUhBQkNGR0hcWlZnZF+Hf3SOgXOsm4nDr5vRvajgzLfz3sby38rr28rm2svk28/i2c3g18ri2Mre1coAk4Jym4l3p5OAfXBjY15YuqmYsqOT2MOt4My36tbB4tC9zsGy28287d3L7N/O6N7Q4tnP39fO39jP08/JAKCMeqWRfZKBcI6BcbGeisCum7Kml8m6qODLtuzYwrSqoJiVktzRxPfp1u7i0uzh1N3XztnUzs7MycHExABaU0tEPztpYVbIt6DSv6naybPPvqmxpZfl0779583TxbWnop2LjI6hn56ppqTv5Nbc1cza1c7Tz8q/wMAAOjg1NzUxiX5v2cWty7qlqZyJ6de+vK+fybmo4tG82Mq52My95drMu7Wvu7Wu+u3d6eDT4dnQz8vGy8nGAJeHeIZ3aXduYc67o9G/qNjGruvYwKuejsm4pZmTi5aQiImGgYiGg4qJhoGCgXt9fXl8fHd7fGRpbqanpwC4ooy/p495bmOwoY3ZxazhzbXEtJ+pmonx3MS/s6WpoJZ+e3iRjIaroJiqn5iXj42MhYSbmJZ/g4akp6gAinxul4Z1gHJlVE9KfXRohntunY5+59G6/urS+uPL9trE7dG99tvH8NnH7djJ6tfK5tPI0sK7w7i3vLy7AHFrZFxXUVtVT19YUmJaVId8ccazoezYwuPItOXJtPHdyO/cyefXxuLXyODWydjQxcvHwcbEvra3trS1swCej4CXiHmfj4DDr5zOuaTbxrDfzLbgzbjhy7bjzbnl08Dh0b/cz7/YzMDWzMHRyb/Mxb7QycDQyMDIw7zPPLj4C99jugAAAABJRU5ErkJggg=="},"images":{"fallback":{"src":"/blog/static/c8864934fd0f625d2669886e1cf76c6a/56785/tiny_experiments.png","srcSet":"/blog/static/c8864934fd0f625d2669886e1cf76c6a/0dee1/tiny_experiments.png 750w,\n/blog/static/c8864934fd0f625d2669886e1cf76c6a/8beaa/tiny_experiments.png 1080w,\n/blog/static/c8864934fd0f625d2669886e1cf76c6a/a4198/tiny_experiments.png 1366w,\n/blog/static/c8864934fd0f625d2669886e1cf76c6a/56785/tiny_experiments.png 1672w","sizes":"100vw"},"sources":[{"srcSet":"/blog/static/c8864934fd0f625d2669886e1cf76c6a/a66aa/tiny_experiments.webp 750w,\n/blog/static/c8864934fd0f625d2669886e1cf76c6a/65dd5/tiny_experiments.webp 1080w,\n/blog/static/c8864934fd0f625d2669886e1cf76c6a/f9724/tiny_experiments.webp 1366w,\n/blog/static/c8864934fd0f625d2669886e1cf76c6a/52a32/tiny_experiments.webp 1672w","type":"image/webp","sizes":"100vw"}]},"width":1,"height":0.562799043062201}}}}},"next":{"fields":{"slug":"/efficiently_serving_llms/"},"frontmatter":{"title":"Notes from Efficiently Serving LLMs","tags":["tech"],"img":{"childImageSharp":{"gatsbyImageData":{"layout":"fullWidth","placeholder":{"fallback":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAALCAIAAADwazoUAAAACXBIWXMAAAsTAAALEwEAmpwYAAACGUlEQVQoz33Q20sbQRTH8f3n24eCTyLVahURLK31UktMxIpNGgUTjFrTmIRoNrubvbrXue3szJwppu+FD+ft+3s4xlMKFtX2gkW0WWiPaSaUEkxJCpL9h+EU7Lbf6w+6j4/X5vQmDf9EdheH91DlUlDBsRIUJAW1uItmMUq1pEbJk9OjlffLb3c2lzZW340fjo+/rl23drUulJJag5JMCaokA0GUIP/KijPKuUFwcXLSWF3fWd/cbbbazdZl/fT8unPz0B92uncftw9939eAFQ0UDYD5UMYpEy4CD4PBGd7YOqg1WnuHZ1s7R5/3G1/2G73b32fnl9/rzfppKw49zSOFbE0cIE6GkV3oOQIHgSErurG9v7S89a32Y+XDp7XNvePahQSYI2UhhUDLKgMykWWMSBET4SJt5zDLFrESbDK2OleDp6E7enzu3T7U6hdOUTYn3q/noGvnk2nqjGauj9yUjCw3yMkk5h07tQtlLP4mgOkKSwCptVSgzRd8NRz1ZmZnbN/99NoHpnk/60ynb65u2rP5wHHb4+EsRwbJBUW8KikoUpbsJRFhAp4rhveZPeSuk7nPgdW3C9+Ok2BgRtM4m4f4qZ8HiBhZCJkPWQBFIsNIhRG8JJAkkCYqT2SJS8Wx5oGm9qvSliKJGfKK1GOpkQWvcepDMAfLBMd6NZ9DFCicC06ZrKiqsCoTxSLBUlVREJQJhHjxF/E+UO0pRXc4AAAAAElFTkSuQmCC"},"images":{"fallback":{"src":"/blog/static/e64fde1008cd2041cf38b0bde7482e0e/56785/efficiently_serving_llms.png","srcSet":"/blog/static/e64fde1008cd2041cf38b0bde7482e0e/0dee1/efficiently_serving_llms.png 750w,\n/blog/static/e64fde1008cd2041cf38b0bde7482e0e/8beaa/efficiently_serving_llms.png 1080w,\n/blog/static/e64fde1008cd2041cf38b0bde7482e0e/a4198/efficiently_serving_llms.png 1366w,\n/blog/static/e64fde1008cd2041cf38b0bde7482e0e/56785/efficiently_serving_llms.png 1672w","sizes":"100vw"},"sources":[{"srcSet":"/blog/static/e64fde1008cd2041cf38b0bde7482e0e/a66aa/efficiently_serving_llms.webp 750w,\n/blog/static/e64fde1008cd2041cf38b0bde7482e0e/65dd5/efficiently_serving_llms.webp 1080w,\n/blog/static/e64fde1008cd2041cf38b0bde7482e0e/f9724/efficiently_serving_llms.webp 1366w,\n/blog/static/e64fde1008cd2041cf38b0bde7482e0e/52a32/efficiently_serving_llms.webp 1672w","type":"image/webp","sizes":"100vw"}]},"width":1,"height":0.562799043062201}}}}}}},"staticQueryHashes":["251720178","764694655"]}