ZeroEntropy — zembed-1 + zerank-2
ZeroEntropy ships two specialized small models for retrieval pipelines:zembed-1— multilingual embedding distilled from zerank-2. Flexible Matryoshka dims (2560/1280/640/320/160/80/40), 32K context, asymmetricinput_type: query|documentencoding. 0.05 regular.zerank-2— SOTA multilingual cross-encoder reranker. $0.025/1M tokens (~50% cheaper than Cohere/Voyage rerankers). Pluszerank-1andzerank-1-smallfor legacy / open-source needs.
Setup
- Get an API key at dashboard.zeroentropy.dev.
- Export it:
Embedding switch — zembed-1
Important:modusbrain config set embedding_model … is NOT a live
gateway switch. embedding_model and embedding_dimensions size the
schema and must be stable across engine connects, so they only resolve
from the file plane (~/.modusbrain/config.json) and the env plane
(MODUSBRAIN_EMBEDDING_MODEL / MODUSBRAIN_EMBEDDING_DIMENSIONS). The DB plane
is intentionally ignored for these two keys (same posture as today’s
Voyage setup).
Option A — file plane (recommended for stable installs)
Edit~/.modusbrain/config.json:
2560 (default), 1280, 640, 320, 160, 80, 40.
Matryoshka-style — smaller trades quality for storage monotonically.
Pick the largest that fits your column width.
Option B — env plane (CI / Docker)
Re-embed
Switching embedding models invalidates the vector index. Re-embed:Verify
status: "ok". Invalid dims (e.g. 1024, 1536, 3072)
surface as status: "config" with a paste-ready
modusbrain config set embedding_dimensions <one of 2560|1280|640|320|160|80|40> fix hint.
Reranker switch — zerank-2
The reranker is the bigger story: modusbrain had no cross-encoder reranker stage before v0.35.0.0. It slots between RRF dedup and token-budget enforcement in hybrid search.Default-on with tokenmax mode
tokenmax mode now defaults search.reranker.enabled = true with
zerank-2. If you already use tokenmax AND have ZEROENTROPY_API_KEY
set, reranker fires automatically. Without the key, every rerank call
fails-open (audit-logged) and search returns RRF order — same UX as
before, just with an observable failure surfaced via modusbrain doctor.
Opt-in on conservative or balanced mode
Cost anchor
At 30 candidates × ~400 tokens/chunk × 0.0003/query**. Rounding error against thetokenmax + Opus pairing’s ~$700/mo at
single-user volume per the CLAUDE.md cost matrix.
Verify
reranker_config(zero-network) — validates the model resolves through the recipe registry and is in the touchpoint’s allowlist.- A reachability probe sends a minimal
{query: "probe", documents: ["probe"]}rerank to verify auth + URL.
Knobs reference
Failure observability
Reranker is fail-open by construction: every error class (auth, rate-limit, network, timeout, payload-too-large, unknown) returns the original RRF order unchanged. Failures log to~/.modusbrain/audit/rerank-failures-YYYY-Www.jsonl (ISO-week rotation).
modusbrain doctor reads the audit and surfaces:
- auth failures — any single one warns (config-time problem doctor’s own probe should have caught)
- payload-too-large — any single one warns (workload-mismatch signal)
- transient (network/timeout/rate_limit) — warns at >=5 in 7 days
Asymmetric input_type
ZE zembed-1 (and Voyage v3+) use asymmetric query/document encoding for better retrieval. The gateway’sembedQuery(text) companion threads
input_type: 'query'; standard embed(texts) defaults to
'document'. Hybrid search’s two query-side embed sites use
embedQuery() automatically; all ingest paths use embed().
Symmetric providers (OpenAI text-embedding-3, fixed-dim Voyage models)
ignore the field — no behavior change.
Cache key versioning
v0.35.0.0 bumpedKNOBS_HASH_VERSION 1 → 2 to fold reranker config into
the query_cache.knobs_hash column. During a rolling deploy:
- Expect a temporary cache hit-rate dip (~1 hour at default
cache.ttl_seconds = 3600s) - Hot queries may briefly double their cache row count (one row per version)