MomentoVectorIndex(
self,
embedding: Embeddings,
client: PreviewVectorIndexClient,
index_name: str = | Name | Type | Description |
|---|---|---|
embedding* | Embeddings | The embedding function to use. |
configuration* | VectorIndexConfiguration | The configuration to initialize the Vector Index with. |
credential_provider* | CredentialProvider | The credential provider to authenticate the Vector Index with. |
index_name | str | Default: 'default'The name of the index to store the documents in. Defaults to "default". |
distance_strategy | DistanceStrategy | Default: DistanceStrategy.COSINE |
text_field | str | Default: 'text' |
ensure_index_exists | bool | Default: True |
| Name | Type |
|---|---|
| embedding | Embeddings |
| client | PreviewVectorIndexClient |
| index_name | str |
| distance_strategy | DistanceStrategy |
| text_field | str |
| ensure_index_exists | bool |
Momento Vector Index (MVI) vector store.
Momento Vector Index is a serverless vector index that can be used to store and
search vectors. To use you should have the momento python package installed.
Example:
.. code-block:: python
from langchain_community.embeddings import OpenAIEmbeddings from langchain_community.vectorstores import MomentoVectorIndex from momento import ( CredentialProvider, PreviewVectorIndexClient, VectorIndexConfigurations, )
vectorstore = MomentoVectorIndex( embedding=OpenAIEmbeddings(), client=PreviewVectorIndexClient( VectorIndexConfigurations.Default.latest(), credential_provider=CredentialProvider.from_environment_variable( "MOMENTO_API_KEY" ), ), index_name="my-index", )
The distance strategy to use. If you select DistanceStrategy.EUCLIDEAN_DISTANCE, Momento uses the squared Euclidean distance. Defaults to DistanceStrategy.COSINE.
The name of the metadata field to store the original text in. Defaults to "text".
Whether to ensure that the index exists before adding documents to it. Defaults to True.