Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions static/05_AI_설계.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,18 @@ openai-text-embedding-3-small-1536-cosine-v1
```

- Context와 Keyword Preset은 같은 Embedding Profile을 사용합니다.
- Spring과 FastAPI에 Profile을 각각 하드코딩하지 않습니다.
- 배포 환경의 단일 설정에서 주입합니다.
- **Profile의 정본은 FastAPI 설정의 기본값입니다**(`ai` 레포 `app/core/config.py`). 배포 환경변수 주입은 실험·롤백을 위한 **덮어쓰기**이며 필수가 아닙니다.
- Spring과 FastAPI가 서로 다른 Profile을 갖는 것은 **런타임 대조**로 막습니다. Spring이 검색 요청에 실어 보낸 `embeddingProfile`이 FastAPI 설정과 다르면 요청을 거부하며, 빈 결과를 돌려주지 않습니다 — 빈 결과는 "일치하는 기록이 없음"으로 보여 설정 오류를 숨깁니다. 처리 상세는 `ai` 레포 `docs/spec/model-profile.md` 3.1.
- Spring이 그 값을 어디서 얻는지는 **검색 연동 시점에 정합니다**(`S15P11A705-135`). 소비자가 없는 상태에서 정하면 붙일 때 다시 뒤집힙니다.

Profile 문자열의 버전 표기는 모델·전처리 구성을 식별하는 값이며 Context와 무관합니다.

> **2026-07-29 개정.** 이 절은 원래 *"Spring과 FastAPI에 Profile을 각각 하드코딩하지 않습니다 / 배포 환경의 단일 설정에서 주입합니다"* 였습니다.
>
> 그 규정은 **주입이 필수**라는 전제 위에 있었고, 그 대가로 **Profile 교체가 git 이력도 리뷰도 남기지 않았습니다.** Profile 변경은 기존 Embedding을 전부 조회 대상에서 빼는 결정인데(9.3 검색 필터의 `embedding_profile` 일치 조건), 그것이 배포 콘솔 편집 한 번으로 가능했습니다. 값 자체는 이 문서 7.1 표에 공개돼 있어 숨겨진 적도 없습니다.
>
> 정본을 코드로 옮기면 교체가 PR·리뷰·이력을 거칩니다. 원 규정이 막으려던 *"두 파트가 서로 다른 Profile을 갖는 것"*은 위 셋째 불릿의 런타임 대조가 그대로 막습니다. 근거는 `ai` 레포 `docs/proposals/P45-public-config-in-code.md`.

### 7.2 Embedding 저장

Embedding은 `ai.context_embedding`에 Context 단위로 저장하며, 생성 시점의 `embedding_profile`을 함께 기록합니다. `context_id`가 Primary Key입니다.
Expand Down