mirror of
https://github.com/garrytan/gbrain.git
synced 2026-08-14 08:53:22 +00:00
ZeroEntropy's hosted API shuts down 2026-09-04. `zeroentropyai:zembed-1` has been DEFAULT_EMBEDDING_MODEL since v0.36.2.0, so every brain that never picked a model explicitly was going to lose semantic retrieval on that date — query embedding runs through the same endpoint, so existing vectors go unqueryable too, not just new writes. New default: openai:text-embedding-3-small at 1280 dimensions. 1280, not 1536, is load-bearing. OpenAI text-embedding-3-* is Matryoshka and `isValidOpenAITextEmbedding3Dim` accepts any integer width up to the model's native size (1536 for -small), so a brain created under the previous 1280-wide ZE default keeps its existing vector(1280) column AND its HNSW index. `applyEmbeddingMigration` only calls `runSchemaTransition` when `col.dims !== plan.to_dims`, so migrating at the same width rebuilds vectors only: no dimension transition, no ALTER, no index rebuild. Two things had to move for the new default to actually work: - The openai recipe's `dims_options` omitted 1280. That list is Tier 1 in `isCustomDimValidForProvider` and wins over the Tier-2 Matryoshka range check, so `resolveSchemaEmbeddingDim` REJECTED the shipped default config — `gbrain init` would have refused its own default. Verified by probe before and after. - The recipe listed text-embedding-3-large first. `init`'s env detection picks `models[0]` and only adopts DEFAULT_EMBEDDING_DIMENSIONS when that equals the canonical default, so a fresh OPENAI_API_KEY-only install would have landed on 3-large@1536 and the declared default would have been unreachable. Sunset banner (scaffolded in #3459) now names the concrete target and passes `--dim` at the brain's current width, and reads the DB config plane as well as the file plane — with the default no longer a ZE model, brains that never wrote `embedding_model` to ~/.gbrain/config.json would otherwise stop being detected. Adds a Default-provider policy to CLAUDE.md: a gbrain DEFAULT embedding or reranking model must be either open-weight, or from the vendor with the longest proven model-lifetime record. Novel/startup providers ship as opt-in recipes, never as the default. Also fixes a pre-existing ambient-env flake: test/e2e/fresh-install-pglite.test.ts cleared a hardcoded pair of provider keys, so it failed on any machine with a third provider key set (reproduced on master). It now clears every non-OpenAI embedding provider key enumerated from the recipe registry. The ZeroEntropy reranker default is deliberately unchanged — no replacement has been chosen. Its sunset is called out in the banner, README, and provider doc. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>