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)