embedding=embedding, limit=k, metadata=metadata, **kwargs
        )
        return self._max_marginal_relevance_selection(
            embedding, results, k=k, lambda_mult=lambda_mult
        )
[docs]    async def amax_marginal_relevance_search_by_vector(
        self,
        embedding: List[float],
        k: int = 4,
        fetch_k: int = 20,
        lambda_mult: float = 0.5,
        metadata: Optional[Dict[str, Any]] = None,
        **kwargs: Any,
    ) -> List[Document]:
        """Return docs selected using the maximal marginal relevance."""
        if not self._collection:
            raise ValueError(
                "collection should be an instance of a Zep DocumentCollection"
            )
        results = await self._collection.asearch(
            embedding=embedding, limit=k, metadata=metadata, **kwargs
        )
        return self._max_marginal_relevance_selection(
            embedding, results, k=k, lambda_mult=lambda_mult
        )
[docs]    @classmethod
    def from_texts(
        cls,
        texts: List[str],
        embedding: Optional[Embeddings] = None,
        metadatas: Optional[List[dict]] = None,
        collection_name: str = "",
        api_url: str = "",
        api_key: Optional[str] = None,
        config: Optional[CollectionConfig] = None,
        **kwargs: Any,
    ) -> ZepVectorStore:
        """
        Class method that returns a ZepVectorStore instance initialized from texts.
        If the collection does not exist, it will be created.
        Args:
            texts (List[str]): The list of texts to add to the vectorstore.