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

Hierarchy

  • VectorStore
    • SingleStoreVectorStore

Constructors

Properties

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

Methods

  • Adds new vectors to the SingleStoreDB database.

    Parameters

    • vectors: number[][]

      An array of vectors.

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

      An array of Document objects.

    Returns Promise<void>

  • Parameters

    • OptionalkOrFields: number | Partial<VectorStoreRetrieverInput<SingleStoreVectorStore>>
    • Optionalfilter: string | object
    • Optionalcallbacks: Callbacks
    • Optionaltags: string[]
    • Optionalmetadata: Record<string, unknown>
    • Optionalverbose: boolean

    Returns VectorStoreRetriever<SingleStoreVectorStore>

  • Parameters

    • Optional_params: Record<string, any>

    Returns Promise<void>

  • 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<string | object>
    • _callbacks: undefined | Callbacks

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

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

      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<Record<string, any>>, 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<Record<string, any>>, 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: Callbacks

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

    Top matching documents with score

  • Returns Serialized