A-MEM: Agentic Memory for LLM Agents (ArXiv 2025)


1. 문제 정의 (Why?)

LLM agent는 tool 사용 + reasoning은 강하지만:

기존 memory 시스템의 한계

  • 정적 구조 (static schema)
  • workflow에 memory write/read 시점이 미리 정의됨
  • graph DB도 schema 고정 → 새로운 관계 생성 어려움
  • long-term interaction에서 generalization 부족

핵심 문제:

“LLM agent가 경험을 통해 지식 구조 자체를 진화시키지 못한다


2. 핵심 아이디어: Agentic Memory

기존 vs A-MEM

구분기존 MemoryA-MEM
구조staticdynamic
link 생성predefinedLLM이 생성
업데이트없음memory evolution
역할storageself-organizing knowledge system

핵심 컨셉:

memory도 agent처럼 능동적으로 조직되고 진화해야 한다


3. 방법론 (핵심 구조)

A-MEM은 Zettelkasten 방식 + LLM agentization 결합


3.1 Note Construction (memory representation)

각 memory는 단순 텍스트가 아니라 structured note:

mi={ci,ti,Ki,Gi,Xi,ei,Li}m_i = \{c_i, t_i, K_i, G_i, X_i, e_i, L_i\}

  • c_i: 원본 interaction
  • t_i: timestamp
  • K_i: keywords (LLM 생성)
  • G_i: tags (LLM 생성)
  • X_i: contextual description (핵심)
  • e_i: embedding
  • L_i: links

특징:

  • multi-view semantic representation
  • symbolic + embedding hybrid

3.2 Link Generation (핵심 기여 1)

Step 1: similarity retrieval

sn,j=enej|en||ej|s_{n,j} = \frac{e_n \cdot e_j}{|e_n||e_j|}

Top-k memory 선택

Step 2: LLM 기반 관계 생성

LiLLM(mn,Mnear)L_i \leftarrow LLM(m_n, M_{near})

중요 포인트:

  • 단순 cosine similarity가 아니라
  • LLM이 관계 의미를 해석해서 link 생성

즉:

similarity → candidate

LLM → semantic relation 판단


3.3 Memory Evolution (핵심 기여 2)

새로운 memory가 들어오면 기존 memory를 업데이트:

mjLLM(mn,Mnear,mj)m_j^* \leftarrow LLM(m_n, M_{near}, m_j)

업데이트 대상:

  • context description
  • keywords
  • tags

핵심:

memory는 static DB가 아니라 continual learning system


3.4 Retrieval

sq,i=eqei|eq||ei|s_{q,i} = \frac{e_q \cdot e_i}{|e_q||e_i|}

  • query embedding 기반 top-k retrieval
  • 이후 LLM reasoning에 context로 사용

4. 핵심 차별점 (중요)

기존 RAG vs A-MEM

구분Agentic RAGA-MEM
retrievaldynamicdynamic
storagestaticdynamic
knowledge evolution없음있음

논문 핵심 주장:

기존 agentic RAG는 retrieval만 agentic

A-MEM은 memory 자체가 agentic


5. 실험 결과 (핵심 해석)

5.1 성능 (LoCoMo dataset)

  • multi-hop reasoning에서 압도적 향상
  • GPT / Qwen / Llama 모두 일관된 개선

특히:

  • Multi-hop F1:
    • 기존 대비 2배 이상 향상 

이유:

  • memory 간 연결 구조 → reasoning chain 형성

5.2 Efficiency

  • Token usage:
    • 기존: ~16,900 tokens
    • A-MEM: 1,2002,500 tokens 

의미:

compressed but structured memory


5.3 Ablation (중요 insight)

설정성능
w/o LG & ME크게 하락
w/o ME중간
full (A-MEM)최고

해석:

  • Link Generation = 필수
  • Memory Evolution = refinement

5.4 Hyperparameter (k)

  • k ↑ → 성능 증가
  • 하지만:
    • 일정 이상 → plateau or 감소

trade-off:

context richness vs noise


5.5 Memory structure 분석 (t-SNE)

  • A-MEM → clustered structure
  • baseline → dispersed

의미:

memory가 실제로 지식 구조를 형성함


6. 핵심 기여 정리

(1) Agentic Memory 개념 제안

  • memory 자체를 agent화

(2) Link Generation

  • LLM 기반 semantic linking

(3) Memory Evolution

  • 지속적 knowledge refinement

(4) Zettelkasten + LLM 결합

  • atomic note + graph-like structure

7. 한계

논문에서 명시:

  • LLM 품질에 의존
  • link / context 생성 variability
  • multimodal 확장 미지원 

8. 한 줄 요약

A-MEM은 LLM agent의 memory를 단순 저장소가 아니라 LLM이 스스로 조직하고 진화시키는 agentic knowledge graph로 만든 시스템이다.


2. Related Work


2.1 Memory for LLM Agents

(1) 기존 접근 방식 분류

논문은 기존 memory 시스템을 다음과 같이 구조적으로 분류합니다:


(A) Full Interaction Storage / Dense Retrieval

  • 모든 interaction을 저장
  • embedding 기반 retrieval

대표:

  • dense retrieval memory
  • read-write memory 구조

특징:

  • long-term 기록 유지 가능
  • 하지만:
    • 구조 없음
    • 의미적 관계 부족

(B) Cache / Hierarchical Memory (MemGPT 계열)

  • recent memory vs long-term memory 분리
  • OS memory 구조와 유사

대표:

  • MemGPT

특징:

  • context window 문제 해결
  • priority-based memory 관리

한계:

  • 구조적 지식 형성 없음
  • memory 간 관계 없음

(C) Controller-based Memory

  • memory stream + controller

대표:

  • SCM (Self-Controlled Memory)

특징:

  • memory 유지/삭제를 정책적으로 관리

한계:

  • 여전히 predefined rule 기반

(D) Structured Memory / Graph 기반

대표:

  • Mem0 (RAG + graph DB)

특징:

  • 구조적 memory organization
  • node/edge 기반 관계

핵심 한계:

graph schema가 고정됨

→ 새로운 관계 생성 불가

generalization 제한


(2) 공통적인 근본 한계

논문이 강조하는 핵심 문제:

1. Predefined memory operation

  • 언제 write / retrieve 할지 고정

2. Static structure

  • schema 또는 구조가 고정됨

3. Lack of adaptability

  • 새로운 개념 등장 시 구조 확장 어려움

4. Weak long-term generalization

요약:

기존 memory 시스템은

“저장 + 검색”은 가능하지만

지식 구조를 스스로 발전시키지 못함 


(3) 본 논문의 포지셔닝

A-MEM은 위 한계를 다음으로 해결:

  • memory write → LLM이 생성
  • memory link → LLM이 생성
  • memory update → LLM이 수행

즉:

memory 자체를 agent화 (agentic memory)


2.2 Retrieval-Augmented Generation (RAG)


(1) Standard RAG

구조:

  1. document chunking
  2. embedding indexing
  3. query → retrieval
  4. prompt에 삽입

장점:

  • external knowledge 활용
  • hallucination 감소

한계:

  • knowledge base는 정적

(2) Advanced RAG

확장된 기능:

  • pre-retrieval optimization
  • post-retrieval filtering
  • reranking

(3) Agentic RAG

최근 발전 방향:

  • 언제 retrieval할지 결정
  • 무엇을 retrieval할지 결정
  • iterative retrieval
  • self-reflection 기반 검색

핵심:

retrieval process는 agentic


(4) 한계 (논문 핵심 주장)

Agentic RAG조차도:

knowledge base는 여전히 static

  • memory 자체는 변하지 않음
  • 관계 구조 고정

즉:

“retrieval만 똑똑해졌을 뿐

knowledge는 진화하지 않는다”


(5) A-MEM과의 본질적 차이

논문에서 가장 중요한 비교:

구분Agentic RAGA-MEM
retrievaldynamicdynamic
memory structurestaticdynamic
knowledge evolution없음있음

핵심 문장:

A-MEM은 retrieval이 아니라

memory structure 자체에 agency를 부여한다 


3. Related Work 전체 요약

핵심 흐름

기존 Memory → 구조 없음
↓
Graph Memory → 구조 있지만 고정됨
↓
Agentic RAG → retrieval만 agentic
↓
A-MEM → memory 자체가 agentic

3. Methodology: A-MEM

전체 구조 요약

A-MEM은 4단계 pipeline으로 구성됩니다:

Interaction → Note Construction → Link Generation → Memory Evolution → Retrieval

핵심 특징:

  • memory 생성: LLM
  • memory 연결: LLM
  • memory 업데이트: LLM

3.1 Note Construction (Memory Representation)

(1) Memory 정의

각 memory는 다음과 같은 structured note:

mi={ci,ti,Ki,Gi,Xi,ei,Li}m_i = \{c_i, t_i, K_i, G_i, X_i, e_i, L_i\}

구성 요소:

구성의미
c_i원본 interaction
t_itimestamp
K_ikeywords
G_itags
X_icontextual description
e_iembedding
L_ilink set

핵심:

단순 text → multi-view semantic memory


(2) LLM 기반 semantic enrichment

Ki,Gi,XiLLM(ci,ti)K_i, G_i, X_i \leftarrow LLM(c_i, t_i)

  • keywords: 핵심 개념
  • tags: category
  • context: 의미 요약

효과:

  • implicit knowledge 추출
  • human-interpretable + machine-efficient

(3) Embedding 생성

ei=fenc(ci⊕︎Ki⊕︎Gi⊕︎Xi)e_i = f_{enc}(c_i \oplus K_i \oplus G_i \oplus X_i)

특징:

  • multi-field representation embedding
  • retrieval + linking에 사용

3.2 Link Generation (핵심 모듈 ①)

(1) Candidate retrieval

새 memory mnm_n에 대해:

sn,j=enejenejs_{n,j} = \frac{e_n \cdot e_j}{\|e_n\|\|e_j\|}

Top-k 선택:

Mnear={mj|rank(sn,j)k}M_{near} = \{m_j \mid rank(s_{n,j}) \le k\}

역할:

  • scalability 확보
  • search space 축소

(2) LLM 기반 link 생성

LnLLM(mn,Mnear)L_n \leftarrow LLM(m_n, M_{near})

핵심:

  • 단순 similarity linking 아님
  • semantic / causal / conceptual relation 생성

(3) 결과 구조

Ln={mj1,mj2,...,mjk}L_n = \{m_{j_1}, m_{j_2}, …, m_{j_k}\}

특징:

  • memory graph 형성
  • 하나의 memory는 multiple cluster에 속함

핵심 insight

embedding은 “후보 생성”

LLM은 “관계 추론”

hybrid retrieval + reasoning 구조


3.3 Memory Evolution (핵심 모듈 ②)

개념

새 memory가 기존 memory를 update


수식

mjLLM(mn,Mnearmj,mj)m_j^* \leftarrow LLM(m_n, M_{near} \setminus m_j, m_j)


업데이트 대상

  • contextual description X_j
  • keywords K_j
  • tags G_j

의미

기존 memory:

  • static snapshot

A-MEM:

  • dynamic representation

핵심 insight

memory = parameterized knowledge unit

continual refinement


인간 학습과의 대응

인간A-MEM
새로운 경험new memory
기존 지식 수정memory evolution
개념 형성cluster/link

3.4 Memory Retrieval

Query embedding

eq=fenc(q)e_q = f_{enc}(q)


Similarity 계산

sq,i=eqeieqeis_{q,i} = \frac{e_q \cdot e_i}{\|e_q\|\|e_i\|}


Top-k retrieval

Mretrieved={mi|rank(sq,i)k}M_{retrieved} = \{m_i \mid rank(s_{q,i}) \le k\}


활용

  • retrieved memory → prompt augmentation
  • reasoning context 제공

4. 전체 알고리즘 흐름 (중요 요약)

Algorithm (개념적)

Input: interaction c

1. Note Construction
   m_new ← LLM(c)
   e_new ← encoder(m_new)

2. Link Generation
   M_near ← top-k similarity retrieval
   L_new ← LLM(m_new, M_near)

3. Memory Evolution
   for m_j in M_near:
       m_j ← LLM(m_new, m_j)

4. Store memory

5. Retrieval (at query time)
   M_ret ← top-k(q)
   return M_ret

5. 기존 방법과 구조적 차이

(A) Traditional Memory

store → retrieve
(정적)

(B) A-MEM

store → link → evolve → retrieve
(동적 graph)

6. 핵심 기술적 기여 요약

(1) Structured Note Representation

  • multi-view semantic memory

(2) LLM-based Link Generation

  • 의미 기반 관계 형성

(3) Memory Evolution

  • continual knowledge refinement

(4) Hybrid Retrieval

  • embedding + LLM reasoning

7. 중요한 기술적 해석 (연구 관점)

① Graph Learning 관점

A-MEM은 사실상:

Dynamic Knowledge Graph Learning

  • node: memory
  • edge: LLM-generated link
  • update: evolution

② Continual Learning 관점

  • rehearsal 없음
  • parameter update 없음
  • 대신:
    • memory-level update

–> externalized continual learning


8. 한 줄 핵심 요약

A-MEM은 memory를 “저장된 텍스트”가 아니라

LLM이 생성·연결·진화시키는 동적 지식 그래프로 모델링한 방법론이다.


4. 실험 결과 (Empirical Results)


4.1 실험 설정 요약

데이터셋: LoCoMo

  • 평균 9K token, 최대 35 session
  • 총 7,512 QA pairs 

문제 유형

  • Single-hop
  • Multi-hop
  • Temporal reasoning
  • Open-domain
  • Adversarial

특징:

long-term memory + reasoning 능력 동시 평가


평가 지표

  • F1 (정확도)
  • BLEU-1 (생성 품질)
    • ROUGE, METEOR, SBERT (appendix)

비교 방법

방법특징
LoCoMomemory 없음 (전체 context 입력)
ReadAgentchunk + gist
MemoryBankforgetting curve
MemGPThierarchical memory
A-MEMagentic memory

4.2 핵심 결과 (가장 중요)

(1) Multi-hop reasoning에서 압도적 성능

논문 핵심 결과:

  • A-MEM:
    • Multi-hop F1: 대폭 상승
    • 일부 모델에서 2배 이상 개선 

예 (GPT-4o-mini):

  • MemGPT: ~25.5
  • A-MEM: 45.85

해석:

memory 간 연결 구조 → reasoning chain 형성


(2) 모든 모델에서 일관된 개선

모델 종류:

  • GPT 계열
  • Qwen (1.5B / 3B)
  • Llama (1B / 3B)

결과:

  • 거의 모든 설정에서 A-MEM > baseline

의미:

architecture-level improvement (모델 독립적)


(3) Token efficiency (중요 포인트)

  • 기존:
    • ~16,900 tokens
  • A-MEM:
    • ~1,200 ~ 2,500 tokens 

–> 약 10배 이상 감소


핵심 해석

“더 적은 context로 더 좋은 성능”

즉:

  • 단순 compression이 아니라
  • structured memory retrieval 효과

(4) Task별 성능 특징

✔ Multi-hop

  • 가장 큰 개선
  • 이유:
    • memory link → reasoning path

✔ Open-domain

  • 일부 baseline도 강함 (GPT knowledge 영향)

✔ Adversarial

  • A-MEM도 strong
  • noise filtering 효과

✔ Temporal

  • 개선 있지만 상대적으로 작음

4.3 Ablation Study (핵심 구조 검증)

표 (page 7):

설정결과
w/o LG & ME성능 급락
w/o ME중간
A-MEM최고

해석

(1) Link Generation (LG)

  • 가장 중요한 요소
  • 없으면:
    • memory = independent chunks

(2) Memory Evolution (ME)

  • refinement 역할
  • long-term coherence 강화

결론

LG = structure

ME = refinement


4.4 Hyperparameter 분석 (k)

k = retrieval memory 개수

결과

  • k 증가 → 성능 증가
  • 하지만:
    • 일정 이상 → plateau / 감소 

해석

trade-off:

요소효과
k ↑정보 증가
k ↑↑noise 증가

–> optimal k 존재


4.5 Memory 구조 분석 (t-SNE)

page 8 그림:

  • A-MEM: clustered
  • baseline: dispersed

의미

A-MEM:

  • semantic grouping 발생

baseline:

  • isolated memory

핵심 insight

memory가 실제로 지식 구조를 형성


4.6 왜 성능이 좋아졌는가? (핵심 원인 분석)

논문에서 암시하는 causal mechanism:


(1) Memory Linking → Reasoning Graph

m1 — m2 — m3 → chain reasoning

→ multi-hop 성능 상승


(2) Memory Evolution → Knowledge Refinement

old memory + new memory → improved representation

→ consistency 증가


(3) Structured Retrieval → Noise 감소

top-k structured memory

→ token efficiency + accuracy ↑


5. 핵심 결과 요약

정량적 결론

  • Multi-hop: 최대 2배 성능 향상
  • Token: 10배 감소
  • 모든 모델에서 일관된 개선

정성적 결론

A-MEM은 단순 memory 시스템이 아니라

reasoning을 위한 knowledge structure를 만든다


아래는 논문 방식(A-MEM)이 실제 LoCoMo 데이터에 어떻게 적용되는지를

구체적인 end-to-end 예제로 재구성한 것입니다.


1. LoCoMo 데이터 구조 (실제 형태)

✔ Multi-session dialogue

[Session 1]
User: I started learning Python last month.
Agent: That's great! What are you focusing on?

[Session 2]
User: I am working on a web app using Flask.
Agent: Nice, Flask is lightweight.

[Session 3]
User: My app has memory issues due to caching.
Agent: You might want to use LRU cache.

...

✔ 질문 (QA task)

Q: What problem did the user encounter while building the web app?
A: Memory issues due to caching.

특징:

  • 정보가 여러 session에 분산됨
  • 단순 retrieval이 아니라 multi-hop reasoning 필요

2. A-MEM 적용 과정 (step-by-step)


Step 1. Note Construction

각 interaction → memory note 생성

예시

m1:
content: "I started learning Python last month"
keywords: ["Python", "learning"]
tags: ["education"]
context: "User recently started learning Python"
m2:
content: "I am working on a web app using Flask"
keywords: ["Flask", "web app"]
tags: ["project"]
context: "User is developing a Flask web application"
m3:
content: "My app has memory issues due to caching"
keywords: ["memory issue", "cache"]
tags: ["problem"]
context: "User faces caching-related memory problem"

핵심:

raw text → semantic memory unit


Step 2. Link Generation

embedding + LLM 기반 연결


후보 검색 (embedding)

m3 ↔ m2 (web app 관련)
m3 ↔ m1 (Python 관련)

LLM 기반 link 생성

m2 → m3 (project → problem)
m1 → m2 (learning → application)

결과 (memory graph)

m1 (Python learning)
   ↓
m2 (Flask web app)
   ↓
m3 (memory issue)

핵심:

단순 유사도가 아니라

causal / semantic relation graph 생성


Step 3. Memory Evolution

새로운 memory가 기존 memory를 업데이트


예시

m3 추가 후:

m2 (업데이트 전):
"User is developing a Flask web app"

m2 (업데이트 후):
"User is developing a Flask web app and facing performance issues related to caching"

효과:

  • memory 간 정보 통합
  • context richer

Step 4. Query 처리

질문

Q: What problem did the user encounter while building the web app?

Query embedding → retrieval

Top-k memory:

m2 (web app)
m3 (memory issue)

reasoning (LLM)

m2 → web app context
m3 → problem

⇒ answer: memory issue due to caching

3. Multi-hop 예제 (더 중요한 케이스)


Dialogue

Session 1:
User: I bought a car last year.

Session 3:
User: It broke down recently.

Session 5:
User: I had to repair the engine.

Question

Q: What happened to the item the user bought?

A-MEM 처리

Memory graph

m1: bought car
   ↓
m2: car broke down
   ↓
m3: engine repair

reasoning chain

car → broke down → repaired

Answer

It broke down and required engine repair.

4. 기존 방식 vs A-MEM 비교


기존 (RAG / MemGPT)

retrieve:
m1, m2, m3 (flat)

LLM:
context 많지만 관계 없음
→ reasoning 어려움

A-MEM

retrieve:
linked memory graph

LLM:
structured reasoning 가능
→ chain inference 가능

5. 핵심 차이 요약

항목기존A-MEM
memory 구조flatgraph
관계없음LLM 생성
reasoningimplicitexplicit
multi-hop약함강함

6. 핵심 Insight

LoCoMo에서 중요한 것은:

“정보가 아니라 정보 간 관계


A-MEM의 역할

  • memory 저장 X
  • memory 연결 ✔
  • memory 진화 ✔


게시됨

카테고리

작성자

댓글

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다