Repository navigation
feat: Qdrant로 질문에 관련된 테이블 검색 (#204) - #265
Open
seyoung4503 wants to merge 2 commits into
Open
seyoung4503 wants to merge 2 commits into
seyoung4503 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣ Issue Number
관련 이슈 #204 · 스키마 탐색 평가 #263
📝 요약
lang2sql-tools … index-schema를 실행하면 현재 DB의 테이블·컬럼명·타입·설명을 임베딩하고, 조직·연결·임베딩 설정별 Qdrant 별칭을 새 색인으로 교체합니다. 스키마가 비어 있는 경우에도 이전 테이블을 제거합니다.search_schema(query)로 최대 5개의 테이블 후보를 조회합니다. 에이전트는explore_schema(table)로 실제 컬럼을 확인합니다. 검색을 설정하지 않은 환경은 기존 도구와 스키마 프롬프트를 사용합니다.💬 To Reviewers
실패한 색인 갱신이 기존 검색 결과를 덮지 않도록 별도 컬렉션을 완성한 뒤 게시합니다. 별칭 교체 중 연결이 끊기면 활성 색인은 온전히 유지되며, 운영자가 고아 컬렉션을 정리해야 할 수 있습니다. 자격 증명·임베딩 모델·연결 설정을 변경하면 새 범위로 다시 색인해야 합니다.
PR Checklist
system_prompt.py의 광범위 예외 처리(BLE001) 한 곳은 기존 코드와 동일해 검사에서 제외.Spider2 SQLite 10문항 비교
#263에서 고정한 기존 오답 10개에 대해 두 OpenAI 스냅샷을 검색 설정별로 한 번씩 재실행했습니다. 각 실행은 문항당 16회 모델 호출, 동일한 스키마 탐색 지시와 읽기 전용 최종 SQL 검증·수정 기회를 사용했습니다. 활성 조건에서는 테이블 전체 목록을 미리 주입하지 않고 검색 도구와 사용 지시를 제공합니다. 아래 수치는 공식 채점 결과이며, 모델 호출 수에는 로컬 임베딩 요청이 포함되지 않습니다.
10문항 ID는 local019, local026, local034, local073, local098, local133, local170, local273, local301, local310입니다. 검색 활성 조건에서 mini는 local019·310·133을, GPT-4.1은 local310·026·133을 맞혔습니다. 중간 실험에서 전체 목록을 계속 보여주고 도구만 추가하거나 사용 지시도 추가한 경우 두 모델 모두 검색을 호출하지 않았습니다. 최종 설정에서는 두 모델 모두 검색했지만 합산 정답은 6/20으로 같고 모델 호출은 87회에서 134회로 증가했습니다. 모델당 단일 실행이며 같은 표본을 설계 점검에도 사용했습니다.
이 표본에서 upstream 정답 SQL이 있는 local019와 local301은 질문 원문으로 상위 5개를 직접 검색해 사용 테이블을 대조했습니다. 각각 5/7, 1/1을 찾았습니다. local019에서는 Locations와 Promotions가 후보에서 빠졌습니다. 이 결과는 아직 검색 설정을 기본 활성화하거나 전체 벤치마크에서 성능이 개선됐다고 판단할 근거가 되지 않습니다.
구현 원칙 확인