- 레거시 .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>
2.3 KiB
2.3 KiB
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 참조.
이 워크플로우 고유 설정:
| 노드 | 항목 | 값 |
|---|---|---|
| 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문장 확인, 과잉 제안 없음내가 지금 어디라고?→ 직전 맥락(서울) 유지