feat(core): add Voyage AI embedding and reranker providers #2116
All Vouch review confidence checks passed
Residual risk 0.18 = Change Risk (0.45) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.45 · 305 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.342
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #2116"
general
weight: 0.35
tonydzi
Basic Memory can embed notes and rerank search results through LiteLLM, but Voyage AI has no provider of its own: users need LiteLLM's model strings, per-model dimension settings, and no check that a model name is a real Voyage model.
This adds first-class
voyageproviders built on the officialvoyageaiSDK, shipped as the optionalbasic-memory[voyage]extra:semantic_embedding_provider=voyage):voyage-4-large,voyage-4,voyage-4-lite,voyage-code-4,voyage-3-large,voyage-3.5,voyage-3.5-lite,voyage-code-3,voyage-finance-2,voyage-law-2, plus the contextualizedvoyage-context-4andvoyage-context-3. Matryoshka models accept 2048/1024/512/256; the dimension is requested from Voyage only whensemantic_embedding_dimensionsis set. Chunks are embedded asdocument, queries asquery.reranker_provider=voyage):rerank-3,rerank-3-lite,rerank-2.5,rerank-2.5-lite.bge-small-en-v1.5config default), an unsupported dimension, or a batch size outside 1–1000 fails with an error that lists the valid values. Other providers keep their defaults.-lite, 320Kvoyage-4/voyage-3.5, 120K the rest) using the SDK tokenizer, and by the 1000-input limit; if the tokenizer cannot be loaded, only the input limit applies.{"detail": ...}body.VOYAGE_API_KEY(or the existing key setting) supplies the credential.enable_auto_chunking=trueandchunk_size=32000for indexed chunks, and no auto-chunking for queries. Basic Memory hands providers flat chunks already mixed across notes, so each chunk is its own document and gets no cross-chunk context; this is documented.Docs:
docs/semantic-search.mdand the README rerank section.Tested with new unit tests for the failure modes (bad or missing model, dimensions, batch size, API-imposed contextualized constraints, malformed or failed rerank responses; 100% coverage of the new modules), and live through
bm reindexandbm tool search --mode semanticwith every embedding model (native, 256 and 2048 dimensions where supported) and every rerank model.just test-voyage-liveruns an opt-in live check for a plain and a contextualized model.