Hierarchy

  • VectorStore
    • TurbopufferVectorStore

Constructors

Properties

apiKey: string
apiUrl: string = "https://api.turbopuffer.com/v1"
batchSize: number = 3000
caller: AsyncCaller
distanceMetric: TurbopufferDistanceMetric = "cosine_distance"
embeddings: EmbeddingsInterface
namespace: string = "default"

Methods

  • Parameters

    • documents: DocumentInterface<Record<string, any>>[]
    • Optionaloptions: {
          ids?: string[];
      }
      • Optionalids?: string[]

    Returns Promise<string[]>

  • Parameters

    • vectors: number[][]
    • documents: DocumentInterface<Record<string, any>>[]
    • Optionaloptions: {
          ids?: string[];
      }
      • Optionalids?: string[]

    Returns Promise<string[]>

  • Parameters

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

    Returns VectorStoreRetriever<TurbopufferVectorStore>

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

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

    • List of documents selected by maximal marginal relevance.
  • Parameters

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

  • Parameters

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

  • Returns Serialized

  • Parameters

    • _texts: string[]
    • _metadatas: object | object[]
    • _embeddings: EmbeddingsInterface
    • _dbConfig: Record<string, any>

    Returns Promise<VectorStore>