Update: 검색 API 문서에 intent_analyzer 현황 반영

- intent_analyzer.py는 LLM 기반 명령어 변환, 현재 미사용
- 실용적인 패턴 매칭 방식으로 검색 라우팅 제안
- 문서 간소화 (84줄 → 80줄)
This commit is contained in:
happybell80 2025-09-10 00:42:47 +09:00
parent f635b7e5a4
commit a15415b623

View File

@ -19,21 +19,17 @@
- **Exa API**: 심층 분석용 (유료)
- **SearxNG**: 자체 호스팅 폴백
## 2. 쿼리 라우팅 규칙
## 2. 의도 분석 현황 & 라우팅
현재 intent_analyzer.py는 LLM으로 명령어 변환(/news, /digest)만 수행, 미사용 상태.
검색 의도 추가: LLM 프롬프트에 "검색 요청은 /search로" 또는 직접 패턴 매칭.
```python
class QueryRouter:
def route(self, query, query_type):
if query_type == 'fact':
return 'duckduckgo' # 즉답형
elif query_type == 'general':
return 'tavily' # 기본
elif query_type == 'navigational':
return 'serper' # Google SERP
elif query_type == 'deep_research':
return 'exa' # 심층 분석
else:
return 'brave' # 다양성 보완
# rb8001/app/services/search_service.py
def route_by_pattern(query):
if "뉴스" in query: return 'news_api'
if "언제" in query: return 'duckduckgo' # 즉답
return 'tavily' # 기본 검색
```
## 3. 구현 아키텍처