How Hindsight Helped Me See a Trader’s Repeating Mistakes
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.
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.
But what if it also knew that this same trader had done something similar several times before?
That was the part I wanted to explore with Hindsight.
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.
The interesting part wasn’t just making the agent remember information.
It was seeing whether that memory could actually change the response.
The problem with a normal AI conversation
Imagine asking a normal AI:
“I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?”
It can give you a reasonable answer.
It might explain that increasing your position after a loss can increase risk. It might mention revenge trading or emotional decision-making.
But it doesn’t know whether you personally have a history of doing this.
For our project, we wanted to test exactly that.
So we first turned memory off.
The agent answered the question using general trading knowledge, but it didn’t have Ravi’s previous trading experiences available.
The result showed:
Memories used: 0
That gave us our baseline.
Then we turned Hindsight memory on
Next, we asked the exact same question again:
“I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?”
This time, the agent had access to Ravi’s previous trading experiences through Hindsight agent memory.
The response became much more specific.
Instead of only saying that increasing quantity after a loss is risky, it could connect the current situation to Ravi’s previous behavior.
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.
The agent was able to bring those experiences into the current conversation.
This time the response showed:
Memories used: 139
That was the moment where the difference between a normal chatbot and a memory-enabled agent became much clearer to me.
The same question, but different context
The easiest way to demonstrate the difference was simply to ask the same question twice.
Memory OFF
Question:
I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?
Result:
The agent gives general trading advice.
Memories used: 0
Memory ON
Question:
I just took a ₹2,000 loss. Should I immediately re-enter with double quantity?
But now the agent can connect it with Ravi’s previous trades.
It can point out that similar situations had happened before and that increasing position size after losses was part of a repeating pattern.
Memories used: 139
The question didn’t change.
The trader didn’t change.
The difference was the context available to the agent.
And that was exactly what we wanted to demonstrate with Hindsight.
Ravi’s previous trades made the difference
While testing the system, we found several examples in Ravi’s trading history that were relevant to the question.
There were trades where he entered again after a loss with a larger position.
There were also trades where he didn’t use a stop-loss while trying to recover the previous loss.
For example, the stored history includes previous HDFCBANK, BANKNIFTY and NIFTY trades where similar behavior appeared.
Looking at one trade by itself doesn’t tell us much.
But when the same type of behavior appears multiple times, it becomes much more useful context for the agent.
That’s where I started seeing the real value of memory.
The agent wasn’t just remembering:
“Ravi traded BANKNIFTY.”
It could use the history to understand:
“Ravi has previously increased his position after losses, and this happened in situations similar to the one he’s asking about now.”
That’s a much more useful kind of memory.
Not every memory is a bad memory
Another thing I liked about the project was that Ravi’s history wasn’t only made up of bad trades.
There were also trades where he followed his checklist, planned his entry, defined his risk and used a stop-loss.
So the agent could see both sides of his behavior.
Better pattern
- Setup identified
- Risk defined
- Stop-loss planned
- Checklist followed
Problematic pattern
- Previous loss
- Immediate re-entry
- Larger quantity
- Stop-loss missing
- Trying to recover the loss
This makes the memory more useful than simply storing a list of profits and losses.
The context around the trade matters.
What I learned from building this
1. Memory is useful when it changes the response
Before working on this project, I thought of memory mostly as something that lets an AI remember previous conversations.
After testing it, I think the more interesting part is what happens after the information is remembered.
If the memory doesn’t affect the agent’s response, it doesn’t add much value.
In our case, the difference between Memory OFF and Memory ON made that very easy to see.
2. The same question can mean different things for different users
“I lost ₹2,000. Should I re-enter with double quantity?” sounds like a simple question.
But for Ravi, it has a history behind it.
If this has happened several times before, the answer needs more context than a generic trading explanation.
That’s where persistent memory becomes useful.
3. A trading journal can contain more than numbers
Initially, I thought of a trading journal mainly as entries, exits, quantities and profit/loss.
But the reason behind a trade can be just as important.
Knowing that a trader entered because of a particular setup is useful.
Knowing that they entered again because they were trying to recover a previous loss is also useful.
That context gives the agent something meaningful to work with.
4. Memory OFF vs Memory ON was the best test
We could have simply shown that our application had a memory feature.
But I think the comparison is much stronger.
Ask the same question.
Turn memory off.
See the response.
Turn memory on.
Ask again.
Now you can actually see what the memory layer changes.
What surprised me
The most interesting part wasn’t that the agent could remember an old trade.
It was that the old trades could become relevant to a completely new question.
A single ₹2,000 loss doesn’t tell you much.
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.
That is what I found interesting about using Hindsight.
The goal isn’t simply:
“The AI remembers.”
It’s:
“The AI remembers the relevant past when it matters.”
For our trading journal agent, that meant moving from general trading advice toward responses that were grounded in Ravi’s own previous behavior.
And that’s the part of agent memory I found most interesting while building this project.


Top comments (0)