<?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: Joshna Beemarapu</title>
    <description>The latest articles on DEV Community by Joshna Beemarapu (@joshna_beemarapu).</description>
    <link>https://dev.to/joshna_beemarapu</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4150288%2F401ddd9f-4d23-40a7-af64-781929fef0a6.jpg</url>
      <title>DEV Community: Joshna Beemarapu</title>
      <link>https://dev.to/joshna_beemarapu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/joshna_beemarapu"/>
    <language>en</language>
    <item>
      <title>How Hindsight Helped Me See a Trader’s Repeating Mistakes</title>
      <dc:creator>Joshna Beemarapu</dc:creator>
      <pubDate>Tue, 29 Sep 2026 16:38:15 +0000</pubDate>
      <link>https://dev.to/joshna_beemarapu/how-hindsight-helped-me-see-a-traders-repeating-mistakes-2nba</link>
      <guid>https://dev.to/joshna_beemarapu/how-hindsight-helped-me-see-a-traders-repeating-mistakes-2nba</guid>
      <description>&lt;h1&gt;
  
  
  How Hindsight Helped Me See a Trader’s Repeating Mistakes
&lt;/h1&gt;

&lt;p&gt;One thing I noticed while working on our trading journal agent is that knowing a trader’s past is very different from simply knowing trading rules.&lt;/p&gt;

&lt;p&gt;If someone tells an AI, “I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?”, the AI can explain why that might be risky.&lt;/p&gt;

&lt;p&gt;But what if it also knew that this same trader had done something similar several times before?&lt;/p&gt;

&lt;p&gt;That was the part I wanted to explore with Hindsight.&lt;/p&gt;

&lt;p&gt;Our project is a trading journal agent that keeps track of a trader’s previous trades and uses that history when answering new questions. We used a sample trader called Ravi for our testing.&lt;/p&gt;

&lt;p&gt;The interesting part wasn’t just making the agent remember information.&lt;/p&gt;

&lt;p&gt;It was seeing whether that memory could actually change the response.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with a normal AI conversation
&lt;/h2&gt;

&lt;p&gt;Imagine asking a normal AI:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It can give you a reasonable answer.&lt;/p&gt;

&lt;p&gt;It might explain that increasing your position after a loss can increase risk. It might mention revenge trading or emotional decision-making.&lt;/p&gt;

&lt;p&gt;But it doesn’t know whether you personally have a history of doing this.&lt;/p&gt;

&lt;p&gt;For our project, we wanted to test exactly that.&lt;/p&gt;

&lt;p&gt;So we first turned memory off.&lt;/p&gt;

&lt;p&gt;The agent answered the question using general trading knowledge, but it didn’t have Ravi’s previous trading experiences available.&lt;/p&gt;

&lt;p&gt;The result showed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memories used: 0&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That gave us our baseline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then we turned Hindsight memory on
&lt;/h2&gt;

&lt;p&gt;Next, we asked the exact same question again:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This time, the agent had access to Ravi’s previous trading experiences through Hindsight agent memory.&lt;/p&gt;

&lt;p&gt;The response became much more specific.&lt;/p&gt;

&lt;p&gt;Instead of only saying that increasing quantity after a loss is risky, it could connect the current situation to Ravi’s previous behavior.&lt;/p&gt;

&lt;p&gt;For example, his trading history included situations where he increased his position after a loss, entered another trade without a proper stop-loss, and tried to recover the previous loss quickly.&lt;/p&gt;

&lt;p&gt;The agent was able to bring those experiences into the current conversation.&lt;/p&gt;

&lt;p&gt;This time the response showed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memories used: 139&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That was the moment where the difference between a normal chatbot and a memory-enabled agent became much clearer to me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The same question, but different context
&lt;/h2&gt;

&lt;p&gt;The easiest way to demonstrate the difference was simply to ask the same question twice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory OFF
&lt;/h3&gt;

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

&lt;blockquote&gt;
&lt;p&gt;I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;The agent gives general trading advice.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memories used: 0&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Memory ON
&lt;/h3&gt;

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

&lt;blockquote&gt;
&lt;p&gt;I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;But now the agent can connect it with Ravi’s previous trades.&lt;/p&gt;

&lt;p&gt;It can point out that similar situations had happened before and that increasing position size after losses was part of a repeating pattern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memories used: 139&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The question didn’t change.&lt;/p&gt;

&lt;p&gt;The trader didn’t change.&lt;/p&gt;

&lt;p&gt;The difference was the context available to the agent.&lt;/p&gt;

&lt;p&gt;And that was exactly what we wanted to demonstrate with Hindsight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ravi’s previous trades made the difference
&lt;/h2&gt;

&lt;p&gt;While testing the system, we found several examples in Ravi’s trading history that were relevant to the question.&lt;/p&gt;

&lt;p&gt;There were trades where he entered again after a loss with a larger position.&lt;/p&gt;

&lt;p&gt;There were also trades where he didn’t use a stop-loss while trying to recover the previous loss.&lt;/p&gt;

&lt;p&gt;For example, the stored history includes previous HDFCBANK, BANKNIFTY and NIFTY trades where similar behavior appeared.&lt;/p&gt;

&lt;p&gt;Looking at one trade by itself doesn’t tell us much.&lt;/p&gt;

&lt;p&gt;But when the same type of behavior appears multiple times, it becomes much more useful context for the agent.&lt;/p&gt;

&lt;p&gt;That’s where I started seeing the real value of memory.&lt;/p&gt;

&lt;p&gt;The agent wasn’t just remembering:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Ravi traded BANKNIFTY.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It could use the history to understand:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Ravi has previously increased his position after losses, and this happened in situations similar to the one he’s asking about now.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s a much more useful kind of memory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Not every memory is a bad memory
&lt;/h2&gt;

&lt;p&gt;Another thing I liked about the project was that Ravi’s history wasn’t only made up of bad trades.&lt;/p&gt;

&lt;p&gt;There were also trades where he followed his checklist, planned his entry, defined his risk and used a stop-loss.&lt;/p&gt;

&lt;p&gt;So the agent could see both sides of his behavior.&lt;/p&gt;

&lt;h3&gt;
  
  
  Better pattern
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Setup identified&lt;/li&gt;
&lt;li&gt;Risk defined&lt;/li&gt;
&lt;li&gt;Stop-loss planned&lt;/li&gt;
&lt;li&gt;Checklist followed&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Problematic pattern
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Previous loss&lt;/li&gt;
&lt;li&gt;Immediate re-entry&lt;/li&gt;
&lt;li&gt;Larger quantity&lt;/li&gt;
&lt;li&gt;Stop-loss missing&lt;/li&gt;
&lt;li&gt;Trying to recover the loss&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This makes the memory more useful than simply storing a list of profits and losses.&lt;/p&gt;

&lt;p&gt;The context around the trade matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned from building this
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Memory is useful when it changes the response
&lt;/h3&gt;

&lt;p&gt;Before working on this project, I thought of memory mostly as something that lets an AI remember previous conversations.&lt;/p&gt;

&lt;p&gt;After testing it, I think the more interesting part is what happens after the information is remembered.&lt;/p&gt;

&lt;p&gt;If the memory doesn’t affect the agent’s response, it doesn’t add much value.&lt;/p&gt;

&lt;p&gt;In our case, the difference between Memory OFF and Memory ON made that very easy to see.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The same question can mean different things for different users
&lt;/h3&gt;

&lt;p&gt;“I lost ₹2,000. Should I re-enter with double quantity?” sounds like a simple question.&lt;/p&gt;

&lt;p&gt;But for Ravi, it has a history behind it.&lt;/p&gt;

&lt;p&gt;If this has happened several times before, the answer needs more context than a generic trading explanation.&lt;/p&gt;

&lt;p&gt;That’s where persistent memory becomes useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. A trading journal can contain more than numbers
&lt;/h3&gt;

&lt;p&gt;Initially, I thought of a trading journal mainly as entries, exits, quantities and profit/loss.&lt;/p&gt;

&lt;p&gt;But the reason behind a trade can be just as important.&lt;/p&gt;

&lt;p&gt;Knowing that a trader entered because of a particular setup is useful.&lt;/p&gt;

&lt;p&gt;Knowing that they entered again because they were trying to recover a previous loss is also useful.&lt;/p&gt;

&lt;p&gt;That context gives the agent something meaningful to work with.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Memory OFF vs Memory ON was the best test
&lt;/h3&gt;

&lt;p&gt;We could have simply shown that our application had a memory feature.&lt;/p&gt;

&lt;p&gt;But I think the comparison is much stronger.&lt;/p&gt;

&lt;p&gt;Ask the same question.&lt;/p&gt;

&lt;p&gt;Turn memory off.&lt;/p&gt;

&lt;p&gt;See the response.&lt;/p&gt;

&lt;p&gt;Turn memory on.&lt;/p&gt;

&lt;p&gt;Ask again.&lt;/p&gt;

&lt;p&gt;Now you can actually see what the memory layer changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What surprised me
&lt;/h2&gt;

&lt;p&gt;The most interesting part wasn’t that the agent could remember an old trade.&lt;/p&gt;

&lt;p&gt;It was that the old trades could become relevant to a completely new question.&lt;/p&gt;

&lt;p&gt;A single ₹2,000 loss doesn’t tell you much.&lt;/p&gt;

&lt;p&gt;But if the agent can connect that situation with several previous examples of increasing position size after losses, it gives the current conversation a completely different context.&lt;/p&gt;

&lt;p&gt;That is what I found interesting about using Hindsight.&lt;/p&gt;

&lt;p&gt;The goal isn’t simply:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“The AI remembers.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;“The AI remembers the relevant past when it matters.”&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For our trading journal agent, that meant moving from general trading advice toward responses that were grounded in Ravi’s own previous behavior.&lt;/p&gt;

&lt;p&gt;And that’s the part of agent memory I found most interesting while building this project.&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftmksidirpuicpp2e65k5.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftmksidirpuicpp2e65k5.png" alt=" " width="800" height="407"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm6iwntv2sdfka9enicpz.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fm6iwntv2sdfka9enicpz.png" alt=" " width="800" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>aiengineering</category>
      <category>memory</category>
      <category>trading</category>
    </item>
  </channel>
</rss>
