···5858### Required env vars for embeddings generation
59596060- `OPENROUTER_API_KEY`
6161-- optional: `OPENROUTER_EMBEDDING_MODEL` (defaults to `openai/text-embedding-3-small`)
6161+- optional: `OPENROUTER_EMBEDDING_MODEL` (defaults to `qwen/qwen3-embedding-8b`)
6262+- optional: `EXISTING_EMBEDDINGS_PATH` for incremental reuse (defaults to current output file)
6363+- optional: `EMBEDDINGS_OUTPUT_PATH` (defaults to `public/video-embeddings.json`)
62646365## Cloudflare Pages function search backend
6466···7274Set this env var in Cloudflare Pages project settings for semantic mode:
73757476- `OPENROUTER_API_KEY`
7575-- optional: `OPENROUTER_EMBEDDING_MODEL`
7777+- optional: `OPENROUTER_EMBEDDING_MODEL` (defaults to `qwen/qwen3-embedding-8b`)
7878+- optional: `EMBEDDINGS_INDEX_URL` (raw URL for externally refreshed index)
76797780If the key is not set, search falls back gracefully to lexical title ranking.
7881···8285 from relay + PDS APIs.
8386- Those fresh videos are lexical-ranked until you refresh `public/video-embeddings.json`.
8487- The UI shows index snapshot time and how many videos are currently embedded.
8888+8989+## GitHub Actions (twice daily incremental refresh)
9090+9191+Workflow file: `.github/workflows/refresh-embeddings.yml`
9292+9393+- Runs every 12 hours and on manual dispatch.
9494+- Reuses existing vectors from `embeddings-data` branch and embeds only new VOD URIs.
9595+- Publishes updated `video-embeddings.json` to `embeddings-data` only when changed.
9696+9797+Recommended Cloudflare env for zero-redeploy index updates:
9898+9999+- `EMBEDDINGS_INDEX_URL=https://raw.githubusercontent.com/j4ckxyz/atmosphere-vods/embeddings-data/video-embeddings.json`
8510086101## Deploy to Vercel
87102