docs: LangGraph 적용 방안 추가 - StateGraph 노드 구성 및 체크포인터 설정
This commit is contained in:
parent
c3f6b7399b
commit
11ab3bdb07
@ -35,6 +35,27 @@ tags: [naverworks, briefing, timezone, langgraph]
|
||||
- 위치: rb8001 컨테이너 내부
|
||||
- DB 연결: PostgreSQL (DATABASE_URL 환경변수)
|
||||
|
||||
## LangGraph 적용 방안
|
||||
|
||||
### 구현 계획
|
||||
1. **StateGraph 구조**
|
||||
- 노드: get_uuid → fetch_emails → filter_important → generate_summary → format_message → send_slack
|
||||
- 상태 키: user_uuid, emails, important_emails, summary, slack_message
|
||||
- 체크포인터: SqliteSaver('/mnt/hdd/logs/langgraph.db')
|
||||
|
||||
2. **필요 패키지**
|
||||
- rb8001/requirements.txt에 추가: `langgraph`, `langgraph-checkpoint-sqlite`
|
||||
|
||||
3. **주요 개선점**
|
||||
- skill-email API 타임아웃 시 fetch_emails 노드만 재실행
|
||||
- Slack 전송 실패 시 send_slack 노드만 재시도
|
||||
- thread_id='naverworks_daily_YYYYMMDD'로 일별 추적
|
||||
|
||||
4. **파일 구조 변경**
|
||||
- 기존 process_briefing 메서드를 StateGraph.compile()로 교체
|
||||
- 각 단계를 개별 노드 함수로 분리
|
||||
- graph.invoke({"email": "info@company-x.partners"}, config={"configurable": {"thread_id": thread_id}})
|
||||
|
||||
## 교훈
|
||||
- 타임존 명시: naive datetime 대신 KST 명시적 사용
|
||||
- 요일별 조회 기간: 월요일은 주말 포함 72시간 필요
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user