<?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: rajesh kumar</title>
    <description>The latest articles on DEV Community by rajesh kumar (@rajesh_kumar_ea50a6f5ab02).</description>
    <link>https://dev.to/rajesh_kumar_ea50a6f5ab02</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4071441%2F5c59a93b-d387-4568-909b-3c45933ae6f0.png</url>
      <title>DEV Community: rajesh kumar</title>
      <link>https://dev.to/rajesh_kumar_ea50a6f5ab02</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rajesh_kumar_ea50a6f5ab02"/>
    <language>en</language>
    <item>
      <title>I Tried Building LLM Memory the Stupid Way — It Worked Surprisingly Well</title>
      <dc:creator>rajesh kumar</dc:creator>
      <pubDate>Mon, 10 Aug 2026 13:56:22 +0000</pubDate>
      <link>https://dev.to/rajesh_kumar_ea50a6f5ab02/i-tried-building-llm-memory-the-stupid-way-it-worked-surprisingly-well-4n8j</link>
      <guid>https://dev.to/rajesh_kumar_ea50a6f5ab02/i-tried-building-llm-memory-the-stupid-way-it-worked-surprisingly-well-4n8j</guid>
      <description>&lt;p&gt;This started as a fun experiment.&lt;br&gt;
I've been working on a local RAG system , and at some point I started wondering about something that sounds simple but is actually quite difficult:&lt;br&gt;
Can an LLM remember old conversations without sending its entire history back into the context window?&lt;br&gt;
I didn't want to build a complicated memory architecture just to answer that question. So I tried something almost ridiculous. I exported my old chats and extracted conversations from Json files.&lt;br&gt;
The entire memory extractor was basically one rule&lt;br&gt;
If a line had more than 10 words, keep it.&lt;br&gt;
If it had 10 or fewer, throw it away.&lt;br&gt;
That's pretty much it. &lt;br&gt;
No LLM summarization during ingestion. No expensive memory model. No elaborate memory classification.&lt;br&gt;
The resulting text was then chunked and fed into my existing RAG. For every question, I allowed retrieval of only 8 chunks.&lt;br&gt;
So the experiment looked roughly like this:&lt;br&gt;
Old conversations&lt;br&gt;
       ↓&lt;br&gt;
Keep lines with &amp;gt;10 words&lt;br&gt;
       ↓&lt;br&gt;
Create chunks&lt;br&gt;
       ↓&lt;br&gt;
BM25 + semantic retrieval&lt;br&gt;
       ↓&lt;br&gt;
Top 8 chunks&lt;br&gt;
       ↓&lt;br&gt;
Feed back to same LLM&lt;br&gt;
Then I decided to actually try to break it.&lt;br&gt;
I used my own old conversations&lt;br&gt;
Instead of asking generic questions, I went back to conversations from the extracted chats and asked the LLM very specific questions.&lt;br&gt;
Things like old procurement discussions, financial figures, dates, coding decisions, project discussions and relationships between completely separate conversations.&lt;br&gt;
I asked roughly 13–14 questions.&lt;br&gt;
LLM failed.&lt;br&gt;
Then I fed the chunks from my RAG&lt;br&gt;&lt;br&gt;
And honestly, I expected it to fail much more often.&lt;br&gt;
It didn't.&lt;br&gt;
It recovered almost everything I asked about.&lt;br&gt;
It could retrieve exact amounts and dates. It could recover old technical discussions. In some cases, it could connect information from separate conversations and reconstruct what had happened.&lt;br&gt;
And remember:&lt;br&gt;
The model only received eight retrieved chunks.&lt;br&gt;
It wasn't given my entire historical conversation corpus.&lt;br&gt;
Then I found the obvious weakness&lt;br&gt;
The one clear failure was actually quite revealing.&lt;br&gt;
It was terrible at remembering code and commands may be since they are often less than 10 words. So my brilliant memory algorithm simply throws them away. But I tried to make it as a context builder rather than a storage. So I am satisfied with results. &lt;br&gt;
The LLM was restricted to use internet or think only to answer from its memory. I think if that was allowed that single miss would haven’t occurred. Its not a production grade memory management system. But it works gr8.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
