From d526b48d23f0eaebddba51cd22e584afa2a47faa Mon Sep 17 00:00:00 2001 From: happybell80 Date: Sat, 21 Mar 2026 16:07:28 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=ED=92=88=EC=A7=88=EA=B0=9C=EC=84=A0=20?= =?UTF-8?q?=EA=B3=84=ED=9A=8D=20=EB=B3=B4=EC=99=84=20=E2=80=94=20P0-3=20?= =?UTF-8?q?=EC=98=B5=EC=85=98=20=ED=99=95=EC=A0=95,=20P1-4=20=EC=8B=A4?= =?UTF-8?q?=ED=8C=A8=20=EB=8C=80=EC=95=88,=20P1-5=20fallback=20=ED=99=95?= =?UTF-8?q?=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- ...321_하이브리드검색_품질개선_계획.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/journey/plans/260321_하이브리드검색_품질개선_계획.md b/journey/plans/260321_하이브리드검색_품질개선_계획.md index f575b72..c76eaf2 100644 --- a/journey/plans/260321_하이브리드검색_품질개선_계획.md +++ b/journey/plans/260321_하이브리드검색_품질개선_계획.md @@ -39,22 +39,25 @@ ### P0-3: RRF 점수 정규화 (skill-rag-file) - 파일: `app/services/postgres_vector_store.py` → `_merge_rrf()` -- 옵션 A: RRF 점수를 0~1로 정규화 — `rrf_normalized = rrf_raw / max_rrf_raw` -- 옵션 B: hybrid 모드에서 relevance_score를 `max(vector_score, rrf_score)`로 설정 -- 옵션 C: hybrid용 threshold를 별도 파라미터로 분리 (기본 0.005) -- 권장: **옵션 A** — 정렬과 필터링이 일관됨 +- **채택: 옵션 A** — RRF 점수를 0~1로 정규화: `rrf_normalized = rrf_raw / max_rrf_raw` +- 정렬과 필터링이 일관되고, threshold 0.35와 스케일이 맞음 +- `relevance_score`에 정규화 값을 넣으므로 grounding_service의 정렬도 정상 동작 ### P1-4: 초과 청크 재분할 (23 DB + 24 skill-rag-file) +- 현황: 3,204 청크 중 694건(22%)이 1,200자 초과 - 탐지: `SELECT document_id, chunk_index, length(chunk_text) FROM team_document_chunk WHERE length(chunk_text) > 1200 AND team_id = '79441171-...'` - 해당 문서를 chunk_size=1000, overlap=200 기준으로 재인덱싱 - 스크립트: `skill-rag-file/scripts/reindex_oversized_chunks.py` +- **검증**: 재분할 후 옐로펀치 MOU(doc_id `b7116f6a`)가 "옐로펀치 컴퍼니엑스 협약" 쿼리로 top-5 진입하는지 실측 +- **실패 시 대안**: 재분할로도 top-5 미진입이면 keyword prefix 매칭(P0-1)이 보완하므로 벡터 단독 해결에 집착하지 않음. keyword가 해당 문서를 잡으면 RRF 합산으로 순위 상승 ### P1-5: grounding 라우팅 완화 (rb8001) - 파일: `app/services/companyx_grounding_service.py` → `should_handle_companyx_grounding()` - 변경: `team_id == COMPANYX_TEAM_ID`이면 `_looks_like_companyx_grounding_question()` 체크를 건너뛰고 항상 grounding 시도 -- 주의: grounding 실패 시 일반 경로로 fallback하는 기존 흐름 유지 필요 +- **fallback 확인**: 현재 `try_companyx_grounding()`이 `None`을 반환하면 `message_service.py`가 일반 의도 분류로 진행 (라인 81-93). 이 흐름은 변경하지 않음 +- 따라서 grounding 검색 결과 0건이면 기존처럼 일반 챗봇 경로로 자연 fallback ## 실행 순서