From 11ab3bdb07c30ce335421a181a14eb949e35ef9a Mon Sep 17 00:00:00 2001 From: happybell80 Date: Mon, 29 Sep 2025 10:31:01 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20LangGraph=20=EC=A0=81=EC=9A=A9=20?= =?UTF-8?q?=EB=B0=A9=EC=95=88=20=EC=B6=94=EA=B0=80=20-=20StateGraph=20?= =?UTF-8?q?=EB=85=B8=EB=93=9C=20=EA=B5=AC=EC=84=B1=20=EB=B0=8F=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=ED=8F=AC=EC=9D=B8=ED=84=B0=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ell80_naverworks_briefing_weekend_email.md | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/troubleshooting/250929_happybell80_naverworks_briefing_weekend_email.md b/troubleshooting/250929_happybell80_naverworks_briefing_weekend_email.md index eb65d60..320566c 100644 --- a/troubleshooting/250929_happybell80_naverworks_briefing_weekend_email.md +++ b/troubleshooting/250929_happybell80_naverworks_briefing_weekend_email.md @@ -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시간 필요