[Week2] thread_id에 따른 그래프 상태 유지 및 가설 트래킹 구현#7
Open
latteeea wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
구현 요약
Week1에서 구현한 ReAct graph를 재사용하고, InMemorySaver 기반 checkpointer를 추가해 thread_id 별로 short-term memory 유지되도록 확장함.
기존 week1에서는 invoke()가 완료될 시 대화 상태가 사라졌지만, 이번에는 같은 thread_id로 실행할 경우 이전 messages와 state를 사용할 수 있도록 구성함.
추가한 기능
변경된 Graph 구조
START
-> extract_hypothesis
-> narrative_interrupt
-> agent
-> tools_condition
├ tool call 있음 → tools → agent
└─ tool call 없음 → END
State 구조
messages : 기존 대화 기록을 유지하기 위함
hypotheses : 사용자가 남긴 해석을 저장하기 위함
narrative_intent : interrupt로 사용자가 답변한 narrative 방향
테스트 결과
long polling 관련 사례 찾아줘방금 말한 그 사례는 구조/단순 버그 문제 중에 어디에 속할까?네가 말한 그 관점으로 사례를 다시 정리해줘아까 말한 그 관점으로 다시 정리해줘어떤 사례를 말씀하시는지 구체적으로 알려주시면 더 정확하게 설명해드릴 수 있습니다. 예를 들어, 특정 문제나 상황에 대한 사례를 말씀하시는 건가요?