Summary
Benchmark and select a multilingual FastEmbed embedding model for Basic Memory semantic and hybrid search, including the Basic Memory Cloud path where FastEmbed generates vectors and PostgreSQL/pgvector stores and retrieves them.
This is deliberately separate from #1294. That issue is scoped to lexical full-text search (FTS) analysis across SQLite and PostgreSQL; changing the embedding model does not fix exact CJK keyword matching.
Current state
Goal
Choose a multilingual model from evidence rather than switching defaults based on catalog descriptions alone, then define a safe local and Cloud migration plan.
The benchmark should compare the current English BGE baseline with viable FastEmbed multilingual candidates. Initial candidates to evaluate include, but are not limited to:
sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 (384 dimensions)
sentence-transformers/paraphrase-multilingual-mpnet-base-v2 (768 dimensions)
intfloat/multilingual-e5-large (1024 dimensions; requires query/document prefixes)
jinaai/jina-embeddings-v3 (1024 dimensions)
Do not preselect a winner. Candidates may be removed or added based on FastEmbed support, licensing, artifact stability, resource limits, and measured quality.
Evaluation requirements
Retrieval quality
Build a reproducible evaluation corpus and query set that covers:
- English baseline/regression
- Chinese, Japanese, and Korean
- additional representative scripts/languages such as Arabic, Russian, Spanish, and Thai
- mixed-language notes
- same-language retrieval
- cross-language retrieval where the query and relevant note use different languages
- short notes, long notes, and matches that cross semantic chunk boundaries
- conceptual/paraphrase queries, not only literal keyword overlap
Report at least recall@k and ranking quality (MRR or nDCG), plus empty-result and material false-positive rates. Keep the dataset and harness in the repository so future model changes can be compared against the same baseline.
Runtime and operational cost
Measure on supported deployment hardware:
- cold model load time
- warm query latency
- document embedding throughput
- peak and steady-state memory
- model artifact and container-image size
- vector dimensions and PostgreSQL storage growth
- pgvector index build/update time
- pgvector query latency and recall under the selected index parameters
- full-project and representative tenant reindex duration
Local sqlite-vec measurements may be useful for the Core default, but Cloud acceptance must use FastEmbed inference with PostgreSQL/pgvector storage.
Model contract
Verify for every candidate:
- FastEmbed support on Basic Memory's supported Python/platform matrix
- deterministic configured dimensions
- correct query/document prefix or input-role behavior
- provider-boundary normalization
- stable embedding identity and stale-vector detection
- cancellation and representative error propagation during batch reindex
- license and redistribution suitability for preloading in the Cloud image
Cloud rollout requirements
The selected model must have an explicit Cloud plan:
- Configure the same provider, model, dimensions, and prefixes in API and worker processes.
- Bake/cache the FastEmbed artifact in the Cloud image so workers do not download it at runtime.
- Measure and provision worker memory and concurrency from benchmark results.
- Deploy the new model identity without comparing query vectors against vectors from the old model.
- Rebuild embeddings for every active tenant/project through a retry-safe fleet operation.
- Define whether the first cutover accepts temporary vector incompleteness or requires blue/green vector indexes.
- Monitor per-tenant readiness, failures, duration, pgvector size, and query latency before declaring the migration complete.
Changing dimensions requires compatible pgvector schema/index migration. Keeping 384 dimensions avoids that particular schema change but still requires a complete embedding rebuild because vectors from different models are not comparable.
Non-goals
Acceptance criteria
Summary
Benchmark and select a multilingual FastEmbed embedding model for Basic Memory semantic and hybrid search, including the Basic Memory Cloud path where FastEmbed generates vectors and PostgreSQL/pgvector stores and retrieves them.
This is deliberately separate from #1294. That issue is scoped to lexical full-text search (FTS) analysis across SQLite and PostgreSQL; changing the embedding model does not fix exact CJK keyword matching.
Current state
BAAI/bge-small-en-v1.5, an English model.Goal
Choose a multilingual model from evidence rather than switching defaults based on catalog descriptions alone, then define a safe local and Cloud migration plan.
The benchmark should compare the current English BGE baseline with viable FastEmbed multilingual candidates. Initial candidates to evaluate include, but are not limited to:
sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2(384 dimensions)sentence-transformers/paraphrase-multilingual-mpnet-base-v2(768 dimensions)intfloat/multilingual-e5-large(1024 dimensions; requires query/document prefixes)jinaai/jina-embeddings-v3(1024 dimensions)Do not preselect a winner. Candidates may be removed or added based on FastEmbed support, licensing, artifact stability, resource limits, and measured quality.
Evaluation requirements
Retrieval quality
Build a reproducible evaluation corpus and query set that covers:
Report at least recall@k and ranking quality (MRR or nDCG), plus empty-result and material false-positive rates. Keep the dataset and harness in the repository so future model changes can be compared against the same baseline.
Runtime and operational cost
Measure on supported deployment hardware:
Local sqlite-vec measurements may be useful for the Core default, but Cloud acceptance must use FastEmbed inference with PostgreSQL/pgvector storage.
Model contract
Verify for every candidate:
Cloud rollout requirements
The selected model must have an explicit Cloud plan:
Changing dimensions requires compatible pgvector schema/index migration. Keeping 384 dimensions avoids that particular schema change but still requires a complete embedding rebuild because vectors from different models are not comparable.
Non-goals
Acceptance criteria