A vector store that uses the Momento Vector Index.

Remarks

To sign up for a free Momento account, visit https://console.gomomento.com.

Hierarchy

Constructors

Properties

FilterType: string | object
embeddings: Embeddings
lc_kwargs: SerializedFields
lc_namespace: string[] = ...

A path to the module that contains the class, eg. ["langchain", "llms"] Usually should be the same as the entrypoint the class is exported from.

lc_serializable: boolean = false

Accessors

  • get lc_aliases(): undefined | {
        [key: string]: string;
    }
  • A map of aliases for constructor args. Keys are the attribute names, e.g. "foo". Values are the alias that will replace the key in serialization. This is used to eg. make argument names match Python.

    Returns undefined | {
        [key: string]: string;
    }

  • get lc_attributes(): undefined | SerializedFields
  • A map of additional attributes to merge with constructor args. Keys are the attribute names, e.g. "foo". Values are the attribute values, which will be serialized. These attributes need to be accepted by the constructor as arguments.

    Returns undefined | SerializedFields

  • get lc_secrets(): undefined | {
        [key: string]: string;
    }
  • A map of secrets, which will be omitted from serialization. Keys are paths to the secret in constructor args, e.g. "foo.bar.baz". Values are the secret ids, which will be used when deserializing.

    Returns undefined | {
        [key: string]: string;
    }

Methods

  • Adds vectors to the index. Generates embeddings from the documents using the Embeddings instance passed to the constructor.

    Parameters

    • documents: Document<Record<string, any>>[]

      Array of Document instances to be added to the index.

    • Optional documentProps: DocumentProps

    Returns Promise<void>

    Promise that resolves when the documents have been added to the index.

  • Adds vectors to the index.

    Parameters

    • vectors: number[][]

      The vectors to add to the index.

    • documents: Document<Record<string, any>>[]

      The documents to add to the index.

    • Optional documentProps: DocumentProps

      The properties of the documents to add to the index, specifically the ids.

    Returns Promise<void | string[]>

    Promise that resolves when the vectors have been added to the index. Also returns the ids of the documents that were added.

    Remarks

    If the index does not already exist, it will be created if ensureIndexExists is true.

  • Stores the documents in the index.

    Converts the documents to vectors using the Embeddings instance passed.

    Parameters

    • texts: string[]

      The texts to store in the index.

    • metadatas: object | object[]

      The metadata to store in the index.

    • embeddings: Embeddings

      The embeddings instance to use to generate embeddings from the documents.

    • dbConfig: MomentoVectorIndexLibArgs

      The configuration to use to instantiate the vector store.

    • Optional documentProps: DocumentProps

      The properties of the documents to add to the index, specifically the ids.

    Returns Promise<MomentoVectorIndex>

    Promise that resolves to the vector store.

  • The name of the serializable. Override to provide an alias or to preserve the serialized module name in minified environments.

    Implemented as a static method to support loading logic.

    Returns string

Generated using TypeDoc