Skip to content

Embeddings (TEI)

In-cluster text-embeddings-inference server hosting bge-m3 (1024-dim, multilingual) for the backend's semantic location search. Manifests: k8s/envs/platform/embeddings/.

What it does

The backend embeds each place on write (via the enrichment worker) and embeds a search query when lexical results are thin, then does an HNSW cosine lookup over the locations.embedding halfvec column. The service is best-effort: if it's down, search silently falls back to lexical-only.

Shape

Piece Value
Image ghcr.io/huggingface/text-embeddings-inference:cpu-arm64-latest (pin a digest once validated)
Model BAAI/bge-m3 (1024-dim); CPU inference
Node pool pool=app (on-demand, ARM)
Service embeddings.platform.svc.cluster.local:80 (ClusterIP)
Storage embeddings-model-pvc (10Gi, model cache)
Health GET /health

The arm64 CPU tag runs on the ARM pool=app nodes (nodeSelector: {pool: app}, see GKE). Validate the arm64 image on a real node; fallback runtimes are Ollama (snowflake-arctic-embed2) or llama-server (bge-m3 GGUF).

Backend wiring

The backend reaches it via EMBEDDINGS_* env (see the app repo's env-vars reference): EMBEDDINGS_ENABLED=true, EMBEDDINGS_BASE_URL=http://embeddings.platform.svc.cluster.local, EMBEDDINGS_DIMENSIONS=1024, EMBEDDINGS_ALLOW_PRIVATE=true.

Model dimensions

EMBEDDINGS_DIMENSIONS and the locations.embedding halfvec(N) column must match the model (1024 for bge-m3). Changing the model means a schema change + a re-embed of the catalog.