Skip to content
Closed
Show file tree
Hide file tree
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
53 changes: 53 additions & 0 deletions ADR-vision-embedding-rollout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# ADR: Vision Embedding Rollout (Flag-Gated)

- Status: Accepted
- Date: 2026-02-16

## Context

STACKIT published a vision-capable embedder. We want to integrate image-native retrieval into the existing RAG pipeline without destabilizing production traffic.

The current platform already supports `IMAGE` as a content type, but image ingestion/retrieval behavior is not yet consistently routed through a dedicated vision lane end-to-end.

## Decision

Roll out vision support behind explicit feature flags that default to `false`:

- `VISION_IMAGE_LANE_ENABLED=false`
- `VISION_EMBEDDING_ENABLED=false`
- `VISION_IMAGE_RETRIEVER_ENABLED=false`

Flags are exposed via Helm values and a shared config map consumed by backend, admin-backend, and extractor.

## Consequences

### Positive

- No behavior change on merge while flags stay off.
- Safe staged rollout with reversible steps.
- Easier incident response by disabling a specific lane.

### Negative

- Temporary configuration overhead while both legacy and vision paths exist.
- Additional test matrix during rollout.

## Rollout Notes

- Keep all three flags `false` until the final rollout PR is merged and staging is validated.
- Enable in sequence on staging:
1. `VISION_IMAGE_LANE_ENABLED`
2. `VISION_EMBEDDING_ENABLED`
3. `VISION_IMAGE_RETRIEVER_ENABLED`
- Promote to production only after mixed-modality retrieval checks pass.

## Telemetry Baseline (No Behavior Change in This ADR)

Track these counters from the first behavior PR onward:

- `vision.image_documents_ingested_total`
- `vision.image_embeddings_written_total`
- `vision.image_retrieval_hits_total`
- `vision.image_retrieval_errors_total`

This ADR only defines the rollout contract; metric instrumentation is introduced in later PRs.
4 changes: 4 additions & 0 deletions infrastructure/rag/templates/_backend_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ basic-auth
{{- printf "%s-retriever-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "configmap.visionName" -}}
{{- printf "%s-vision-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "configmap.langfuseName" -}}
{{- printf "%s-langfuse-configmap" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/rag/templates/admin-backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ spec:
name: {{ template "configmap.keyValueStoreName" . }}
- configMapRef:
name: {{ template "configmap.sourceUploaderName" . }}
- configMapRef:
name: {{ template "configmap.visionName" . }}
- configMapRef:
name: {{ template "configmap.retryDecoratorName" . }}
- configMapRef:
Expand Down
9 changes: 9 additions & 0 deletions infrastructure/rag/templates/backend/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ data:
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "configmap.visionName" . }}
data:
{{- range $key, $value := .Values.shared.envs.vision }}
{{ $key }}: {{ $value | quote }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "configmap.langfuseName" . }}
data:
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/rag/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ spec:
name: {{ template "configmap.embedderClassTypesName" . }}
- configMapRef:
name: {{ template "configmap.retrieverName" . }}
- configMapRef:
name: {{ template "configmap.visionName" . }}
- configMapRef:
name: {{ template "configmap.rerankerName" . }}
- configMapRef:
Expand Down
2 changes: 2 additions & 0 deletions infrastructure/rag/templates/extractor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ spec:
name: {{ template "configmap.s3Name" . }}
- configMapRef:
name: {{ template "configmap.extractorSitemapName" . }}
- configMapRef:
name: {{ template "configmap.visionName" . }}
- secretRef:
name: {{ template "secret.s3RefName" . }}
{{- $hfCacheDir := include "extractor.huggingfaceCacheDir" . }}
Expand Down
4 changes: 4 additions & 0 deletions infrastructure/rag/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ shared:
s3:
S3_ENDPOINT: http://rag-minio:9000
S3_BUCKET: documents
vision:
VISION_IMAGE_LANE_ENABLED: false
VISION_EMBEDDING_ENABLED: false
VISION_IMAGE_RETRIEVER_ENABLED: false
retryDecorator:
RETRY_DECORATOR_MAX_RETRIES: "5"
RETRY_DECORATOR_RETRY_BASE_DELAY: "0.5"
Expand Down