<?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: Mohammed Sulaiman</title>
    <description>The latest articles on DEV Community by Mohammed Sulaiman (@krayr).</description>
    <link>https://dev.to/krayr</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%2F3840388%2F341dfbde-1053-4d2d-92c9-c4a491fcf095.png</url>
      <title>DEV Community: Mohammed Sulaiman</title>
      <link>https://dev.to/krayr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/krayr"/>
    <language>en</language>
    <item>
      <title>I stopped storing chats and built a stateful study agent instead !!</title>
      <dc:creator>Mohammed Sulaiman</dc:creator>
      <pubDate>Mon, 23 Mar 2026 16:31:53 +0000</pubDate>
      <link>https://dev.to/krayr/i-stopped-storing-chats-and-built-a-stateful-study-agent-instead--45dm</link>
      <guid>https://dev.to/krayr/i-stopped-storing-chats-and-built-a-stateful-study-agent-instead--45dm</guid>
      <description>&lt;p&gt;My study assistant kept forgetting everything. Not after a day — after one message.&lt;/p&gt;

&lt;p&gt;That turned out to be a design problem, not a model problem.&lt;/p&gt;

&lt;p&gt;What this is&lt;/p&gt;

&lt;p&gt;My team and I built a single-page app that combines a few things students usually use separately:&lt;/p&gt;

&lt;p&gt;A Pomodoro timer with session tracking&lt;br&gt;
Flashcards with feedback loops&lt;br&gt;
A quiz system that logs mistakes&lt;br&gt;
A simple chatbot&lt;br&gt;
Progress tracking like XP, streaks, and subjects&lt;/p&gt;

&lt;p&gt;Everything runs in the browser. No backend. Data is stored locally.&lt;/p&gt;

&lt;p&gt;The interesting part isn’t the features — it’s how they all feed into a shared memory layer.&lt;/p&gt;

&lt;p&gt;The problem: fake memory&lt;/p&gt;

&lt;p&gt;The first version of the chatbot didn’t actually remember anything.&lt;/p&gt;

&lt;p&gt;You could tell it you’re weak at something, and in the very next message it would ignore that completely.&lt;/p&gt;

&lt;p&gt;It wasn’t because the model was bad. It was because every interaction was stateless.&lt;/p&gt;

&lt;p&gt;Each message was treated like a fresh start.&lt;/p&gt;

&lt;p&gt;What I tried first&lt;/p&gt;

&lt;p&gt;We started with the obvious approach: pass previous messages back into the system.&lt;/p&gt;

&lt;p&gt;That helped a little, but it created new problems:&lt;/p&gt;

&lt;p&gt;Context quickly filled with irrelevant messages&lt;br&gt;
Old conversations polluted new responses&lt;br&gt;
Prompts grew without improving quality&lt;br&gt;
There was still no real understanding of the user&lt;/p&gt;

&lt;p&gt;It felt like I was simulating memory instead of actually building it.&lt;/p&gt;

&lt;p&gt;The shift: stop storing chats&lt;/p&gt;

&lt;p&gt;The turning point was simple:&lt;/p&gt;

&lt;p&gt;I stopped storing conversations.&lt;/p&gt;

&lt;p&gt;Instead, I stored state.&lt;/p&gt;

&lt;p&gt;Very small, structured pieces of information:&lt;/p&gt;

&lt;p&gt;Weak topics&lt;br&gt;
Current tasks&lt;br&gt;
Active subjects&lt;br&gt;
Study activity&lt;/p&gt;

&lt;p&gt;No chat logs. No transcripts. Just signals.&lt;/p&gt;

&lt;p&gt;This approach is similar to how systems like Hindsight&lt;br&gt;
 treat memory — focusing on structured recall instead of replaying conversations. Their documentation&lt;br&gt;
 and ideas around agent memory&lt;br&gt;
 helped reinforce that this direction made sense.&lt;/p&gt;

&lt;p&gt;Where the data comes from&lt;/p&gt;

&lt;p&gt;The key idea was to stop asking the user directly.&lt;/p&gt;

&lt;p&gt;Instead, I inferred everything from behavior.&lt;/p&gt;

&lt;p&gt;If a user gets a quiz question wrong, that topic becomes a weakness.&lt;br&gt;
If they mark a flashcard as “Again”, that’s another signal.&lt;br&gt;
If they complete a study session, that updates activity.&lt;/p&gt;

&lt;p&gt;Over time, the system builds a picture of the user without requiring explicit input.&lt;/p&gt;

&lt;p&gt;This turned out to be much more reliable.&lt;/p&gt;

&lt;p&gt;How responses changed&lt;/p&gt;

&lt;p&gt;Instead of feeding in past conversations, I started passing a small, structured summary of the user’s state.&lt;/p&gt;

&lt;p&gt;Things like:&lt;/p&gt;

&lt;p&gt;What they struggle with&lt;br&gt;
What they’re currently working on&lt;br&gt;
What they’ve been studying recently&lt;/p&gt;

&lt;p&gt;That context is small, but highly relevant.&lt;/p&gt;

&lt;p&gt;And it made a big difference.&lt;/p&gt;

&lt;p&gt;Before vs after&lt;/p&gt;

&lt;p&gt;Same question:&lt;/p&gt;

&lt;p&gt;What should I study today?&lt;/p&gt;

&lt;p&gt;Before:&lt;br&gt;
A generic answer with no personalization.&lt;/p&gt;

&lt;p&gt;After:&lt;br&gt;
A specific suggestion based on weak topics and current tasks.&lt;/p&gt;

&lt;p&gt;Nothing about the model changed.&lt;/p&gt;

&lt;p&gt;Only the input context changed.&lt;/p&gt;

&lt;p&gt;Persistence&lt;/p&gt;

&lt;p&gt;Everything is stored locally in the browser.&lt;/p&gt;

&lt;p&gt;When the page reloads, the state is restored.&lt;/p&gt;

&lt;p&gt;I deliberately avoided adding a backend.&lt;/p&gt;

&lt;p&gt;For this kind of system:&lt;/p&gt;

&lt;p&gt;The data is user-specific&lt;br&gt;
Simplicity matters more than scale&lt;br&gt;
Fast iteration matters more than infrastructure&lt;/p&gt;

&lt;p&gt;Local storage was enough.&lt;/p&gt;

&lt;p&gt;What didn’t work&lt;/p&gt;

&lt;p&gt;A few things I tried and dropped:&lt;/p&gt;

&lt;p&gt;Storing full chat conversations&lt;br&gt;
Trying to summarize chats&lt;br&gt;
Adding more and more context&lt;/p&gt;

&lt;p&gt;None of these improved behavior in a meaningful way.&lt;/p&gt;

&lt;p&gt;They mostly added noise.&lt;/p&gt;

&lt;p&gt;Where this still breaks&lt;/p&gt;

&lt;p&gt;The system works, but it’s not perfect.&lt;/p&gt;

&lt;p&gt;Weak topics never decay over time&lt;br&gt;
All signals are treated equally&lt;br&gt;
There’s no sense of time or recency&lt;br&gt;
Everything is stored globally instead of per subject&lt;/p&gt;

&lt;p&gt;It’s simple, and that simplicity shows.&lt;/p&gt;

&lt;p&gt;What I’d change next&lt;/p&gt;

&lt;p&gt;If I continue this, I’d focus on:&lt;/p&gt;

&lt;p&gt;Weighting topics based on frequency&lt;br&gt;
Reducing the importance of older data&lt;br&gt;
Separating memory by subject&lt;br&gt;
Possibly adding sync across devices&lt;/p&gt;

&lt;p&gt;But I’d keep the same core idea.&lt;/p&gt;

&lt;p&gt;Takeaway&lt;/p&gt;

&lt;p&gt;The system didn’t improve when I added more memory.&lt;/p&gt;

&lt;p&gt;It improved when I became selective about what to remember.&lt;/p&gt;

&lt;p&gt;Chat history felt like memory.&lt;/p&gt;

&lt;p&gt;Structured state actually worked.&lt;/p&gt;

&lt;p&gt;Curious how others are approaching this.&lt;/p&gt;

&lt;p&gt;Are you storing more data, or just better data?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4t0nsoz9wx36v0olxg21.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4t0nsoz9wx36v0olxg21.png" alt=" " width="800" height="373"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhm2zmli2k6xop41dbwu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzhm2zmli2k6xop41dbwu.png" alt=" " width="800" height="1177"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
