Exposes Rockset's vector store/search functionality

Hierarchy

Constructors

Properties

FilterType: string
client: MainApi
collectionName: string
embeddingKey: string
embeddings: Embeddings
textKey: string
workspaceName: string
filter?: string

Accessors

  • get similarityMetric(): SimilarityMetric
  • Returns SimilarityMetric

  • set similarityMetric(metric): void
  • Parameters

    Returns void

Methods

  • Embeds and adds Documents to the store.

    Parameters

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

      The documents to store

    Returns Promise<undefined | string[]>

    The _id's of the documents added

  • Adds vectors to the store given their corresponding Documents

    Parameters

    • vectors: number[][]

      The vectors to store

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

      The Documents they represent

    Returns Promise<undefined | string[]>

    The _id's of the added documents

  • Deletes Rockset documements given their _id's

    Parameters

    • ids: string[]

      The IDS to remove documents with

    Returns Promise<void>

  • Deletes the collection this RocksetStore uses

    Parameters

    • Optional waitUntilDeletion: boolean

      Whether to sleep until the collection is ready to be queried

    Returns Promise<void>

  • Parameters

    • query: string
    • k: number = 4
    • filter: undefined | string = undefined
    • _callbacks: undefined | Callbacks = undefined

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

  • Gets the most relevant documents to a query along with their similarity score. The returned documents are ordered by similarity (most similar at the first index)

    Parameters

    • query: number[]

      The embedded query to search the store by

    • k: number

      The number of documents to retreive

    • Optional filter: string

      The SQL WHERE clause to filter by

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

  • Parameters

    • query: string
    • k: number = 4
    • filter: undefined | string = undefined
    • _callbacks: undefined | Callbacks = undefined

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

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

    Parameters

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

    • List of documents selected by maximal marginal relevance.
  • Constructs, adds docs to, and returns a RocksetStore object

    Parameters

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

      The Documents to store

    • embeddings: Embeddings

      The object used to embed queries and page content

    • dbConfig: RocksetLibArgs

      The options to be passed into the RocksetStore constructor

    Returns Promise<RocksetStore>

  • Constructs and returns a RocksetStore object given texts to store.

    Parameters

    • texts: string[]

      The texts to store

    • metadatas: object | object[]

      The metadatas that correspond to

    • embeddings: Embeddings

      The object used to embed queries and page content

    • dbConfig: RocksetLibArgs

      The options to be passed into the RocksetStore constructor

    Returns Promise<RocksetStore>

  • Creates a new Rockset collection and returns a RocksetStore that uses it

    Parameters

    • embeddings: Embeddings

      Object used to embed queries and page content

    • dbConfig: RocksetLibArgs

      The options to be passed into the RocksetStore constructor

    • Optional collectionOptions: CreateCollectionRequest

      The arguments to sent with the HTTP request when creating the collection. Setting a field mapping that VECTOR_ENFORCEs is recommended when using this function. See https://rockset.com/docs/vector-functions/#vector_enforce

    Returns Promise<RocksetStore>

Generated using TypeDoc