<?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: Aman Kumar</title>
    <description>The latest articles on DEV Community by Aman Kumar (@amankr2776).</description>
    <link>https://dev.to/amankr2776</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%2F3837113%2F6fb9884c-8695-4c6d-b0a7-c7257a76ee35.png</url>
      <title>DEV Community: Aman Kumar</title>
      <link>https://dev.to/amankr2776</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amankr2776"/>
    <language>en</language>
    <item>
      <title>I Built a Coding Mentor That Remembered My Mistakes Better Than I Did</title>
      <dc:creator>Aman Kumar</dc:creator>
      <pubDate>Sat, 21 Mar 2026 14:29:14 +0000</pubDate>
      <link>https://dev.to/amankr2776/i-built-a-coding-mentor-that-remembered-my-mistakes-better-than-i-did-39mo</link>
      <guid>https://dev.to/amankr2776/i-built-a-coding-mentor-that-remembered-my-mistakes-better-than-i-did-39mo</guid>
      <description>&lt;p&gt;I used to think I was bad at recursion. Turns out, I wasn't bad at recursion — I just kept forgetting the same base case error every single time I opened a new tab on LeetCode.&lt;br&gt;
That realization hit me hard one Sunday afternoon when I failed the exact same Fibonacci problem I had failed three weeks earlier on a different platform. Same error. Same confusion. Same wasted hour. The platform had no idea. It just cheerfully served me another random problem like nothing had happened.&lt;br&gt;
That's when I decided to build something different.&lt;/p&gt;

&lt;p&gt;The Problem With Every Coding Platform You've Used&lt;br&gt;
LeetCode, HackerRank, Codecademy — I have used them all. They are brilliant for volume. But they all share one fatal flaw: they have the memory of a goldfish.&lt;br&gt;
Every session starts from zero. The platform has no idea you struggled with off-by-one errors in binary search last Tuesday. It doesn't know you have a habit of forgetting empty list handling in Python. It doesn't connect your past failures to your future challenges. You are essentially paying to repeat your own mistakes indefinitely.&lt;br&gt;
I call this Context Amnesia. And it is the single biggest reason developers hit learning plateaus that last months.&lt;br&gt;
The fix wasn't complicated in theory. What if the AI actually remembered?&lt;/p&gt;

&lt;p&gt;What I Built&lt;br&gt;
CodeMentor AI is a full-stack coding practice platform that uses Hindsight — an open source agent memory system by Vectorize — to remember every mistake a user makes across every session, forever.&lt;br&gt;
When you submit wrong code, the mistake is saved to Hindsight memory. When you log back in two days later, the AI recalls those exact mistakes and generates a problem specifically targeting your weak spots. After 5 sessions, it reflects on patterns. After 10 sessions, it builds a complete mental model of how you think as an engineer.&lt;br&gt;
The result is an AI mentor that genuinely gets smarter the more you use it — not just within a session, but across weeks and months.&lt;br&gt;
&lt;strong&gt;Live demo&lt;/strong&gt;: ai-coding-mentor-eight.vercel.app&lt;br&gt;
&lt;strong&gt;GitHub&lt;/strong&gt;: github.com/amankr2776/ai-coding-mentor&lt;/p&gt;

&lt;p&gt;How Hindsight Memory Powers the Entire App&lt;br&gt;
This is the part I am most proud of. Hindsight's agent memory system isn't bolted on as a feature — it is the architectural backbone of CodeMentor AI. Every intelligent behavior in the app flows from these four functions.&lt;br&gt;
retain() — Every Mistake Becomes an Asset&lt;br&gt;
The moment a user submits wrong code, we don't just show an error. We archive it:&lt;/p&gt;

&lt;p&gt;typescriptawait hindsight.retain(&lt;br&gt;
  &lt;code&gt;User practiced ${topic} in ${language}. &lt;br&gt;
   Result: failure. &lt;br&gt;
   Error: ${rootCause}&lt;/code&gt;,&lt;br&gt;
  { type: 'failure', topic, language, difficulty, title }&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;We also call retain when a user asks for a hint (meaning they got stuck), when they fail a quiz question, and when they take longer than 15 minutes on a problem. Every struggle becomes a data point in their personal learning matrix.&lt;br&gt;
recall() — Personalized Problems, Not Random Ones&lt;br&gt;
Before generating any new problem, the AI mentor recalls your history:&lt;br&gt;
typescriptconst memories = await hindsight.getHistory();&lt;br&gt;
const weaknessSummary = memories&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%2Fnq5hpy3hw20tndp9a42s.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%2Fnq5hpy3hw20tndp9a42s.png" alt=" " width="800" height="386"&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%2Ft0clzlzzrpmh3sf8vyt2.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%2Ft0clzlzzrpmh3sf8vyt2.png" alt=" " width="800" height="383"&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%2Fcgu3t40k4ldywjfu2v4k.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%2Fcgu3t40k4ldywjfu2v4k.png" alt=" " width="800" height="384"&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%2Fx86u2usgnyho7qswwjuy.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%2Fx86u2usgnyho7qswwjuy.png" alt=" " width="800" height="381"&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%2Fdlqpyo8jz23okwbfw9f2.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%2Fdlqpyo8jz23okwbfw9f2.png" alt=" " width="800" height="383"&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%2Fe39rlz6s981ze7wgy70e.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%2Fe39rlz6s981ze7wgy70e.png" alt=" " width="800" height="382"&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%2Fqvfhj4k3fp3xkjq1w054.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%2Fqvfhj4k3fp3xkjq1w054.png" alt=" " width="800" height="361"&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%2F0g0rqbgm8pl0nkiqfrgb.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%2F0g0rqbgm8pl0nkiqfrgb.png" alt=" " width="800" height="388"&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%2Fo4307bfnnll751y503xt.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%2Fo4307bfnnll751y503xt.png" alt=" " width="800" height="387"&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%2Fzky6rfr4qvb0cp7utvqs.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%2Fzky6rfr4qvb0cp7utvqs.png" alt=" " width="800" height="384"&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%2F94gjtwtzd41iz5epx5y6.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%2F94gjtwtzd41iz5epx5y6.png" alt=" " width="800" height="383"&gt;&lt;/a&gt;&lt;br&gt;
  .slice(0, 20)&lt;br&gt;
  .map(m =&amp;gt; m.content)&lt;br&gt;
  .join("\n");&lt;br&gt;
// This context gets injected into the Groq Llama-3 prompt&lt;br&gt;
If you failed Dynamic Programming problems three times this week, the system clusters those failures and generates a challenge that directly targets that gap. Not a random problem. Your problem.&lt;br&gt;
reflect() — Finding Patterns You Cannot See Yourself&lt;br&gt;
Every 5 submissions, the app triggers a reflection:&lt;br&gt;
typescriptawait client.reflect('abhimanu', 'summarize user learning patterns');&lt;br&gt;
Hindsight's reflect function analyzes the raw memories and synthesizes higher-level observations like: "User is proficient in Python syntax but consistently fails at space complexity optimization in matrix problems."&lt;br&gt;
These observations show up on the Neural Insights dashboard and power the smart notifications — things like "You haven't practiced recursion in 3 days" or "You are close to mastering arrays."&lt;br&gt;
createMentalModel() — A Technical Profile That Evolves&lt;br&gt;
Every 10 interactions, the app builds a formal mental model:&lt;br&gt;
typescriptawait client.createMentalModel(&lt;br&gt;
  'abhimanu',&lt;br&gt;
  'User Learning Profile',&lt;br&gt;
  'What are the key learning patterns and weak areas of this user?'&lt;br&gt;
);&lt;br&gt;
This becomes the "system prompt override" for the AI mentor — ensuring it talks to you like a coach who knows your entire history, not a chatbot that just woke up.&lt;/p&gt;

&lt;p&gt;The Part That Surprised Me&lt;br&gt;
I want to be honest: I did not expect Hindsight to store as much rich, structured information as it did.&lt;br&gt;
When I first tested the app and checked the Hindsight Cloud dashboard, I was genuinely shocked. The World Facts tab had 61 memories. Experience had 77. Observations had 44 synthesized patterns. All from just a few hours of testing.&lt;br&gt;
The memory graph looked like a neural network — nodes connected by semantic, temporal, entity, and causal links. Hindsight wasn't just storing strings. It was building a knowledge graph of the user's learning behavior automatically, without me writing any extra code.&lt;br&gt;
That was the moment I understood what agent memory actually means. It is not a database. It is a living model of a person's knowledge state.&lt;/p&gt;

&lt;p&gt;Building the Practice Page: The Hardest Part&lt;br&gt;
I handled the frontend, styling, and memory integration. The practice page was by far the hardest thing I built.&lt;br&gt;
The challenge was making the code evaluation feel intelligent rather than mechanical. Early versions used exact string matching — if your output didn't match the expected output character for character, you got marked wrong. That was terrible. A trailing newline would fail a perfectly correct solution.&lt;br&gt;
The final approach uses Groq to evaluate semantically:&lt;br&gt;
typescriptconst prompt = &lt;code&gt;Evaluate this ${language} code for the problem.&lt;br&gt;
Check line by line for syntax errors, logic errors, wrong output.&lt;br&gt;
Respond in JSON: {"passed": true/false, "feedback": "...", &lt;br&gt;
"correctCode": "...", "mistakes": [...]}&lt;/code&gt;;&lt;br&gt;
When code is wrong, it shows a side-by-side comparison with the correct solution, highlights the exact lines that differ, and saves the specific mistake to Hindsight so next time the AI knows exactly where you struggled.&lt;/p&gt;

&lt;p&gt;What I Would Do Differently&lt;br&gt;
The biggest lesson: call retain with richer content.&lt;br&gt;
Early on I was saving minimal strings like "User failed problem." That's useless for recall. The memories that actually powered good personalization were the detailed ones — the ones that explained the topic, the language, the specific error type, and the root cause analysis from Groq.&lt;br&gt;
The quality of recall is entirely dependent on the quality of what you retain. Garbage in, garbage out — but with Hindsight, good data in means genuinely intelligent responses out.&lt;/p&gt;

&lt;p&gt;The Stack&lt;/p&gt;

&lt;p&gt;Frontend: Next.js 15 with Tailwind CSS&lt;br&gt;
Memory: Hindsight by Vectorize — the open source agent memory system&lt;br&gt;
LLM: Groq API with Llama-3.3-70b-versatile&lt;br&gt;
Code Execution: Piston API (free, no key needed)&lt;br&gt;
Deployment: Vercel&lt;/p&gt;

&lt;p&gt;Try It Yourself&lt;br&gt;
The live demo is at ai-coding-mentor-eight.vercel.app. Submit a few wrong solutions and then check how the next problem changes. The memory effect becomes visible within 3-4 sessions.&lt;br&gt;
If you want to build something similar, start with the Hindsight documentation and the open source repo. The SDK is clean and the retain/recall pattern is surprisingly simple to implement. The hard part is deciding what to remember — which turns out to be a product design question more than a technical one.&lt;br&gt;
The code is open source at github.com/amankr2776/ai-coding-mentor. If you build something with Hindsight, I'd genuinely love to see what patterns you discover in your users' memory banks.&lt;/p&gt;

&lt;p&gt;Aman Kumar — built the frontend, styling, and Hindsight memory integration for CodeMentor AI.&lt;/p&gt;

&lt;p&gt;Team HACKONAUT&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
