<?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: Sayed Khasim pasha</title>
    <description>The latest articles on DEV Community by Sayed Khasim pasha (@sd_khasim_pasha).</description>
    <link>https://dev.to/sd_khasim_pasha</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%2F3840648%2F8efc0d2a-8635-461b-9c1a-dfe6264ab37d.jpg</url>
      <title>DEV Community: Sayed Khasim pasha</title>
      <link>https://dev.to/sd_khasim_pasha</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sd_khasim_pasha"/>
    <language>en</language>
    <item>
      <title>AI coding mentor</title>
      <dc:creator>Sayed Khasim pasha</dc:creator>
      <pubDate>Mon, 23 Mar 2026 18:19:19 +0000</pubDate>
      <link>https://dev.to/sd_khasim_pasha/ai-coding-mentor-6l0</link>
      <guid>https://dev.to/sd_khasim_pasha/ai-coding-mentor-6l0</guid>
      <description>&lt;h1&gt;
  
  
  My agent warns me before I repeat bugs
&lt;/h1&gt;

&lt;p&gt;“⚡ You made this mistake before!”&lt;/p&gt;

&lt;p&gt;That message popped up while I was debugging a simple Python loop—and it genuinely surprised me. I wasn’t using a better model or smarter prompts. I had just added memory.&lt;/p&gt;

&lt;p&gt;This project is an AI Coding Mentor built with Streamlit that helps users write, run, and debug code. But the interesting part isn’t code execution or explanations—it’s the ability to remember past mistakes and use them to improve future interactions.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I built
&lt;/h2&gt;

&lt;p&gt;I built a coding assistant that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lets users write code in multiple languages&lt;/li&gt;
&lt;li&gt;Executes Python code in real time&lt;/li&gt;
&lt;li&gt;Explains errors using AI&lt;/li&gt;
&lt;li&gt;Remembers past mistakes&lt;/li&gt;
&lt;li&gt;Warns users when they repeat the same errors&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The system is built using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Streamlit (UI)&lt;/li&gt;
&lt;li&gt;Groq API (AI explanations)&lt;/li&gt;
&lt;li&gt;A custom memory system (inspired by Hindsight)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The problem: AI forgets everything
&lt;/h2&gt;

&lt;p&gt;Most coding assistants behave like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You make a mistake&lt;/li&gt;
&lt;li&gt;It explains the error&lt;/li&gt;
&lt;li&gt;You fix it&lt;/li&gt;
&lt;li&gt;It forgets everything&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So what happens?&lt;/p&gt;

&lt;p&gt;👉 Users repeat the same mistakes again and again&lt;br&gt;&lt;br&gt;
👉 The assistant gives the same explanation again&lt;br&gt;&lt;br&gt;
👉 No real learning happens  &lt;/p&gt;

&lt;p&gt;I wanted to change that.&lt;/p&gt;




&lt;h2&gt;
  
  
  Adding memory (Inspired by Hindsight)
&lt;/h2&gt;

&lt;p&gt;Instead of treating each error independently, I added a memory layer.&lt;/p&gt;

&lt;p&gt;Learn more about the concept here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hindsight GitHub: &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;https://github.com/vectorize-io/hindsight&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Documentation: &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;https://hindsight.vectorize.io/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Agent Memory Overview: &lt;a href="https://vectorize.io/features/agent-memory" rel="noopener noreferrer"&gt;https://vectorize.io/features/agent-memory&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, whenever an error occurs, I store:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The code&lt;/li&gt;
&lt;li&gt;The error message&lt;/li&gt;
&lt;li&gt;The suggested fix&lt;/li&gt;
&lt;/ul&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
st.session_state.history.append((code, err, fix))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>ai</category>
      <category>learning</category>
      <category>python</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
