Inflearn brand logo image

Inflearn Community Q&A

joung65170555's profile image
joung65170555

asked

Silicon Valley Engineer's Guide to LangChain, LangGraph, and MCP

Learn about ConversationBufferWindowMemory, Entity, ConversationSummaryMemory and ConversationSummaryBufferMemory

summary buffer memory token_limit 질문

Resolved

Written on

·

255

·

Edited

1

token_limit 은 대화의 input, output set 개수 일까요 ?

NLPopenai프롬프트엔지니어링llmlangchain

Answer 2

0

joung65170555님의 프로필 이미지
joung65170555
Questioner

아하 감사합니다 그렇다면

summary : <기억1에대한내용> <기억2에대한 내용> 이런 식 이던데, 이 summary가 buffer에 있으니 이 summary에 대한 토큰 제한이군요 ? 이를 넘으면 기억1 쪽 내용부터 삭제 혹은 정리 될까요 ?

altoformula님의 프로필 이미지
altoformula
Instructor

네 그렇습니다. 기존 답변에 나와있다시피, 앞에서부터 버퍼를 정리합니다 ㅎㅎ

0

altoformula님의 프로필 이미지
altoformula
Instructor

안녕하세요 정채진님,

아마 max_token_limit의 token_limit을 말씀하시는 것 같은데, 간략히 token limit은 대화 버퍼에 저장된 토큰에 대한 제한입니다.

ConversationTokenBufferMemory 클래스의 max_token_limit 매개변수는 대화 버퍼에 저장된 토큰의 수를 제한하는 데 사용됩니다. save_context 메서드가 호출되면 현재 버퍼 길이(토큰 단위)가 max_token_limit을 초과하는지 확인합니다. 그렇다면 버퍼의 길이가 max_token_limit보다 작거나 같아질 때까지 처음부터 메시지를 제거하여 버퍼를 정리합니다.

그러나 이 정리 과정은 모델이 max_token_limit보다 오래된 정보를 기억하지 않을 것을 보장하지 않는다는 점이 중요합니다. 모델의 기억 능력은 내부 메커니즘에 따라 결정되며 max_token_limit 매개변수로 직접 제어되지 않습니다.

joung65170555's profile image
joung65170555

asked

Ask a question