From 8cdec568d75b4b8bf2205af673c4ccfa0183007c Mon Sep 17 00:00:00 2001 From: happybell80 Date: Thu, 19 Mar 2026 22:43:24 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20slack=5Fbasic=5Fdialogue=20=EC=9B=8C?= =?UTF-8?q?=ED=81=AC=ED=94=8C=EB=A1=9C=EC=9A=B0=20=EB=B3=80=EA=B2=BD=20?= =?UTF-8?q?=EA=B8=B0=EB=A1=9D=20=E2=80=94=20JSON=20notes=20+=20MD=20?= =?UTF-8?q?=EB=B3=B4=EC=A1=B0=20=EB=AC=B8=EC=84=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rb8001 내부 대화 응답 경로 변경 반영: 프롬프트 DB 조회, 대화 이력 전달, neutral 감정 생략. JSON을 먼저 수정하고 MD 설명 문서를 함께 갱신 (artifacts SSOT 원칙). Co-Authored-By: Claude Opus 4.6 (1M context) --- .../01_conversation/slack_basic_dialogue.json | 3 ++ .../01_conversation/slack_basic_dialogue.md | 45 +++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 workflow/01_conversation/slack_basic_dialogue.md diff --git a/workflow/01_conversation/slack_basic_dialogue.json b/workflow/01_conversation/slack_basic_dialogue.json index 3e54dd7..be925f7 100644 --- a/workflow/01_conversation/slack_basic_dialogue.json +++ b/workflow/01_conversation/slack_basic_dialogue.json @@ -160,6 +160,9 @@ } }, "pinData": {}, + "settings": { + "notes": "260319: rb8001 내부 대화 응답 경로 변경. (1) 시스템 프롬프트를 DB에서 동적 조회 (프롬프트 DB 폐루프). (2) recent_conversations → previous_messages 변환으로 직전 대화 맥락 전달. (3) neutral 감정에서 constraints 생략. n8n 노드 흐름 변경 없음." + }, "meta": { "templateCredsSetupCompleted": true, "instanceId": "robeing-conversation" diff --git a/workflow/01_conversation/slack_basic_dialogue.md b/workflow/01_conversation/slack_basic_dialogue.md new file mode 100644 index 0000000..3b072cd --- /dev/null +++ b/workflow/01_conversation/slack_basic_dialogue.md @@ -0,0 +1,45 @@ +# slack_basic_dialogue 워크플로우 + +## 목적 +Slack 멘션으로 들어온 사용자 질문을 rb8001(로빙)이 처리하고 Slack 스레드에 응답하는 기본 대화 흐름. + +## 흐름 +``` +Slack Trigger → Normalize Event → Should Process? → Get User Mapping → Build Gateway Request → Call Robeing Gateway → Prepare Slack Reply → Reply to Slack +``` + +## rb8001 내부 데이터 흐름 (260319 변경) + +``` +Gateway 호출 + → message_router.get_user_context() + → recent_conversations 로드 (DB, 최근 24h) + → message_service.route_message() + → decision_engine.create_execution_plan() + → llm_service.process_request() + → 프롬프트 DB 조회 (캐시 TTL 60초) + → DB 활성 프롬프트가 있으면 system prompt로 주입 + → recent_conversations → previous_messages 변환 (최근 5건) + → neutral 감정이면 감정 constraints 생략 + → OpenAI/Gemini handler 호출 + → 응답 반환 +``` + +### 변경 전 (~ 260318) +- 시스템 프롬프트: 코드 하드코딩 고정 +- 대화 이력: OpenAI 경로에서 미전달 (문맥 유실) +- 감정 constraints: 모든 감정에서 무조건 주입 + +### 변경 후 (260319 ~) +- 시스템 프롬프트: DB `prompt_versions` 테이블에서 활성 버전 조회 (코드 배포 없이 교체 가능) +- 대화 이력: `recent_conversations` → `previous_messages` 변환으로 OpenAI handler에 전달 +- 감정 constraints: neutral/빈 감정에서 생략 + +## 검증 기준 +- `로빙?` → 1문장 인사 +- `난 지금 서울이야` → 1문장 확인, 과잉 제안 없음 +- `내가 지금 어디라고?` → 직전 맥락(서울) 유지 + +## 관련 문서 +- [응답 품질 워크로그](../../journey/worklog/260319_rb8001_응답품질_톤과장_문맥유실_수정_및_검증완료.md) +- [프롬프트 DB 폐루프 워크로그](../../journey/worklog/260319_프롬프트DB_폐루프_P1_구현_및_검증완료.md)