feat: AI 질문 생성을 위한 내부 임베딩 검색 API 추가#37
Closed
pswaao88 wants to merge 3 commits into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
변경 사항
Core 서버에 내부 임베딩 검색 API 추가
POST /api/internal/embeddings/searchX-Internal-API-Key인증 사용AI 서버가 질문 생성 전에 관련 문서 chunk를 검색할 수 있도록 지원
sessionId,documentIds,queryEmbedding,topK,minScore세션 컨텍스트 검증 추가
ANALYZED) 문서만 검색 가능pgvector 기반 cosine similarity 검색 구현
embedding <=> ?::vector사용사용
검색 service/DTO/controller 및 단위 테스트 추가
다른 서버와 맞춰야 할 내용
AI 서버
POST /api/internal/embeddings/search호출 필요query문자열이 아니라 AI 서버에서 생성한queryEmbedding을 전달해야 함
documentIds는 세션 생성/질문 생성 payload의 컨텍스트 문서 ID와맞춰야 함
X-Internal-API-Key헤더 필수results[].chunkText,score,documentId,chunkIndex를 RAG 컨텍스트로 사용
환경/설정
X-Internal-API-Key값 일치 필요vector(1536)과 일치해야 함topK기본값/최대값과 임베딩 차원은 빠른 Sprint 진행을 위해코드 상수로 유지
topK값은 환경변수로 분리 예정