과거 경험의 검색을 통한 자기 개선 LLM 에이전트 프레임워크
A Framework for Self-Improving LLM Agents via Retrieval of Past Experiences
- 주제(키워드) 에이전트 , 인공지능
- 발행기관 서강대학교 AI.SW대학원
- 지도교수 양지훈
- 발행년도 2026
- 학위수여년월 2026. 2
- 학위명 석사
- 학과 및 전공 AI.SW대학원 데이터사이언스 · 인공지능
- 실제URI http://www.dcollection.net/handler/sogang/000000082538
- UCI I804:11029-000000082538
- 본문언어 한국어
- 저작권 논문은 저작권에 의해 보호받습니다.
초록(요약문)
최근 대규모 언어 모델(Large Language Model, LLM)은 단순한 자연어 처리를 넘어, 외부 도구(Tool) 사용 및 추론 능력을 바탕으로 복잡한 과업을 수행하는 자율 에이전트(Autonomous Agent)로 진화하고 있다[1, 2]. 그러나 LLM 고유의 확률론적 토큰 생성 방식은 정해진 절차와 정확한 API 인자(Argument)를 요구하는 결정론적(Deterministic) 태스크 수행 시 환각(Hallucination)이나 논리적 오류를 유발하는 주요 원인이 된다[3]. 기존의 대표적 에이전트 프레임워크인 ReAct(Reason+Act)는 동적 대응력은 우수하나 과도한 탐색으로 인한 비효율성 문제가 존재하며[4], Plan-then- Execute 방식은 초기 계획 수립 후 상황 변화에 유연하게 대처하지 못해 조기 실패(Early Failure)하는 한계를 보인다[5]. 이러한 문제를 해결하기 위해, 본 연구는 에이전트가 수행 과정에서 축적한 경험(Experience)을 장기 기억(Long-term Memory)으로 저장하고, 이를 새로운 문제 해결에 능동적으로 활용하는 자기 개선(Self-Improving) 프레임워크 'Learning from Success (LfS)'를 제안한다. 제안하는 프레임워크는 에이전트의 학습 효율성과 실행 안정성을 극대화하기 위해 다음과 같은 세 가지 핵심 메커니즘을 통합하였다. 첫째, 성공 및 실패 경험의 이중 검색(Dual Retrieval) 전략이다. 기존 연구들이 주로 성공 사례의 모방(Mimicry)을 통한 자기 성찰(Self- Reflection)에 집중한 것과 달리[6], 본 연구는 현재의 쿼리와 유사한 과거의 성공 궤적(Successful Trajectory)뿐만 아니라 실패 사례(Failed Trajectory)를 동시에 검색하여 프롬프트에 주입한다. 이를 통해 에이전트는 과거의 성공 패턴을 학습함과 동시에, 오류를 유발했던 접근 방식을 사전에 인지하고 회피(Avoidance)하는 방어적 추론을 수행한다. 둘째, 적응형 임계값(Adaptive Threshold) 기반의 메모리 축적 기법이다. 에이전트의 학습 세대(Generation)가 진행됨에 따라 경험을 저장하는 평가 점수 기준을 점진적으로 상향 조정한다. 이는 학습 초기에는 다양한 시도(Exploration)를 허용하되, 후반부로 갈수록 고품질의 데이터만을 선별적으로 축적(Exploitation)하여 벡터 데이터베이스의 품질을 스스로 정제하는 효과를 갖는다. 셋째, 동적 검색 범위 설정(Dynamic K) 알고리즘이다. 긴 문맥이 모델의 성능을 저하시킬 수 있는 'Lost in the Middle' 현상을 방지하기 위해[7], 검색된 문서 간의 유사도 점수 격차(Gap)를 분석하여 문맥적 연관성이 높은 최적의 예시 개수(k)를 동적으로 결정한다. 이는 프롬프트 내 불필요한 정보(Noise)를 제거하여 LLM의 추론 집중도를 높인다. 제안 방법론의 검증을 위해 실제 서비스 환경을 모사한 가상 샌드박스 MCPEval[8]을 활용하여 8 개 도메인에 걸친 복합 태스크 데이터셋을 생성하고 실험을 수행하였다. 실험 결과, 제안 모델은 Baseline 대비 엄격한 성공률(Strict Success Rate)에서 유의미한 성능 향상을 보였으며, 특히 복잡한 도구 의존성을 가진 태스크에서 계획 수립과 실행의 정확도가 동시에 개선됨을 확인하였다. 본 연구는 별도의 파인 튜닝(Fine-tuning) 없이 경험의 축적과 검색만으로 에이전트를 지속적으로 발전시킬 수 있는 실용적인 방법론을 제시했다는 점에서 의의를 갖는다.
more초록(요약문)
With the rapid advancement of Large Language Models (LLMs), research on autonomous agents capable of utilizing external tools to solve complex tasks has gained significant traction[1, 2]. However, the inherent probabilistic nature of LLMs often leads to hallucinations or logical errors when performing deterministic tasks that require precise procedures and accurate API arguments[3]. Existing frameworks such as ReAct (Reason+Act) offer flexibility but suffer from inefficiency due to excessive exploration[4], while Plan-then-Execute approaches are prone to early failure due to their inability to adapt to dynamic changes after initial planning[5]. To address these limitations, this study proposes 'Learning from Success (LfS)', a self-improving framework where agents accumulate experiences in long-term memory and actively retrieve them for solving new problems. The proposed framework integrates three key mechanisms to maximize learning efficiency and execution stability. First, a Dual Retrieval Strategy of Successful and Failed Experiences is introduced. Unlike existing studies that focus primarily on mimicking successful cases[6], this framework retrieves both successful and failed trajectories similar to the current query. This allows the agent to learn successful patterns while simultaneously recognizing and avoiding approaches that previously led to errors. Second, an Adaptive Threshold-based Memory Accumulation Technique is employed. As the agent's learning generation progresses, the evaluation score threshold for storing experiences is gradually increased. This encourages exploration in the early stages while selectively accumulating only high-quality data in later stages, thereby self- refining the quality of the vector database. Third, a Dynamic K Algorithm is implemented to determine the optimal number of retrieved examples. To prevent performance degradation caused by excessively long contexts[7], the algorithm analyzes the gap in similarity scores between retrieved documents and dynamically selects the optimal number of examples (k). This removes noise from the prompt and enhances the LLM's reasoning focus. For validation, we constructed a synthetic dataset of complex tasks across 8 domains using the MCPEval[8] virtual sandbox environment. Experimental results demonstrate that the proposed model significantly improves Strict Success Rate compared to baselines, particularly in tasks with complex tool dependencies. This study contributes a practical methodology for continuously evolving agents through experience accumulation and retrieval without the need for extensive fine-tuning. Keywords: Large Language Model, Autonomous Agent, Retrieval- Augmented Generation (RAG), Self-Improvement, Adaptive Threshold, Failure Avoidance
more목차
제 1 장 서론 10
제 1 절 연구 배경 및 필요성 10
제 2 절 문제 정의: LLM 에이전트의 다단계 추론 한계 11
제 3 절 연구 목적 및 기여점 12
제 2 장 관련 연구 14
제 1 절 LLM 기반 에이전트 프레임워크 14
제 2 절 검색 증강 생성(RAG)과 에이전트 메모리 15
제 3 절 자기 성찰 및 실패로부터의 학습 16
제 3 장 연구 방법론 18
제 1 절 실행 단계 강화 아키텍처: PLAN-ARG RAG 18
제 2 절 계획 및 실행 이중 강화 아키텍처: PLAN-EXP & ARG-EXP RAG 19
제 3 절 핵심 알고리즘 상세 20
제 4 장 실험 환경 및 데이터셋 22
제 1 절 MCPEVAL 기반 가상 샌드박스 환경 22
제 2 절 합성 데이터셋(SYNTHETIC DATASET) 생성 및 검증 23
제 3 절 평가 지표 (EVALUATION METRICS) 24
제 5 장 실험 결과 및 분석 29
제 1 절 정량적 성능 평가 (QUANTITATIVE ANALYSIS) 29
제 2 절 정성적 품질 평가 (QUALITATIVE ANALYSIS) 31
제 3 절 실패 분석 및 사례 연구 33
제 6 장 결 론 35
제 1 절 연구 요약 35
제 2 절 연구의 시사점 36
제 3 절 연구의 한계 및 향후 과제 36
참고문헌 (REFERENCES) 38
부 록 (APPENDIX) 40
[부록 A] MCPEVAL 가상 환경 도구 명세 40
[부록 B] 데이터셋 시나리오 예시 (JSON) 42
[부록 C] RAG 프롬프트 템플릿 44

