<?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: Karan Patil</title>
    <description>The latest articles on DEV Community by Karan Patil (@karanpatill).</description>
    <link>https://dev.to/karanpatill</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%2F3835805%2F42994e1b-9498-4a11-acfd-4d99fa1a5c64.jpeg</url>
      <title>DEV Community: Karan Patil</title>
      <link>https://dev.to/karanpatill</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/karanpatill"/>
    <language>en</language>
    <item>
      <title>How Hindsight Gave My Agent a Real Memory</title>
      <dc:creator>Karan Patil</dc:creator>
      <pubDate>Fri, 20 Mar 2026 16:52:28 +0000</pubDate>
      <link>https://dev.to/karanpatill/how-hindsight-gave-my-agent-a-real-memory-1377</link>
      <guid>https://dev.to/karanpatill/how-hindsight-gave-my-agent-a-real-memory-1377</guid>
      <description>&lt;p&gt;"It actually remembered." My teammate stared at the screen as CodeMentor AI greeted her with — "Last time you struggled with hash maps. Want to try a problem that builds on that?" We hadn't written a single line of personalization code.&lt;/p&gt;

&lt;p&gt;That was somewhere around 1:30 AM. I was in Pune, running on chai and stubbornness, and this was probably my third hackathon. I had been building for about 14 hours straight using AI tools to move fast — and honestly, even I didn't fully expect it to work this well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try it live: &lt;a href="https://codemento.netlify.app/" rel="noopener noreferrer"&gt;codemento.netlify.app&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  How This Started
&lt;/h2&gt;

&lt;p&gt;I'll be straight with you — I didn't know what Hindsight was when the hackathon started. The problem statement said "build AI agents that learn using Hindsight" and I opened the docs, got confused, and ended up just asking Claude to explain it to me like I was five.&lt;/p&gt;

&lt;p&gt;Turns out it's actually simple. Hindsight is a memory layer for AI agents. Three operations: store a memory, fetch relevant memories, reason over them. That's it. Once I understood that, the whole project clicked.&lt;/p&gt;

&lt;p&gt;The idea was this: every AI coding tool forgets you the moment you close the tab. I wanted to build one that didn't. A coding mentor that remembers your worst habits, your patterns, your progress — and actually uses that to help you get better.&lt;/p&gt;

&lt;p&gt;I called it CodeMentor AI.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Actually Built
&lt;/h2&gt;

&lt;p&gt;The app looks like VS Code had a baby with an AI tutor. Monaco Editor in the center, problem list on the left, AI mentor chat on the right. 75 LeetCode-style problems, live test case evaluation, a skill radar chart showing your strengths, and a 3D animated background because why not.&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%2Fkw9r4c5oogo3ryc8yyjs.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%2Fkw9r4c5oogo3ryc8yyjs.png" alt=" " width="800" height="448"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Main interface — VS Code-style editor with problem list, complexity analyzer, and AI mentor sidebar&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The whole thing runs in the browser — React + Vite + TypeScript. Groq's &lt;code&gt;llama-3.3-70b&lt;/code&gt; for the AI mentor because it's fast and free. And Hindsight for the part that actually makes it interesting.&lt;/p&gt;

&lt;p&gt;I built most of it using AI coding agents. Not because I'm lazy — because the hackathon had a submission deadline and I was one person trying to ship something real. The Hindsight integration though, I wrote carefully myself. That was the whole point of the project.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Skill Radar — What the Agent Actually Knows About You
&lt;/h2&gt;

&lt;p&gt;One of the first things you'll notice is the Skills tab. It's a radar chart showing your strengths across Arrays, Strings, DP, Stacks, Math, and Sorting — all derived from your Hindsight memory.&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%2Fmy5rqznoxhdv9t2twtlf.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%2Fmy5rqznoxhdv9t2twtlf.png" alt="Skill Radar Chart" width="800" height="449"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The skill radar — built entirely from Hindsight recalled memories, not hardcoded scores&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Every score on that chart comes from &lt;code&gt;recall()&lt;/code&gt;. The agent fetches your past attempts, parses successes and failures per topic tag, and builds the visualization from real data. No hardcoded scores. No fake progress bars. It's what Hindsight actually knows about you.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Memory Architecture — Three Functions
&lt;/h2&gt;

&lt;p&gt;The entire memory system is three API calls. Here's exactly how I use each one.&lt;/p&gt;
&lt;h3&gt;
  
  
  retain() — After Every Code Submission
&lt;/h3&gt;

&lt;p&gt;Every time someone runs their code, I call &lt;code&gt;retain()&lt;/code&gt; with a structured summary:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;retain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hindsightKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bankId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; attempted "&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;" (&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;difficulty&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;) in &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.
   Result: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;pass&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;SOLVED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;FAILED&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;. Attempt #&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attempts&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.
   &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;pass&lt;/span&gt;
     &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="s2"&gt;`Error: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;. Failed &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;failedCount&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; test cases.
        Code snippet: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;
     &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Solved successfully.&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
   &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;pass&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;failure&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;difficulty&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;difficulty&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;language&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;lang&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;timestamp&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toISOString&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Important thing I learned: don't store the raw code. Store the &lt;em&gt;meaning&lt;/em&gt;. "Karan failed Two Sum attempt 3, used brute force O(n²), missed the hash map optimization" — that's a useful memory. 400 lines of wrong JavaScript is noise.&lt;/p&gt;

&lt;p&gt;I also call &lt;code&gt;retain()&lt;/code&gt; when someone clicks the hint button. That tells the system they got stuck, and on what. Small signal, but it adds up over sessions.&lt;/p&gt;

&lt;h3&gt;
  
  
  recall() — Before Showing Any Guidance
&lt;/h3&gt;

&lt;p&gt;When a user selects a problem, I immediately fetch relevant memories:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;memories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;hindsightKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;bankId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; past attempts and errors on &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And when the app loads, I run a broader query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;patterns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;hindsightKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;bankId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; overall coding patterns and common mistakes`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;8&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These memories go directly into the AI mentor's system prompt. That's how it knows your history — not magic, just accurate retrieval fed as context.&lt;/p&gt;

&lt;p&gt;What surprised me here: &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt; uses something called TEMPR — four search strategies running in parallel (semantic, keyword, graph, temporal). So a query like "Karan's array problems" finds memories you'd miss with pure vector search. It surfaces the related attempts, the pattern across sessions, not just exact matches.&lt;/p&gt;

&lt;h3&gt;
  
  
  reflect() — Before AI Generates Feedback
&lt;/h3&gt;

&lt;p&gt;Before the mentor responds to a failed submission, I call &lt;code&gt;reflect()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reflection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;reflect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nx"&gt;hindsightKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;bankId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="s2"&gt;`What are &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;'s main weaknesses based on their coding history?`&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This goes into the system prompt alongside the recalled facts. Here's what the actual AI mentor response looks like when someone is stuck:&lt;/p&gt;

&lt;p&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%2Fbjfncz752qqsbtt8po3l.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%2Fbjfncz752qqsbtt8po3l.png" alt=" " width="800" height="489"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;The mentor explaining dynamic programming for Coin Change — specific and actionable, not generic&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;And when they ask for a hint directly:&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%2Fxaa0ksryhgenb5btrrm1.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%2Fxaa0ksryhgenb5btrrm1.png" alt=" " width="513" height="477"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Hint response — based on the user's actual code and past history, not a generic answer&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The system prompt looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;systemPrompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;`You are CodeMentor AI, an expert coding tutor for &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;.

Memory context from Hindsight:
&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;memories&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;m&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;m&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;

Reflection on this user:
&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;reflection&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;

Current problem: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; (&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;problem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;difficulty&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;)
Their code: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;code&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;&lt;span class="s2"&gt;

Give a targeted 2-3 sentence hint. Don't give the full solution.`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response is specific because the system prompt has context. The LLM isn't guessing — it knows what you've tried, what failed, and what concept you're missing.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Part That Caught Me Off Guard
&lt;/h2&gt;

&lt;p&gt;Around 2 AM, something happened that I genuinely didn't expect.&lt;/p&gt;

&lt;p&gt;I hadn't touched the greeting logic. There was no code that said "if user has past memories, say something personalized." But when my teammate opened the app for the second time, the AI greeted her with a message referencing her exact history from the previous session.&lt;/p&gt;

&lt;p&gt;It worked because the recalled memories were in the context. The LLM just used them naturally. I hadn't engineered that behavior. It emerged.&lt;/p&gt;

&lt;p&gt;That's what &lt;a href="https://vectorize.io/features/agent-memory" rel="noopener noreferrer"&gt;agent memory done properly&lt;/a&gt; feels like. It's not a feature you add. It's a capability that unlocks when the agent actually knows something about you.&lt;/p&gt;

&lt;p&gt;The other thing that caught me off guard: Hindsight auto-consolidates memories into higher-level Observations in the background. After a few sessions of data, the system had synthesized "this user tends to skip edge case handling" without me writing any consolidation logic. The &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight docs&lt;/a&gt; mention this, but it didn't sink in until I saw it working.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I'd Do Differently
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Query design is everything.&lt;/strong&gt; The quality of &lt;code&gt;recall()&lt;/code&gt; results depends entirely on your query strings. I rewrote mine three times. "User mistakes" is useless. "User failed attempts on array problems involving sorting" is much better. Spend time here.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test in session 3, not session 1.&lt;/strong&gt; I kept testing by clearing my memory bank and starting fresh. That's the wrong test. The interesting behavior shows up in the third or fourth session when patterns have accumulated. I almost shipped without ever testing that scenario properly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Don't store full code.&lt;/strong&gt; I tried this early on. After two sessions, the context was bloated with irrelevant code snippets and the AI responses got worse. Summarize aggressively. Store decisions and outcomes, not implementations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Call &lt;code&gt;recall()&lt;/code&gt; proactively.&lt;/strong&gt; Don't wait for the user to ask something. Fetch memories the moment context changes — problem selected, new session started, chat opened. Front-loading context is what makes responses feel intelligent.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It
&lt;/h2&gt;

&lt;p&gt;The app is live at &lt;strong&gt;&lt;a href="https://codemento.netlify.app/" rel="noopener noreferrer"&gt;codemento.netlify.app&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You'll need a free Groq key from &lt;a href="https://groq.com" rel="noopener noreferrer"&gt;groq.com&lt;/a&gt; and a free Hindsight Cloud account from &lt;a href="https://ui.hindsight.vectorize.io" rel="noopener noreferrer"&gt;ui.hindsight.vectorize.io&lt;/a&gt; — use code &lt;code&gt;MEMHACK315&lt;/code&gt; for $50 in free credits.&lt;/p&gt;

&lt;p&gt;If you're building anything with repeat users — a tutor, a support agent, a coding assistant, anything — persistent memory isn't optional. It's the difference between a tool people use once and forget, and one they actually come back to.&lt;/p&gt;

&lt;p&gt;I built this in one night, mostly on chai, with a lot of help from Claude when I got stuck. If I can ship this in 14 hours, you can integrate Hindsight into whatever you're building this weekend.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built at HackWithIndia 2026 — Karan Patil, Pune.&lt;/em&gt;&lt;br&gt;&lt;br&gt;
&lt;em&gt;Team: Sarvesh Gajakosh, Priya Vhatkar, Krishna Hasare, Siddhi Shinde, Aashta Sawade.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Resources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight on GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vectorize.io/features/agent-memory" rel="noopener noreferrer"&gt;Agent Memory — Vectorize&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codemento.netlify.app/" rel="noopener noreferrer"&gt;CodeMentor AI — Live Demo&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

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