Abstract class representing a store of vectors. Provides methods for adding vectors and documents, deleting from the store, and searching the store.

Hierarchy

Constructors

Properties

FilterType: CollectionFilter

Methods

  • Method that adds documents to AstraDB.

    Parameters

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

      Array of documents to add to AstraDB.

    • Optional options: string[]

      Optional ids for the documents.

    Returns Promise<void>

    Promise that resolves the documents have been added.

  • Method to save vectors to AstraDB.

    Parameters

    • vectors: number[][]

      Vectors to save.

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

      The documents associated with the vectors.

    • Optional options: string[]

    Returns Promise<void>

    Promise that resolves when the vectors have been added.

  • Parameters

    • Optional _params: Record<string, any>

    Returns Promise<void>

  • Create a new collection in your Astra DB vector database and then connects to it. If the collection already exists, it will connect to it as well.

    Returns Promise<void>

    Promise that resolves if connected to the collection.

  • Parameters

    • query: string
    • Optional k: number
    • Optional filter: CollectionFilter
    • Optional _callbacks: Callbacks

    Returns Promise<DocumentInterface<Record<string, any>>[]>

  • Method that performs a similarity search in AstraDB and returns and similarity scores.

    Parameters

    • query: number[]

      Query vector for the similarity search.

    • k: number

      Number of top results to return.

    • Optional filter: CollectionFilter

      Optional filter to apply to the search.

    Returns Promise<[Document<Record<string, any>>, number][]>

    Promise that resolves with an array of documents and their scores.

  • Parameters

    • query: string
    • Optional k: number
    • Optional filter: CollectionFilter
    • Optional _callbacks: Callbacks

    Returns Promise<[DocumentInterface<Record<string, any>>, number][]>

Generated using TypeDoc