Class MongoVectorStoreConfig
java.lang.Object
com.google.genkit.plugins.mongodb.MongoVectorStoreConfig
Configuration for a single MongoDB Atlas Vector Search collection managed by
MongoPlugin.
Each config registers a retriever and indexer named mongodb/<collectionName> backed by
an Atlas Vector Search index over the embedding field.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forMongoVectorStoreConfig.static enumVector similarity function supported by Atlas Vector Search. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder.Returns additional metadata merged into every indexed document.Returns the collection name.Returns the database name (defaultgenkit).intReturns the embedding dimension (default768).Returns the name of the embedder used to vectorize documents and queries.Returns the field that stores the embedding vector (defaultembedding).Returns the Atlas Vector Search index name (defaultgenkit_vector_index).intReturns the number of nearest neighbors to consider during the vector search (default100).Returns the vector similarity function (defaultMongoVectorStoreConfig.Similarity.COSINE).Returns the field that stores the document text (defaulttext).booleanReturns whether to create the Atlas Vector Search index on first use if it does not exist (defaultfalse).
-
Method Details
-
getDatabaseName
Returns the database name (defaultgenkit).- Returns:
- the database name
-
getCollectionName
Returns the collection name.- Returns:
- the collection name
-
getEmbedderName
Returns the name of the embedder used to vectorize documents and queries.- Returns:
- the embedder name
-
getIndexName
Returns the Atlas Vector Search index name (defaultgenkit_vector_index).- Returns:
- the index name
-
getDimension
public int getDimension()Returns the embedding dimension (default768).- Returns:
- the embedding dimension
-
getSimilarity
Returns the vector similarity function (defaultMongoVectorStoreConfig.Similarity.COSINE).- Returns:
- the similarity
-
getTextField
Returns the field that stores the document text (defaulttext).- Returns:
- the text field name
-
getEmbeddingField
Returns the field that stores the embedding vector (defaultembedding).- Returns:
- the embedding field name
-
getNumCandidates
public int getNumCandidates()Returns the number of nearest neighbors to consider during the vector search (default100). Atlas recommends a value at least 10× the requested result count.- Returns:
- the number of candidates
-
isCreateIndexIfNotExists
public boolean isCreateIndexIfNotExists()Returns whether to create the Atlas Vector Search index on first use if it does not exist (defaultfalse).- Returns:
trueif the index should be created when missing
-
getAdditionalMetadata
Returns additional metadata merged into every indexed document.- Returns:
- the additional metadata
-
builder
Creates a new builder.- Returns:
- a new builder
-