transcribe

Your AI Agent Keeps Making the Same Mistakes - Sparsh Jain, CentralAgent AI

AI Engineer · 14m · transcribed 12h ago
More from AI Engineer Business
𝕏 Share ▶ YouTube 📥 PDF 🤖 .md

Section Insights

# 0:00

Challenges with AI Agent Memory

What are the limitations of current AI agents in learning from past experiences?

Despite two years of experience, AI agents continue to repeat the same mistakes due to inadequate memory and context management. The need for a better system to handle context and memory was identified, as simply increasing context does not necessarily improve performance.

  • AI agents often repeat mistakes despite extensive experience.
  • More context does not equate to better performance at enterprise scale.
  • A new mechanism is needed to effectively manage AI memory.
# 2:59

Understanding Experiential Memory

How can experiential memory improve AI agent performance?

Experiential memory, which includes fact-based and experiential layers, is crucial for AI agents. It can be categorized into case-based, strategy-based, and skill-based memories, allowing agents to learn from past experiences and apply strategies effectively.

  • Experiential memory is essential for differentiating AI from traditional systems.
  • Categorizing memory into case-based, strategy-based, and skill-based enhances learning.
  • Developing a robust memory infrastructure is just the beginning of solving AI challenges.
# 5:59

The Importance of Forgetting in AI

Why is forgetting important for AI agents?

Forgetting is crucial for AI agents to avoid being overwhelmed by excessive information. An example illustrates that perfect recall can lead to decision paralysis, highlighting the need for a mechanism to forget irrelevant or outdated information.

  • Forgetting helps prevent information overload in AI systems.
  • Perfect memory can hinder decision-making and performance.
  • A balanced approach to memory management is necessary for effective AI.
# 8:59

Optimizing Memory Infrastructure

How can memory infrastructure be optimized for AI agents?

The memory infrastructure can be optimized through formation, updation, and retrieval processes. This allows agents to gather context more efficiently, reducing the time and effort required for tasks and improving overall performance.

  • Efficient memory management significantly reduces task completion time.
  • Improved retrieval processes enhance agent performance.
  • Continuous improvement and adaptation are key to AI success.
# 11:59

Building Autonomous AI Teams

How do AI agents gain experience and improve performance in teams?

AI agents can gain experience by working with multiple team members, effectively multiplying their learning opportunities. This leads to the emergence of autonomous teams where AI agents significantly enhance team performance.

  • AI agents can accumulate experience faster than individual humans.
  • Collaboration between humans and AI creates powerful autonomous teams.
  • The right memory infrastructure empowers AI agents to outperform human counterparts.

Transcript

0:00 You work with your AI agent for the last 2 years. You gained 2 years of experience. Your agent No. 10 people on your team work with the same AI agent. They cumulatively gained two decades of engineering experience. Your agent still there. It keeps on repeating the same mistakes again and again. I was talking to a senior executive at the world's biggest hedge fund and he said, "Sparsh, the problem is not that the AI of the agents are not smart.

0:38 The problem is that it keeps on repeating the same mistakes again and again. If I course corrected today, then in the next session or with another team, it just makes that same mistake again. And the issue is that there are so many mistakes that we cannot improve those things at all times. We need a mechanism or we need a system to resolve this issue." And at that point of time, we realized that everyone is talking about context.

1:07 Everyone is talking about memory. And the answer is we just need to take all the context, all the memory and give it to agents so that it will figure out. It was good in the start, but soon we realized at enterprise scale the issue is the context can be too big and giving all the facts to the agents just not increase the performance. It increases the cost, it increases the effort, it increases the overall time taken and on top of that it decreases it decreases the overall accuracy that is there, it decreases the performance. And there we realized that more context doesn't equal to better intelligence after a point. When you have When we are starting, when we have a smaller context base, yes, it means that, but after a point of time, it doesn't mean that. And we need a better mechanism, a better way to solve that problem.

1:57 Here, we went to the back the drawing board and think like how why exactly we humans we get better with time. And at that point of time, we realized we humans have the skill of experience, of a judgment. And this judgment clears gets better with time when we learn something, when we make mistakes, and when we course correct. And that is a missing piece from a lot of these agents.

2:29 And there we realized that at this point of time earlier, the memory was not learning for us. When we came back, when we built the system, the performance gain for us was 10x. And what exactly we came upon as the understanding of the memory is it's divided into two parts. The short-term memory and long-term memory. Short-term memory is the working memory or active session memory.

3:01 The long-term memory is divided into two parts. Fact-based memory and experiential memory. This layer of experiential-based memory was something that has been missing now. And these are the abstracted out learnings from whatever we do with agents. And this is what makes we humans different from the AI that was here earlier. And further, this experiential layer can be doubled down into three different categories. The case-based, strategy-based, and the skill-based.

3:33 Case-based is the detailed case and the detailed learning. The strategy is if you were in that particular situation, then what kind of strategy worked for us and what we should use. And then finally, is something that can be abstracted out, generalized very well. We abstract that thing out into a skill which an agent can use again and again. And this is how we built this experiential layer in the agents. This experiential memory is something that helps.

4:05 At this point, we thought we have solved the problem of memory infrastructure. But, solving this problem made us realize that this is just a start of the problem and there are so many other bigger problems out there that form just because we solved this problem and we are able to see it because we reached this stage. And that is in the current times, the systems are changing very fast. The data drift, the system drift, the overall the whole environment drift.

4:37 The world is changing every week, every month. An year feels like a decade in the AI years. So, the agent that works today doesn't work in a month or a year's time frame and we need to think through how we update that thing. And once we ran through a lots and lots of experiments, we came up on this understanding of the memory is that it's not just you make the system or the memory once, but it's just you have to evolve or make it better with time.

5:06 And then in the final case, we came upon this architecture. That memory infrastructure pipeline is divided The lifecycle is divided into three parts. The formation, the updation, and the retrieval. Retrieval is very important. Now, formation we already understood right now. The updation is the part which evolves the system in which you add new notes when there are new experiences or facts.

5:37 You update the older notes or like deactivate the notes which are no longer useful. And then finally, you have this forgetting. In updation, only storing the final layer of judgment is not enough in all cases. Because if you just store that, the agent can make a mistake and go back to the older point which had which was earlier and we just removed it. So, a better way is if it's a surface level research, it just looks at active nodes. And if it's a deeper research, it looks at the active nodes and the inactive nodes. And inactive nodes are the temporal journey that the system took to get the final layer of the judgment that is there.

6:16 And then finally is the forgetting node, which is a must of very important here, and we cannot forget it. Let me give you an example. In the late 20th century, there was a person named Sheriv Sherosky. This is a human with near perfect memory with 100% recall. Now, you might be thinking, if we have got that particular memory, our life would have been amazing. But when the scientists and researchers studied his life, they started to realize a lot of times, when he even has to make a smaller decisions, his life was miserable because every point used to compete for an equal prioritization and an equal winning in things for something which we humans can take in a decision in a quick second.

7:09 It was 100 thoughts fighting in his mind. And he gets overwhelmed. And that is the issue with our agents. If you keep on adding everything, if you keep on accumulating everything, and if you do not forget things which are no longer true or which are no longer required, then you might end up in a state where the system gets overwhelmed, and it the results just doesn't get better with time. So, you need to have a mechanism to forget things.

7:41 Now, once you build this pipeline, we started with providing this memory to agents. We build this experiential agents. Now, we build this evolving experiential agents. But still, everything is manual. We thought we have solved the problem, but what's possible today, it was just half of the solution. Let me ask you a question. In the past 6 months, what has changed in the AI world?

8:13 The models have become smarter. But that's only a smaller part. The bigger breakthrough is that the model is so smart enough that it can be the verifier. Until now, the situation was we always have to have the humans in the loop to review everything. But now for the first time, the model is smart enough such that we can bake that thing into a layer in itself as a verifier into the system so that the system gets better with time by itself.

8:43 And then finally, we have this retrieval part. Now, in the retrieval aspect of things, your system's maximum performance can be just equivalent to the maximum performance of the retrieval. You might be asking, "Why?" Let me give you an example. Let's say I work in San Francisco and I have a home here. I also have a home in New York. I got off out of my office and I asked my AI agent, "Pull the maps for the home."

9:16 Midway through the route, I realize, "This is not a place where I should be going." And then I realize I wanted to go to my San Francisco home. For the agent, the home is home, whether it's New York or San Francisco, and it put the map for the New York home. And there I realize, no matter how good my system is, the formation and the updation and the knowledge I have and the experiences I have, if my retriever doesn't give me the right information, it's just of no use. The whole system is of no use. And that's where the retrieval part of our system is very, very important.

9:57 And then finally, once we have this thing, we have the formation, the updation, and the retrieval, this is how we complete the life cycle of the memory infrastructure we have. And let me tell you, earlier for gathering context for our agent for a lot of cases, it used to take 20 minutes. But now if we have gathered that context earlier and we know what all together, that same agent just takes 2 minutes of time and that's not only the improvement in the timing.

10:21 It It is improving in the efforts it has to make It can make it It improves in the tokens it costs and it overall improves the performance of our agents in the long horizon task because it doesn't have to think through too much in the things we have already thought earlier. And this is just the start of the system. Now the next level comes, that is how we made the system self-evolving and experiential. And in that particularly, we built this concept of cycles, our dreaming cycles.

10:54 Now we humans have a tendency when we take rest or when we sleep, our mind, it cleans the things which are no longer important. It takes a prioritized items to the front and whatever is left, it rearranges and cleans everything. Such that next day when I wake up, I feel very refreshed. I can think clearly. And that is something we built within the agents. We built this looping and the eval infrastructure such that we clean the things which are no longer important, we update the things which should be prioritized and we rearrange the things such that the next day and whenever the context is getting accumulated, the agent is able to perform better and better.

11:38 And then finally, once we build this infrastructure, earlier the issue for us was the agents cannot remember anything. But now with the 2 years of experience, we are able to give more experience to the agents than any one of us humans. And we learned that there are three golden rules when we are building this experiential memory. First, do not dump everything. You have to remember you have to disclose progressively. Second, you cannot make a system once and assume it will always perform good. You have to improve the system continuously. And then finally, instead of writing prompts, you have to move towards writing these loops because that is how you make this whole infrastructure for you autonomous.

12:26 An example for us is once you build this memory layer formation, updation, and retrieval, you build an observability layer around it. Once we have observability, we build this looping layer combined with the eval layer such that which after every session, after every day, extracts the learnings, improves the systems, test it independently, and then finally make the changes in the real system. Now, this looping, this evals, and the security gardens around the whole memory infrastructure is a very interesting topic.

13:03 But that's a topic for my next talk. And coming back to the problem we had that we were not getting experiences. Now, with this thing, we whenever the agent work with me, it gains that experience. Whenever it it works with any one of on my team, it gains that experience, too. So, for me as a human, I'm get gaining getting only 1 year of experience in 1 year, but this agent, since it's working with all those 10 members, it's getting that 10x experience, and it's getting better than any one of us in the team. And now, because of that, we have started to see this autonomous teams of humans plus AI agents combined. And in some of the teams I know, like their team is like 10x or 100x because this agent that they have created, this agentic infrastructure and the memory behind it, it's just that is powering them, it's just empowering these agents such that some of these agents are far better than any of the best engineers or people or employees out there in that team. And soon, like in the next 6 to 9 months, we have we will start to see more and more of these autonomous AI companies in which agents are collaborating with each other, and they just remember everything.

14:10 Such that now, if you implement these things, whatever performance you have, it just will compound exponentially with time because it's not learning only with you. It learns with every member of the team and it gets better and better with time such that in the near future there will be a stage within your enterprise where this agent has learned more than any one of our person in the different domains in the different systems. And I would like to tell this one thing is people who do not remember from the mistakes or the agents who do not remember from their mistakes are condemned to repeat it. Build this memory infrastructure and get back to growing exponentially better and build a 10x or 100x team.

Summary

The discussion focuses on the challenges faced by AI agents in learning from past mistakes and the need for a robust memory infrastructure to enhance their performance. The speaker emphasizes the importance of experiential memory, which allows AI agents to learn and adapt over time, ultimately leading to significant improvements in efficiency and accuracy.

- AI agents often repeat mistakes due to inadequate memory and context management.
- Simply increasing context does not enhance performance; it can lead to inefficiencies and inaccuracies.
- A two-part memory system—short-term and long-term—was developed, with long-term memory further divided into fact-based and experiential memory.
- Experiential memory includes case-based, strategy-based, and skill-based learning, making AI agents more human-like in their decision-making.
- Continuous evolution of memory is crucial to adapt to rapidly changing environments and data.
- The memory lifecycle comprises formation, updation, and retrieval, with a focus on effective forgetting to avoid overwhelming the system.
- A self-evolving system was created, allowing agents to learn from experiences and improve autonomously over time.
- The integration of observability and looping mechanisms ensures ongoing improvement and adaptation of the AI agents, leading to enhanced team performance.

Questions Answered

What are the limitations of current AI agents in learning from past experiences?

Despite two years of experience, AI agents continue to repeat the same mistakes due to inadequate memory and context management. The need for a better system to handle context and memory was identified, as simply increasing context does not necessarily improve performance.

How can experiential memory improve AI agent performance?

Experiential memory, which includes fact-based and experiential layers, is crucial for AI agents. It can be categorized into case-based, strategy-based, and skill-based memories, allowing agents to learn from past experiences and apply strategies effectively.

Why is forgetting important for AI agents?

Forgetting is crucial for AI agents to avoid being overwhelmed by excessive information. An example illustrates that perfect recall can lead to decision paralysis, highlighting the need for a mechanism to forget irrelevant or outdated information.

How can memory infrastructure be optimized for AI agents?

The memory infrastructure can be optimized through formation, updation, and retrieval processes. This allows agents to gather context more efficiently, reducing the time and effort required for tasks and improving overall performance.

How do AI agents gain experience and improve performance in teams?

AI agents can gain experience by working with multiple team members, effectively multiplying their learning opportunities. This leads to the emergence of autonomous teams where AI agents significantly enhance team performance.

© transcribe · For agents Built with care and craft by Gokul Rajaram