langchain.js
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      Returns AstraDBVectorStore

    Properties

    caller: AsyncCaller
    FilterType: CollectionFilter

    Methods

    • Returns string

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

    • Method that deletes documents from AstraDB.

      Parameters

      Returns Promise<void>

      Promise that resolves when the documents have been deleted.

    • 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"]>
        • k

          Number of documents to return.

        • fetchK

          Number of documents to fetch before passing to the MMR algorithm.

        • lambda

          Number between 0 and 1 that determines the degree of diversity among the results, where 0 corresponds to maximum diversity and 1 to minimum diversity.

        • filter

          Optional filter

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

      Parameters

      • docs: Document[]

        The Documents to use.

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

    • Static method to create an instance of AstraDBVectorStore from an existing index.

      Parameters

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

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