[FEAT]: RAG 기반 채팅 서비스 및 Spring AI 연동 설정#16
Open
dydwls2227 wants to merge 4 commits into
Open
Conversation
- Spring AI 1.0.0 (Vertex AI Gemini + Embedding + Chroma) 의존성 추가 - ChatMessage 엔티티, ChatMessageRepository 구현 - ChatService/ChatServiceImpl (RAG: 벡터 검색 → 컨텍스트 → Gemini 호출) - MockChatService (로컬 테스트용 더미 응답) - ChatController (Swagger 문서화 포함) - application.yml: Vertex AI Gemini/Embedding 설정 - application-local.yml: Chroma 자동설정 exclude, 더미 AI 설정 - ChatServiceImpl/ChatController에 @Profile(!local) 적용
- Spring AI BOM 1.0.0 → 1.1.0 업그레이드 - spring-ai-starter-model-vertex-ai-gemini/embedding 제거 - spring-ai-starter-model-google-genai 추가 (무료 API 키 방식) - application.yml: Vertex AI 설정 → Google GenAI API 키 설정 - application-local.yml: 더미 Vertex AI 값 → 더미 GenAI API 키
twodo0
reviewed
Mar 11, 2026
Contributor
There was a problem hiding this comment.
ChatMessage를 Role로 구분한 건 대화 문맥을 관리하기에 아주 좋은 것 같습니다. 그런데 현재 ASSISTANT 역할일 떄도 memberId가 필수여서 DB에 무조건 넣어야 하는 구조입니다. 이 부분 개선되면 좋을 것 같습니다!
- CurrentMemberProvider를 추가해 SecurityContext의 email로 현재 로그인 회원을 조회 - 프로필 조회/수정 API에서 임시 memberId 하드코딩 제거 - 회원 ID 조회 API는 본인 프로필만 조회 가능하도록 권한 검증 추가 - 채팅 API에서 현재 로그인 사용자 기준으로 메시지를 저장/조회하도록 변경 - 채팅 세션 메시지 조회 및 세션 삭제 API 추가 - ChatMessageResponse DTO와 memberId/sessionId 기반 repository 메서드 추가 - 정책 검색 결과가 없을 때 Gemini 호출 없이 안내 응답 반환 - 시스템 프롬프트를 resources/prompts/system-prompt.st 파일로 분리 - Swagger, H2 Console, 토큰 재발급 경로를 SecurityConfig 허용 목록에 추가 - 중복 SecurityConfig 제거 - 용진 담당 구현 가이드 문서 추가
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.
#️⃣연관된 이슈
📝작업 내용
Spring AI 의존성 추가
Spring AI BOM 1.1.0
비용 절감을 위해 Vertex AI (유료, GCP 서비스 계정) → Google AI Studio (무료, API 키) 방식으로 전환
스크린샷 (선택)
💬리뷰 요구사항(선택)
Chroma DB 연동 및 실제 RAG 테스트는 Data Pipeline 담당자 구현 후 진행해야 합니다.
현재 로컬에서는 MockChatService가 더미 응답 제공하고 있습니다.