Memory in AI agents

Google Cloud Tech www.youtube.com

간략한 요약

이 비디오에서는 AI 에이전트의 메모리 관리에 대해 설명합니다. 에이전트의 기능과 원하는 결과를 얻기 위해 다양한 유형의 메모리가 사용됩니다. 주요 메모리 유형으로는 작업 기억, 단기 기억, 장기 기억이 있습니다.

  • 작업 기억은 에이전트가 작업을 완료하는 데 필요한 중간 상태를 저장하는 데 사용됩니다.
  • 단기 기억은 현재 세션 또는 대화의 컨텍스트를 저장하는 데 사용됩니다.
  • 장기 기억은 세션 전후에 필요한 속성이나 정보를 저장하는 데 사용됩니다.

이러한 메모리 유형을 구현하는 방법과 다중 에이전트 시스템에서 메모리를 사용하는 방법도 설명합니다. 데이터 개인 정보 보호 규칙을 적용하여 특정 데이터를 특정 에이전트 내에 유지하는 방법도 다룹니다.

소개

AI 에이전트의 메모리와 상태 관리에 대한 소개입니다. 에이전트의 메모리 관리는 애플리케이션에서 상태를 관리하는 것과 유사합니다. 다양한 유형의 메모리가 있으며, 각 유형은 에이전트의 특정 기능과 원하는 결과를 위해 사용됩니다.

메모리의 종류

작업 기억, 단기 기억, 장기 기억을 포함한 다양한 유형의 메모리에 대해 설명합니다. 작업 기억은 수학 문제를 풀 때 연습장에 메모하는 것처럼, 에이전트가 작업을 완료하는 데 필요한 중간 상태를 저장하는 데 사용됩니다. 단기 기억은 에이전트가 참여하고 있는 현재 세션 또는 대화의 컨텍스트를 저장하는 데 사용됩니다. 장기 기억은 세션 중 또는 후에 필요할 수 있는 속성이나 정보를 저장하는 데 사용됩니다.

메모리 구현

에이전트 기반 시스템에서 각 메모리 유형을 구현하는 방법에 대해 설명합니다. 작업 기억은 에이전트가 작업을 완료하는 데 사용하는 응답 또는 출력을 저장하는 데 사용될 수 있습니다. 단기 기억은 메모리 저장소와 같은 것을 사용하여 세션에 저장할 수 있습니다. 장기 기억은 세션 시작 시 에이전트에 전달되는 장기 속성으로 구성될 수 있습니다. 장기 속성은 작업 및 단기 메모리를 요약하여 얻은 주요 정보를 저장합니다. 코딩 에이전트에서 항상 수정되는 사항을 장기 속성으로 저장하여 매번 다시 계산하는 대신 작업 시작 시 에이전트에게 상기시킬 수 있습니다.

다중 에이전트 시스템

다중 에이전트 시스템에서 메모리 관리에 대해 설명합니다. 에이전트는 공통 세션을 사용하여 서로 통신해야 하지만, 수행하는 작업에 따라 자체 세션 정보를 가질 수도 있습니다. 데이터 개인 정보 보호 규칙을 사용하여 특정 데이터를 특정 에이전트 내에 유지하고, 식별되지 않은 정보를 후속 작업 및 에이전트에 전달할 수 있습니다.

결론

AI 에이전트의 메모리 관리는 애플리케이션 개발과 크게 다르지 않다는 결론을 내립니다. 데이터 유형과 형식을 앱과 시스템 간에 조정해야 하는 점을 제외하면 유사합니다. LLM 메모리에 대한 자세한 내용은 아래 링크에서 확인할 수 있습니다.

유튜브 영상을 몇 초 만에 요약하세요

무료 Summ 앱으로 어떤 영상이든 이런 요약을 원하는 언어로 받아보세요.

App Store에서 다운로드
Google Play에서 다운로드

스크립트

“Memory in AI agents”의 전체 스크립트입니다. 타임스탬프를 클릭하면 해당 장면부터 영상이 열려요. 다른 영상이 필요하다면 유튜브 스크립트 추출기를 이용하세요.

0:05 Welcome back to real terms for AI. In today's journey on our agent and agentic path, we'll be talking about memory and agents. You mean state? Well, yes. Memory and agents is a lot like managing state in an app. So, we're done. I'm glad that you think we could be, but no. Since you're so clearly talkative about this, how about you walk us through the beginnings of it? That's what I wanted to do. Let's talk all about memory. Just like us, there are many different types of memory you pair with different agent components, both for features, functionality, and to get to the outcome that you want. We'll cover some of the top ones here, starting with working memory. You can think of working memory just like a piece of scratch paper you might have when you're completing multiple tasks together where you're managing some sort

0:51 of storage in order to store incremental states in order to compute the next state that you need to move to. This is kind of like how you could write down different lines of a long algebra or calculus problem ultimately to find the answer. Another type of memory is short-term memory. This is the context of an existing session or conversation that the agents or agents are part of. Short-term memory is information that is relevant about the session that the agent may need to know. And long-term memory is another type. These are things that we may need to compute during or even after the session is over or after the agent is done. These are typically attributes about one of the agents about say something that happened in the session that we should remember for the future. And there are many other types of memory that you may read about out there which can be applied to specific agent scenarios or specific workflows.

1:37 Let's walk through how you could implement each of these types of memories for an agent-based system. First, for working memory, this could be as simple as storing a response or an output the agent is using to complete the task. You could store it in memory or throw it in a variable. Depends on the size. Next, short-term memory could be stored in a session using something like memory store. The thing here is we want to be able to recall that context very quickly and continue passing it along in the session to subsequent steps to provide as much information as possible in order to answer a question. the most accurately. We may want to store, for example, rag results in short-term memory that we can then use in future tasks with those different values. However, we may also want to consider how we can delete information here because let's say we have the wrong answer in one of our rag results. We

2:24 don't want our agent to overweight to that information. So, let's delete it so we don't use that moving forward. And last, long-term memory is almost like its own system. You might pass in long-term attributes to an agent at the start of a session. Things like, hey, this is what I know about the user or I always need to address X when I'm building this type of code. But collecting long-term memory is very much like our brain does. Is this a sort of brain dump? We need to take all of the working and short-term memory and then provide some level of summarization to provide the key points. Then we store this, not all that long session data that may have generated those attributes. Long-term attributes become very important over time where, for example, in a coding agent, you have things that are always corrected. You could use a long-term attribute to remind the agent at the outset of the task instead of having to recomputee

3:10 that correction again every time, which gets expensive. And just like we talked with a conversational agent, you'll use these concepts if you have systems with multiple agents. Agents need to communicate with each other using things like a common session, but agents might also have their own session information depending on the sorts of tasks they're performing. You might also choose to use some data privacy rules to keep certain data within a particular agent, say a credit card number, and then pass around the deidentified information to subsequent tasks and agents instead. You can find more about this in our discussions about data privacy from our first season of Real Terms with AI. So I think we covered many state concepts here and each of these patterns can map to things that you might already do in application development. So it's not really that different after all except

3:55 for marshalling. Like I said, not that different from building applications after all. Remember how much we need to marshall data types and formats between apps and systems. Try not to. Yeah. No, definitely lost plenty of time doing that. Uh you can find out more about LLM memory in the links below with a few guides to get going. for myself and Aza. As always, happy prompting. [Music]

Share

다른 영상 요약