● LIVE
OpenAI releases GPT-5 APIIndia AI startup raises $120MBitcoin ETF hits record inflowsMeta Llama 4 benchmarks leakedOpenAI releases GPT-5 APIIndia AI startup raises $120MBitcoin ETF hits record inflowsMeta Llama 4 benchmarks leaked
📅 Sat, 21 Mar, 2026✈️ Telegram
AiFeed24

AI & Tech News

🔍
✈️ Follow
🏠Home🤖AI💻Tech🚀Startups₿Crypto🔒Security🇮🇳India☁️Cloud🔥Deals
✈️ News Channel🛒 Deals Channel
Home/Cloud & DevOps/IterAI: An AI Coding Mentor That Learns From Your Failures Using Memory
☁️Cloud & DevOps

IterAI: An AI Coding Mentor That Learns From Your Failures Using Memory

We Built a Coding Mentor That Remembers Your Mistakes “Did it seriously just tell me I always mess up recursion?” We paused for a second and just stared at the screen. The model wasn’t just answering the question—it was pointing out a pattern we never explicitly told it about. That was the moment It

⚡Quick SummaryAI generating...
A

Agrim Jain

📅 Mar 21, 2026·⏱ 5 min read·Dev.to ↗
✈️ Telegram𝕏 TweetWhatsApp
📡

Original Source

Dev.to

https://dev.to/agrim_jain_a16108ff4972e9/iterai-an-ai-coding-mentor-that-learns-from-your-failures-using-memory-n38
Read Full ↗

We Built a Coding Mentor That Remembers Your Mistakes

“Did it seriously just tell me I always mess up recursion?”

We paused for a second and just stared at the screen. The model wasn’t just answering the question—it was pointing out a pattern we never explicitly told it about.

That was the moment IterAI stopped feeling like just another chatbot… and started feeling like something that actually understands how people learn.

What We Built

Most AI coding tools today are really good at one thing: giving answers.

You paste your code, they fix it, maybe explain a bit, and you move on.

But here’s the problem—most of the time, you don’t actually learn anything.

So we built IterAI, a coding mentor designed around a simple idea:

learning should come from your mistakes, not just correct answers.

Instead of treating every interaction as brand new, IterAI remembers what you struggled with and uses that to guide you next time.

At a high level, it has three main parts:

  • A chat interface for coding questions
  • A practice mode for solving problems
  • A memory layer powered by Hindsight that tracks mistakes and weak areas

The interface feels familiar.

But what’s happening underneath is very different.

The Problem With Stateless AI

Our first version was honestly, pretty basic:

ts
const response = await model.generate({
prompt: userInput
});

And to be fair it worked.
It gave correct answers, explained concepts clearly, and even generated decent code.
But something felt off.
Every interaction was isolated.
A user could ask:
“Explain recursion”
…and later:
“Why is my recursive function failing?”
And the model would treat those as completely unrelated.
No memory. No continuity. No awareness of struggle.
That’s when it clicked for us:
Without memory, there is no mentorship.

Adding Memory With Hindsight
That’s where Hindsight came in.
Instead of just storing conversations, we started storing learning events—structured pieces of information about how users fail.
await hindsight.store({
user_id: userId,
event: {
type: "mistake",
topic: "recursion",
input: userCode,
feedback: aiExplanation,
timestamp: Date.now()
}
});
Now, whenever a user:
• writes incorrect logic
• repeats a mistake
• struggles with a concept
…it becomes part of their learning history.
At this point, we weren’t just storing text anymore.
We were storing patterns of thinking.

Retrieval Isn’t Just Search
Initially, we treated memory like a search problem:
const past = await hindsight.search({
user_id: userId,
query: currentQuestion
});
But this didn’t feel right.
If someone asks:
“Why is my loop not working?”
We don’t just want similar past questions.
We want:
• their previous loop mistakes
• patterns in their logic errors
• known weak areas
So we changed our approach.
Instead of “searching,” we started building context:
const memoryContext = await hindsight.getRelevant({
user_id: userId,
filters: ["mistakes", "weak_topics"],
limit: 3
});
And then used that inside the prompt:
const response = await model.generate({
prompt: `
User question: ${input}

Past weaknesses:
${memoryContext}

Explain clearly and focus on these weak areas.
`
});
That one shift made the system feel completely different.

When It Started Feeling Real
Before adding memory:
• The AI gave clean, generic explanations
After adding memory:
• It started saying things like:
“You often miss base cases in recursion. Let’s fix that step-by-step.”
That’s not just answering anymore.
That’s teaching.

The Failure Coach
We also introduced something we call the Failure Coach.
Instead of simply saying “incorrect,” the system breaks mistakes down into structured insights:
function analyzeFailure(code, expected) {
return {
error_type: "logic_error",
missed_concept: "base_case",
explanation: "...",
steps_to_fix: [...]
};
}
Over time, this builds a profile like:
• struggles with recursion base cases
• misses edge conditions in loops
• confuses array indexing
Now the system doesn’t just fix your code—it understands how you fail.

The Feedback Loop
What surprised us most is how naturally this turned into a learning loop:

  1. You make a mistake
  2. The system stores it
  3. Future responses adapt
  4. You improve
  5. New mistakes refine the system At some point, it stops feeling like a tool. It starts feeling like a mentor.

A Real Example
First interaction:
User:
“Why does my recursion not stop?”
System:
Explains base case
Stored:
{
"topic": "recursion",
"mistake": "missing base case"
}

Later interaction:
User:
“Fix this function”
System:
“You’ve struggled with recursion base cases before—let’s check that first.”
It’s a small thing.
But it completely changes the experience.

What Didn’t Work
Not everything went smoothly.
Too Much Memory
At one point, we passed too much past data into the prompt.
Result:
• messy responses
• confusion
• irrelevant suggestions
Fix:
limit: 3

Storing Everything
We initially tried storing every interaction.
That quickly became noise.
Fix:
• store meaningful mistakes only
• ignore trivial queries

Weak Categorization
If you don’t tag mistakes properly, memory becomes useless.
Bad:
{ "type": "error" }
Better:
{ "type": "logic_error", "topic": "loops" }

What It Feels Like Now
Most AI tools feel like:
“Here’s your answer.”
IterAI feels more like:
“Here’s why you keep getting this wrong—and how to fix it.”
It’s a small shift in wording.
But a huge shift in experience.

Lessons We Learned
• Memory without structure doesn’t work
• Personalization matters more than raw intelligence
• More context isn’t always better
• Mistakes are the best signal for learning
• Good mentorship requires remembering patterns

Closing Thought
We didn’t set out to build a better chatbot.
We wanted to build something that actually learns how you fail—and helps you improve because of it.
Hindsight didn’t just make the system smarter.
It made it remember.
And once a system remembers, it stops being just a tool…
and starts becoming a mentor.

Tags:#cloud#dev.to

Found this useful? Share it!

✈️ Telegram𝕏 TweetWhatsApp

Read the Full Story

Continue reading on Dev.to

Visit Dev.to ↗

Related Stories

☁️
☁️Cloud & DevOps

Majority Element

about 2 hours ago

☁️
☁️Cloud & DevOps

Building a SQL Tokenizer and Formatter From Scratch — Supporting 6 Dialects

about 2 hours ago

☁️
☁️Cloud & DevOps

Markdown Knowledge Graph for Humans and Agents

about 2 hours ago

Moving Beyond Disk: How Redis Supercharges Your App Performance
☁️Cloud & DevOps

Moving Beyond Disk: How Redis Supercharges Your App Performance

about 2 hours ago

📡 Source Details

Dev.to

📅 Mar 21, 2026

🕐 about 4 hours ago

⏱ 5 min read

🗂 Cloud & DevOps

Read Original ↗

Web Hosting

🌐 Hostinger — 80% Off Hosting

Start your website for ₹69/mo. Free domain + SSL included.

Claim Deal →

📬 AiFeed24 Daily

Top 5 AI & tech stories every morning. Join 40,000+ readers.

✦ 40,218 subscribers · No spam, ever

Cloud Hosting

☁️ Vultr — $100 Free Credit

Deploy cloud servers in 25+ locations. From $2.50/mo. No contract.

Claim $100 Credit →
AiFeed24

India's AI-powered tech news hub. Daily coverage of AI, startups, crypto and emerging technology.

✈️🛒

Topics

Artificial IntelligenceStartups & VCCryptocurrencyCybersecurityCloud & DevOpsIndia Tech

Company

About AiFeed24Write For UsContact

Daily Digest

Top 5 AI stories every morning. 40,000+ readers.

No spam, ever.

© 2026 AiFeed24 Media.Affiliate Disclosure — We earn commission on qualifying purchases at no extra cost to you.
PrivacyTermsCookies