MongoDB vector store
MongoDB Atlas Vector Search, selected via VECTOR_STORE_PROVIDER=mongodb.
Enable it
bash
VECTOR_STORE_PROVIDER=mongodb
MONGODB_URI=mongodb://localhost:27017
MONGODB_DB=suprfloInstall the client: pip install pymongo.
Configuration
| Variable | Default | Description |
|---|---|---|
VECTOR_STORE_PROVIDER | pgvector | Set to mongodb to use this store. |
MONGODB_URI | mongodb://localhost:27017 | Connection URI for the MongoDB deployment. |
MONGODB_DB | suprflo | Database name used for the memory collection. |
Notes
- Unit-tested against a mocked pymongo client, not integration-tested against a real Atlas cluster. The
$vectorSearch/$textpipelines are asserted structurally, not executed, so smoke-test before production use. - Requires MongoDB Atlas (or a local Atlas-enabled deployment) for the
$vectorSearchstage. On a plain community/self-hostedmongod,searchandsearch_with_vectorswill fail; everything else (get/list/count/update/delete/invalidate/keyword_search) works on any MongoDB. keyword_searchuses the classic$textoperator over a text index onpayload.data, so it works on any MongoDB without Atlas.$vectorSearchpre-filters may only reference fields declared asfilterpaths in the Atlas index definition; filtering on an arbitrary metadata key not in that list is rejected by Atlas.- Atlas normalizes the cosine score to
(1 + cosine) / 2(pgvector returns raw1 - distance), and$textscores are Mongo's tf-idf-ish textScore, so absolute scores are not comparable across backends though ranking is.valid_touses a far-future sentinel datetime for'infinity'.