Implement Phase 18: Hybrid Search (BM25 + Vector)

- FastEmbedSparse(Qdrant/bm25) 기반 sparse 임베딩 추가 (fastembed 패키지)
- IngestionService: HYBRID_SEARCH_ENABLED 시 dense + sparse 동시 저장 (RetrievalMode.HYBRID)
  - _ensure_collection_schema(): sparse vector 미설정 컬렉션 자동 삭제·재생성
- RetrieverService: hybrid 스토어 + dense 폴백 구조, Qdrant 내장 RRF로 결과 통합
- container.py: sparse_embeddings Singleton 프로바이더, ingestion/retriever 양쪽 주입
- .env.example: HYBRID_SEARCH_ENABLED, SPARSE_MODEL_ID 항목 추가

활성화: .env에 HYBRID_SEARCH_ENABLED=true 설정 후 기존 문서 재수집 필요

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sal
2026-05-29 17:47:17 +09:00
parent 145b0cc96f
commit 86370f6c1e
7 changed files with 88 additions and 22 deletions
+2
View File
@@ -12,6 +12,8 @@ langchain-qdrant>=0.2.0
sentence-transformers>=3.0.0
qdrant-client>=1.9.0
pdfplumber>=0.11.0
# Phase 18 — Hybrid Search (BM25 sparse vectors)
fastembed>=0.3.0
# Phase 3 — Agent orchestration
langgraph>=1.0.0
# Phase 4 — Web UI