<?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>Forem: Om Ghorpade</title>
    <description>The latest articles on Forem by Om Ghorpade (@om_ghorpade_15264f1f27f40).</description>
    <link>https://forem.com/om_ghorpade_15264f1f27f40</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%2F3835586%2F3ab7f892-a8d8-418b-b0e7-60c602b5af84.png</url>
      <title>Forem: Om Ghorpade</title>
      <link>https://forem.com/om_ghorpade_15264f1f27f40</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/om_ghorpade_15264f1f27f40"/>
    <language>en</language>
    <item>
      <title>How We Used Hindsight Memory to Build an AI That Knows Your Weaknesses</title>
      <dc:creator>Om Ghorpade</dc:creator>
      <pubDate>Fri, 20 Mar 2026 14:09:17 +0000</pubDate>
      <link>https://forem.com/om_ghorpade_15264f1f27f40/how-we-used-hindsight-memory-to-build-an-ai-that-knows-your-weaknesses-2343</link>
      <guid>https://forem.com/om_ghorpade_15264f1f27f40/how-we-used-hindsight-memory-to-build-an-ai-that-knows-your-weaknesses-2343</guid>
      <description>&lt;p&gt;How We Used Hindsight Memory to Build an AI That Knows Your Weaknesses&lt;/p&gt;

&lt;p&gt;Most AI tools have a goldfish memory.&lt;br&gt;
You interact with them, get a response, close the tab — and they forget everything. The next time you come back, you are a complete stranger. This is fine for a chatbot. It is a disaster for a learning tool.&lt;br&gt;
When our team decided to build TraceX — an AI coding mentor — the first question we asked was not "which LLM should we use?" It was "how do we make this thing remember?"&lt;br&gt;
The answer was Hindsight.&lt;/p&gt;

&lt;p&gt;Why Memory Changes Everything for Learning Tools&lt;br&gt;
Think about how human mentors work. A great tutor does not just answer your question. They remember that last week you struggled with recursion. They notice that you keep forgetting null checks. They connect the dots across multiple sessions and give you feedback that actually helps you grow.&lt;br&gt;
AI tools cannot do this — not because the LLMs are not smart enough, but because they have no persistent memory layer between sessions.&lt;br&gt;
Hindsight solves this. It is a purpose-built memory system for AI agents that supports semantic search, temporal reasoning, and automatic knowledge consolidation.&lt;/p&gt;

&lt;p&gt;Building the Memory Layer&lt;br&gt;
My job on the team was the backend — specifically the Hindsight integration and API routes.&lt;br&gt;
The first thing I built was a simple wrapper around the two core Hindsight calls:&lt;br&gt;
javascriptimport { HindsightClient } from '@vectorize-io/hindsight-client';&lt;/p&gt;

&lt;p&gt;const client = new HindsightClient({&lt;br&gt;
  baseUrl: process.env.HINDSIGHT_URL,&lt;br&gt;
  apiKey: process.env.HINDSIGHT_API_KEY,&lt;br&gt;
});&lt;/p&gt;

&lt;p&gt;export async function storeMemory(content) {&lt;br&gt;
  await client.retain('TraceX', content);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;export async function fetchMemory(query) {&lt;br&gt;
  const response = await client.recall('TraceX', query);&lt;br&gt;
  return response.results.map(r =&amp;gt; r.text);&lt;br&gt;
}&lt;br&gt;
Simple. Clean. Two functions. But these two functions are what make the entire product work.&lt;/p&gt;

&lt;p&gt;The API Route That Powers Everything&lt;br&gt;
The /api/analyze route is the heart of TraceX. Here is exactly what happens when a student submits code:&lt;br&gt;
Step 1 — Recall past mistakes&lt;br&gt;
javascriptconst pastMistakes = await fetchMemory(&lt;br&gt;
  &lt;code&gt;What mistakes has this student made in ${topic}?&lt;/code&gt;&lt;br&gt;
);&lt;br&gt;
Step 2 — Send to Groq with memory context&lt;br&gt;
javascriptconst memoryContext = pastMistakes?.length&lt;br&gt;
  ? &lt;code&gt;HINDSIGHT MEMORY:\n${pastMistakes.join('\n')}\n\n&lt;/code&gt;&lt;br&gt;
  : '';&lt;br&gt;
// Groq now knows the student's full history&lt;br&gt;
Step 3 — Store the new mistake&lt;br&gt;
javascriptawait storeMemory(&lt;br&gt;
  &lt;code&gt;Student submitted ${language} code for ${topic}. Error: ${errorType}.&lt;/code&gt;&lt;br&gt;
);&lt;br&gt;
Step 4 — Return structured response&lt;br&gt;
javascriptreturn NextResponse.json({&lt;br&gt;
  analysis,&lt;br&gt;
  betterApproach,&lt;br&gt;
  correctedCode,&lt;br&gt;
  hindsightWarning,&lt;br&gt;
  pastMistakes,&lt;br&gt;
  memoryStored,&lt;br&gt;
});&lt;br&gt;
The order matters. Recall first, then analyze, then store. This ensures every response is informed by history before the new memory is added.&lt;/p&gt;

&lt;p&gt;What Hindsight Does Behind the Scenes&lt;br&gt;
What impressed me most about Hindsight is how it handles retrieval. It does not just do simple keyword matching. It uses four parallel search strategies — semantic search, keyword matching, graph traversal, and temporal reasoning.&lt;br&gt;
This means when TraceX asks "What mistakes has this student made in binary search?" — Hindsight does not just look for the exact phrase. It understands the semantic meaning, connects related concepts, and returns the most relevant memories even if the wording is different.&lt;br&gt;
For a learning tool, this is exactly what you need.&lt;/p&gt;

&lt;p&gt;The Result&lt;br&gt;
The difference between a first session and a fifth session on TraceX is dramatic.&lt;br&gt;
First session: "Your binary search has an off-by-one error. Fix the boundary condition."&lt;br&gt;
Fifth session: "You have made this exact boundary error in binary search 4 times. Your loop condition keeps using left &amp;lt; right instead of left &amp;lt;= right. This specific pattern needs your focused attention."&lt;br&gt;
Same code. Completely different feedback. Because now TraceX knows you.&lt;/p&gt;

&lt;p&gt;Try the Memory Layer Yourself&lt;br&gt;
The entire backend is open source. You can see exactly how retain() and recall() are implemented in the codebase.&lt;/p&gt;

&lt;p&gt;GitHub: &lt;a href="https://github.com/Anupam-codes7/TraceX" rel="noopener noreferrer"&gt;https://github.com/Anupam-codes7/TraceX&lt;/a&gt;&lt;br&gt;
Hindsight SDK: &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;https://github.com/vectorize-io/hindsight&lt;/a&gt;&lt;br&gt;
Hindsight Docs: &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;https://hindsight.vectorize.io/&lt;/a&gt;&lt;br&gt;
Agent Memory: &lt;a href="https://vectorize.io/features/agent-memory" rel="noopener noreferrer"&gt;https://vectorize.io/features/agent-memory&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are building any AI product that needs to remember users across sessions — Hindsight is the cleanest solution I have found.&lt;/p&gt;

</description>
      <category>hackathon</category>
      <category>ai</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
