langchain.js
    Preparing search index...

    Class for interacting with SingleStoreDB, a high-performance distributed SQL database. It provides vector storage and vector functions.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    connectionPool: Pool
    contentColumnName: string
    distanceMetric: DistanceMetrics
    idColumnName: string
    metadataColumnName: string
    searchConfig: SearchConfig
    tableName: string
    useFullTextIndex: boolean
    useVectorIndex: boolean
    vectorColumnName: string
    vectorIndexName: string
    vectorIndexOptions: Metadata
    vectorSize: number

    Methods

    • Returns string

    • Adds new documents to the SingleStoreDB database.

      Parameters

      • documents: Document[]

        An array of Document objects.

      Returns Promise<void>

    • Adds new vectors to the SingleStoreDB database.

      Parameters

      • vectors: number[][]

        An array of vectors.

      • documents: Document[]

        An array of Document objects.

      Returns Promise<void>

    • Creates a new table in the SingleStoreDB database if it does not already exist.

      Returns Promise<void>

    • Ends the connection to the SingleStoreDB database.

      Returns Promise<void>

    • Sets the search configuration for the SingleStoreVectorStore instance.

      Parameters

      • config: SearchConfig

        A SearchConfig object.

      Returns Promise<void>

    • Performs a similarity search on the texts stored in the SingleStoreDB

      Parameters

      • query: string

        A string representing the query text.

      • Optionalk: number

        The number of nearest neighbors to return. By default, it is 4.

      • Optionalfilter: Metadata

        Optional metadata to filter the texts by.

      • Optional_callbacks: any

        Callbacks object, not used in this implementation.

      Returns Promise<DocumentInterface<Metadata>[]>

      Top matching documents

    • Performs a similarity search on the texts stored in the SingleStoreDB using the specified search strategy and distance metric.

      Parameters

      • query: string

        A string representing the query text.

      • vector: number[]

        An array of numbers representing the query vector.

      • k: number

        The number of nearest neighbors to return.

      • Optionalfilter: Metadata

        Optional metadata to filter the texts by.

      Returns Promise<[Document, number][]>

      Top matching documents with score

    • Performs a similarity search on the vectors stored in the SingleStoreDB database.

      Parameters

      • query: number[]

        An array of numbers representing the query vector.

      • k: number

        The number of nearest neighbors to return.

      • Optionalfilter: Metadata

        Optional metadata to filter the vectors by.

      Returns Promise<[Document, number][]>

      Top matching vectors with score

    • Performs a similarity search on the texts stored in the SingleStoreDB

      Parameters

      • query: string

        A string representing the query text.

      • Optionalk: number

        The number of nearest neighbors to return. By default, it is 4.

      • Optionalfilter: Metadata

        Optional metadata to filter the texts by.

      • Optional_callbacks: any

      Returns Promise<[DocumentInterface<Metadata>, number][]>

      Top matching documents with score

    • Creates a new instance of the SingleStoreVectorStore class from a list of Document objects.

      Parameters

      • docs: Document[]

        An array of Document objects.

      • embeddings: EmbeddingsInterface

        An Embeddings object.

      • dbConfig: SingleStoreVectorStoreConfig

        A SingleStoreVectorStoreConfig object.

      Returns Promise<SingleStoreVectorStore>

      A new SingleStoreVectorStore instance

    • Creates a new instance of the SingleStoreVectorStore class from a list of texts.

      Parameters

      • texts: string[]

        An array of strings.

      • metadatas: object[]

        An array of metadata objects.

      • embeddings: EmbeddingsInterface

        An Embeddings object.

      • dbConfig: SingleStoreVectorStoreConfig

        A SingleStoreVectorStoreConfig object.

      Returns Promise<SingleStoreVectorStore>

      A new SingleStoreVectorStore instance