<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Swagger</title>
    <description>The latest articles on DEV Community by Swagger (@laidoff465f7d4a33f5e).</description>
    <link>https://dev.to/laidoff465f7d4a33f5e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3946217%2Fefee5cf3-39d9-425f-9bf1-cc3f23abdc0f.png</url>
      <title>DEV Community: Swagger</title>
      <link>https://dev.to/laidoff465f7d4a33f5e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/laidoff465f7d4a33f5e"/>
    <language>en</language>
    <item>
      <title>I built AI memory that forgets intelligently-here's what I learned</title>
      <dc:creator>Swagger</dc:creator>
      <pubDate>Fri, 22 May 2026 13:52:07 +0000</pubDate>
      <link>https://dev.to/laidoff465f7d4a33f5e/i-built-ai-memory-that-forgets-intelligently-heres-what-i-learned-4gmc</link>
      <guid>https://dev.to/laidoff465f7d4a33f5e/i-built-ai-memory-that-forgets-intelligently-heres-what-i-learned-4gmc</guid>
      <description>&lt;h1&gt;
  
  
  AI memory should forget. Here's how I built intelligent decay.
&lt;/h1&gt;

&lt;p&gt;I've been frustrated with AI memory for a while.&lt;/p&gt;

&lt;p&gt;Every conversation with Claude or ChatGPT starts completely blank. &lt;br&gt;
You explain yourself again and again. Your name, your project, your &lt;br&gt;
preferences — gone after every session.&lt;/p&gt;

&lt;p&gt;When memory does exist, it's a flat list. No scoring. No decay. &lt;br&gt;
No understanding of what matters more than something else. &lt;br&gt;
Everything weighted equally. Forever.&lt;/p&gt;

&lt;p&gt;So I asked Claude directly about its own memory limitations. It said:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I don't have a scoring system for memories. I don't have a graph &lt;br&gt;
or network of linked memories. The information exists as flat text &lt;br&gt;
snippets, not a connected knowledge structure. I don't forget on &lt;br&gt;
a schedule."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That answer became the spec for what I built next.&lt;/p&gt;


&lt;h2&gt;
  
  
  The insight that changed everything
&lt;/h2&gt;

&lt;p&gt;Human memory isn't a database. It's a narrative.&lt;/p&gt;

&lt;p&gt;We remember things because they matter. We forget things because they &lt;br&gt;
don't. Nobody remembers every email they've ever read. But everyone &lt;br&gt;
remembers the day they decided to quit their job.&lt;/p&gt;

&lt;p&gt;Current AI memory treats both equally. That's the problem.&lt;/p&gt;

&lt;p&gt;I came up with two dimensions that no shipped memory system uses:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Irreplaceability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Can this memory be Googled? A definition of Python exists everywhere &lt;br&gt;
on the internet — low value, forget it fast. But "I'm building an AI &lt;br&gt;
memory system because I was frustrated with AI amnesia" — that exists &lt;br&gt;
nowhere else. That's personal context. Never forget it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connectivity&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What breaks if we delete this memory? A memory that five other memories &lt;br&gt;
depend on is more dangerous to delete than an isolated one. Remove it &lt;br&gt;
and you break the narrative. This pushed the architecture toward a &lt;br&gt;
knowledge graph — not just a list.&lt;/p&gt;

&lt;p&gt;Combined, these two dimensions create intelligent forgetting. Not random &lt;br&gt;
deletion. Not storing everything forever. Keeping what actually matters.&lt;/p&gt;


&lt;h2&gt;
  
  
  The scoring formula
&lt;/h2&gt;

&lt;p&gt;Every memory gets a composite score:&lt;br&gt;
score = 0.40 × irreplaceability&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;0.30 × connectivity&lt;/li&gt;
&lt;li&gt;0.20 × recency&lt;/li&gt;
&lt;li&gt;0.10 × frequency&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Memories below 0.20 get pruned. Memories above 0.40 stay active. &lt;br&gt;
Archived memories — ones the user pins — never get pruned regardless &lt;br&gt;
of score.&lt;/p&gt;

&lt;p&gt;The weights aren't arbitrary. Irreplaceability gets the highest weight &lt;br&gt;
because it captures something the other dimensions can't — uniqueness. &lt;br&gt;
A memory accessed yesterday but findable on Google is less valuable than &lt;br&gt;
a personal decision made six months ago that nobody else knows about.&lt;/p&gt;


&lt;h2&gt;
  
  
  Causal chains — the part I'm most excited about
&lt;/h2&gt;

&lt;p&gt;Current AI memory stores what happened. I wanted to understand why.&lt;/p&gt;

&lt;p&gt;When someone says "I was frustrated because AI kept forgetting everything, &lt;br&gt;
so I decided to build Engram"—there"'s a causal chain buried in that sentence:&lt;br&gt;
"AI kept forgetting" → caused → "frustration" → caused → "decided to build Engram"&lt;/p&gt;

&lt;p&gt;I built two detection methods. The first looks for explicit causal language &lt;br&gt;
— words like "because", "so I", "which led to", "decided to". The second &lt;br&gt;
uses semantic embeddings to detect causal flow between temporally ordered &lt;br&gt;
memories even when no causal words are present.&lt;/p&gt;

&lt;p&gt;No labels. No human annotation. Pure inference from the text.&lt;/p&gt;

&lt;p&gt;This is the closest current AI gets to how humans actually remember — &lt;br&gt;
not just facts, but the narrative connecting them.&lt;/p&gt;


&lt;h2&gt;
  
  
  The honest benchmark results
&lt;/h2&gt;

&lt;p&gt;I ran against LoCoMo — the industry standard long-term conversational &lt;br&gt;
memory benchmark. 1,542 real question-answer pairs across 10 conversations &lt;br&gt;
spanning weeks of interaction.&lt;br&gt;
no memory baseline  : 0.006&lt;br&gt;
flat memory         : 0.209&lt;br&gt;
engram              : 0.211  (+0.9%)&lt;/p&gt;

&lt;p&gt;Small margin. I'm not going to pretend otherwise.&lt;/p&gt;

&lt;p&gt;What I am confident about is forgetting quality — 0.94 on internal &lt;br&gt;
benchmarks. Engram consistently keeps irreplaceable personal memories &lt;br&gt;
and prunes generic re-fetchable ones. That's the core thesis working.&lt;/p&gt;

&lt;p&gt;The retrieval gap is what I'm working on next. The intelligent forgetting &lt;br&gt;
is real. Getting it to surface the right memories at query time is the &lt;br&gt;
next frontier.&lt;/p&gt;


&lt;h2&gt;
  
  
  The live API
&lt;/h2&gt;

&lt;p&gt;Engram is live right now. Three endpoints:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Store a memory&lt;/span&gt;
POST /v1/ingest
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"user_id"&lt;/span&gt;: &lt;span class="s2"&gt;"alice"&lt;/span&gt;, &lt;span class="s2"&gt;"content"&lt;/span&gt;: &lt;span class="s2"&gt;"I prefer dark mode and hate meetings"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Retrieve relevant memories  &lt;/span&gt;
POST /v1/query
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"user_id"&lt;/span&gt;: &lt;span class="s2"&gt;"alice"&lt;/span&gt;, &lt;span class="s2"&gt;"query"&lt;/span&gt;: &lt;span class="s2"&gt;"what does alice prefer"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;# Run intelligent forgetting&lt;/span&gt;
POST /v1/decay
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"user_id"&lt;/span&gt;: &lt;span class="s2"&gt;"alice"&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Any AI app gets persistent intelligent memory with three API calls.&lt;/p&gt;

&lt;p&gt;Email &lt;strong&gt;&lt;a href="mailto:cdeekshith1@gmail.com"&gt;cdeekshith1@gmail.com&lt;/a&gt;&lt;/strong&gt; for API access.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Better irreplaceability detection — rule-based works but misses subtlety. &lt;br&gt;
Claude API integration for richer semantic understanding. Improving the &lt;br&gt;
retrieval to use graph edges more aggressively.&lt;/p&gt;

&lt;p&gt;The benchmark number is small but the direction is right. The pieces &lt;br&gt;
are in place. Now I need real users breaking it in ways I haven't &lt;br&gt;
thought of.&lt;/p&gt;

&lt;p&gt;If you're building AI apps and want memory that actually forgets &lt;br&gt;
intelligently — try it. Break it. Tell me what's wrong.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/deekshith080/engram" rel="noopener noreferrer"&gt;https://github.com/deekshith080/engram&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built this solo. Feedback welcome.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>python</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
