DOCS/workflow/_archive/slack_basic_dialogue.md
happybell80 45847403fe docs: workflow Phase 1 정리 — 레거시 이동, n8n 제거, IP 하드코딩 제거
- 레거시 .md 2건(slack_basic_dialogue, service_health_check)을 _archive/로 이동
- n8n .json 파일 18건을 _archive/로 이동
- README.md 전면 재작성: n8n 전제 제거, 현행 아키텍처(APScheduler DB + SKILL.md) 반영
- 구 IP(192.168.219.52)를 localhost로 교체 (infrastructure-ssot-principle 준수)

Refs: DOCS#8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-06 07:48:39 +09:00

58 lines
2.3 KiB
Markdown

# 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/빈 감정에서 생략
## n8n import 후 수동 설정 (필수)
공통 credential 설정은 [워크플로우 README](../README.md) 참조.
이 워크플로우 고유 설정:
| 노드 | 항목 | 값 |
|------|------|---|
| Slack Trigger | Trigger On | `message` 또는 `app_mention` |
| Reply to Slack | Channel | `={{ $json.channel }}` |
| Reply to Slack | Other Options → Thread TS | `={{ $json.thread_ts }}` |
## 검증 기준
- `로빙?` → 1문장 인사
- `난 지금 서울이야` → 1문장 확인, 과잉 제안 없음
- `내가 지금 어디라고?` → 직전 맥락(서울) 유지
## 관련 문서
- [응답 품질 워크로그](../../journey/worklog/260319_rb8001_응답품질_톤과장_문맥유실_수정_및_검증완료.md)
- [프롬프트 DB 폐루프 워크로그](../../journey/worklog/260319_프롬프트DB_폐루프_P1_구현_및_검증완료.md)