Hierarchy (view full)

Constructors

Properties

FilterType: CollectionFilter
caller: AsyncCaller

Methods

  • Method that adds documents to AstraDB.

    Parameters

    • documents: Document[]

      Array of documents to add to AstraDB.

    • Optionaloptions: 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[]

      The documents associated with the vectors.

    • Optionaloptions: string[]

    Returns Promise<void>

    Promise that resolves when the vectors have been added.

  • 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.

  • Return documents selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to the query AND diversity among selected documents.

    Parameters

    • query: string

      Text to look up documents similar to.

    • options: MaxMarginalRelevanceSearchOptions<this["FilterType"]>

    Returns Promise<Document[]>

    • List of documents selected by maximal marginal relevance.
  • 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.

    • Optionalfilter: CollectionFilter

      Optional filter to apply to the search.

    Returns Promise<[Document, number][]>

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

  • Static method to create an instance of AstraDBVectorStore from texts.

    Parameters

    • texts: string[]

      The texts to use.

    • metadatas: object | object[]

      The metadata associated with the texts.

    • embeddings: EmbeddingsInterface

      The embeddings to use.

    • dbConfig: AstraLibArgs

      The arguments for the AstraDBVectorStore.

    Returns Promise<AstraDBVectorStore>

    Promise that resolves with a new instance of AstraDBVectorStore.

""