docs: IntentAnalyzer 통합 방안 업데이트

- router.route_message() 레벨 통합 방안 추가
- DecisionEngine과 중복 기능 언급
- 영향 범위 확대 (모든 인터페이스)
This commit is contained in:
happybell80 2025-09-14 14:57:12 +09:00
parent 322dc1aecd
commit 957b03102d

View File

@ -16,6 +16,7 @@
- "검색해줘" → "/search" 변환 기능 구현됨
- 어디서도 import/호출하지 않음
- slack_handler.py:81에서 router.route_message() 직접 호출
- DecisionEngine(정규식 기반)만 사용 중, IntentAnalyzer(LLM 기반) 미사용
```
### 2. Slack 이벤트 처리 로직
@ -31,23 +32,23 @@ if event_type == "app_mention" or (event_type == "message" and is_dm):
## 해결 방법
### 1. IntentAnalyzer 연결
### 1. IntentAnalyzer 연결 (두 가지 방안)
#### 방안 A: slack_handler.py 수정 (문제: handler 객체 없음)
```python
# slack_handler.py 수정
from app.llm.intent_analyzer import IntentAnalyzer
# slack_handler.py Line 78-81 사이
# 문제: handler 객체 접근 불가로 구현 어려움
```
async def process_slack_message_async(text: str, user_id: str, context: dict):
# ... 기존 코드 ...
# Line 78-81 사이에 추가
#### 방안 B: router.route_message() 수정 (권장)
```python
# router.py의 route_message() 시작부
async def route_message(self, text: str, user_id: str, ...):
# IntentAnalyzer로 전처리
analyzer = IntentAnalyzer()
analyzed = await analyzer.analyze_user_intent(text, handler)
if analyzed != text:
logger.info(f"Intent converted: '{text}' → '{analyzed}'")
text = analyzed
text = await analyzer.analyze_user_intent(text, self.llm_handler)
# 기존 router 호출
result = await router.route_message(text, user_id, channel, thread_ts)
# 기존 처리 로직 계속...
```
### 2. 채널 메시지 키워드 감지
@ -72,6 +73,6 @@ response_text = response_text.replace("**", "*") # Slack 포맷 변환
3. **플랫폼별 포맷**: Slack mrkdwn ≠ Markdown
## 영향 범위
- 모든 Slack 사용자의 검색 기능 UX 개선
- 자연어 명령 지원으로 사용성 향상
- 포맷 깨짐 문제 해결로 가독성 개선
- router 레벨 통합 시 Slack뿐 아니라 모든 인터페이스(frontend 등)에 자연어 지원
- DecisionEngine과 IntentAnalyzer 중복 기능 정리 필요
- 포맷 깨짐 문제 해결로 가독성 개선