Skip to content

[Week2] thread_id에 따른 그래프 상태 유지 및 가설 트래킹 구현#7

Open
latteeea wants to merge 4 commits into
mainfrom
latteeea/week2-state-memory
Open

[Week2] thread_id에 따른 그래프 상태 유지 및 가설 트래킹 구현#7
latteeea wants to merge 4 commits into
mainfrom
latteeea/week2-state-memory

Conversation

@latteeea
Copy link
Copy Markdown
Collaborator

구현 요약

  • Week1에서 구현한 ReAct graph를 재사용하고, InMemorySaver 기반 checkpointer를 추가해 thread_id 별로 short-term memory 유지되도록 확장함.

  • 기존 week1에서는 invoke()가 완료될 시 대화 상태가 사라졌지만, 이번에는 같은 thread_id로 실행할 경우 이전 messages와 state를 사용할 수 있도록 구성함.

추가한 기능

  • InMemorySaver 기반 checkpointer 적용
  • thread_id 기반 대화 상태 분리
  • hypotheses state 추가 (트러블슈팅의 과정 state)
  • 사용자의 해석을 저장하는 hypothesis tracking node 추가
  • interrupt / resume 기반 실행 제어 추가

변경된 Graph 구조

START
-> extract_hypothesis
-> narrative_interrupt
-> agent
-> tools_condition
├ tool call 있음 → tools → agent
└─ tool call 없음 → END

State 구조

messages : 기존 대화 기록을 유지하기 위함
hypotheses : 사용자가 남긴 해석을 저장하기 위함
narrative_intent : interrupt로 사용자가 답변한 narrative 방향

테스트 결과

구분 목적 질문 답변
테스트 1 기본 thread memory 동작 확인 long polling 관련 사례 찾아줘 long polling + DB connection pool exhaustion 사례를 검색하고 troubleshooting narrative 생성
테스트 2 같은 thread에서 이전 맥락 유지 확인 방금 말한 그 사례는 구조/단순 버그 문제 중에 어디에 속할까? 이전 long polling 사례를 기억한 상태로 “구조적 문제”라고 분류
테스트 3 hypothesis tracking 기반 follow-up 확인 네가 말한 그 관점으로 사례를 다시 정리해줘 이전에 저장된 “구조 문제” 관점을 기반으로 사례를 구조적 설계 문제 중심 narrative로 재구성
테스트 4 (다른 thread_id) thread_id 분리 확인 아까 말한 그 관점으로 다시 정리해줘 어떤 사례를 말씀하시는지 구체적으로 알려주시면 더 정확하게 설명해드릴 수 있습니다. 예를 들어, 특정 문제나 상황에 대한 사례를 말씀하시는 건가요?

@latteeea latteeea self-assigned this May 18, 2026
@myeolinmalchi myeolinmalchi self-requested a review May 18, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant