Skip to content

feat: 벡터 검색 RPC 래퍼와 자연어 변환기 추가 - #20

Merged
harim789 merged 13 commits into
developfrom
feature/#19-vector-search-and-text-builders
May 28, 2026
Merged

feat: 벡터 검색 RPC 래퍼와 자연어 변환기 추가#20
harim789 merged 13 commits into
developfrom
feature/#19-vector-search-and-text-builders

Conversation

@harim789

Copy link
Copy Markdown
Collaborator

📌 관련 이슈

closes #19


📝 작업 내용

추천 파이프라인 4개 에이전트(discovery, score, alternative, collaborative)가 공통으로 사용할 헬퍼를 일괄 구현. 순수 라이브러리 모듈만 추가하며 에이전트는 후속 PR에서 구현.

추가 모듈

모듈 역할 사용 에이전트
db.vector_search RPC 4종 (match_products, match_alternatives, match_reviews, match_user_contexts) 타입 wrapper discovery, score, alternative
services.feature_text_builder feature_json → 카테고리별 자연어 (base/sun/lip/skincare). null 필드 자동 제외 (재임베딩 스크립트에서 사용)
services.review_chunker 300자 단위 청크 분할, 이모지·URL·반복 자음 제거, 10자 미만 제외 (리뷰 재임베딩에서 사용)
services.unified_text_builder UserProfile + RAG + 쿼리 → 통합 자연어. discovery_agent의 intent_vector 생성에 사용 discovery
services.job_updater recommendation_jobs 상태 (step/progress/status) 비동기 갱신 모든 추천 에이전트

설계 결정

  • vector_search는 TypedDict 반환 타입으로 IDE 자동완성 지원
  • feature_text_builder는 한국어 자연 표현 사용 (예: "coverage": "높음" → "커버력이 높은") → 리뷰 어휘와 정합성 확보
  • unified_text_builder는 LLM/VLM 담당의 ExtractedProduct 그대로 사용. product_name(str), category["main"](dict 접근) 형태
  • job_updater는 None 필드를 갱신하지 않아 부분 업데이트 안전. asyncio.to_thread로 동기 supabase-py 호출을 이벤트 루프 차단 없이 처리

LLM/VLM 담당 영역과의 인터페이스

  • ExtractedProduct는 LLM/VLM이 정의한 형태 그대로 사용 (수정 X)
  • agents/tools.pysearch_rag placeholder는 후속 PR에서 본 PR의 db.vector_search.match_products를 wrap해서 구현 예정

동작 확인 방법

cd AI
python -m pytest tests/test_vector_search.py tests/test_feature_text_builder.py tests/test_review_chunker.py tests/test_unified_text_builder.py tests/test_job_updater.py -v
  • 단위 테스트 32건 PASSED (Supabase 미연결 시 26 PASSED + 6 SKIPPED)

📁 변경 파일

  • AI/db/vector_search.py
  • AI/services/feature_text_builder.py
  • AI/services/review_chunker.py
  • AI/services/unified_text_builder.py
  • AI/services/job_updater.py
  • AI/tests/test_vector_search.py
  • AI/tests/test_feature_text_builder.py
  • AI/tests/test_review_chunker.py
  • AI/tests/test_unified_text_builder.py
  • AI/tests/test_job_updater.py

✅ 체크리스트

  • 테스트 통과 확인
  • 담당 범위 외 파일 수정 없음
  • 코드 주석 확인

@harim789 harim789 self-assigned this May 28, 2026
@harim789 harim789 added the feat 새로운 기능 추가 label May 28, 2026
@harim789 harim789 linked an issue May 28, 2026 that may be closed by this pull request
17 tasks
@harim789 harim789 changed the title Feature/#19 vector search and text builders feat: 벡터 검색 RPC 래퍼와 자연어 변환기 추가 May 28, 2026
@harim789
harim789 merged commit 248974d into develop May 28, 2026
1 check failed
@harim789
harim789 deleted the feature/#19-vector-search-and-text-builders branch May 28, 2026 19:25
@harim789
harim789 removed the request for review from Copilot May 28, 2026 19:46
@harim789 harim789 added the test 테스트 코드 추가 및 수정 label Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 새로운 기능 추가 test 테스트 코드 추가 및 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: 벡터 검색 RPC 래퍼와 자연어 변환기 추가

1 participant