Skip to main content
ParameterTypeDefaultDescription
collection_namestrRequiredName of the MongoDB collection to store vectors and metadata
db_urlOptional[str]"mongodb://localhost:27017/"MongoDB connection string
databasestr"ai"Name of the MongoDB database
embedderOptional[Embedder]OpenAIEmbedder()Embedder instance to generate embeddings
distance_metricstrDistance.cosineDistance metric to use for similarity search
overwriteboolFalseWhether to overwrite existing collection and index
cosmos_compatibilityboolFalseWhether to enable support for azure cosmos db mongodb vcore
wait_until_index_ready_in_secondsOptional[float]NoneTime in seconds to wait until the index is ready
wait_after_insert_in_secondsOptional[float]NoneTime in seconds to wait after inserting documents
max_pool_sizeint100Maximum number of connections in the connection pool
retry_writesboolTrueWhether to retry write operations
clientOptional[MongoClient]NoneAn existing MongoClient instance.
search_index_namestr"vector_index_1"Name of the search index
cosmos_compatibilityboolFalseWhether to use Azure Cosmos DB Mongovcore compatibility mode.
search_typestrvectorThe search type to use when searching for documents.
hybrid_vector_weightfloat0.5Default weight for vector search results in hybrid search.
hybrid_keyword_weightfloat0.5Default weight for keyword search results in hybrid search.
hybrid_rank_constantint60Default rank constant (k) for Reciprocal Rank Fusion in hybrid search. This constant is added to the rank before taking the reciprocal, helping to smooth scores. A common value is 60.