langchain.js
    Preparing search index...

    Typesense vector store.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      Returns Typesense

    Properties

    FilterType: Partial<MultiSearchRequestSchema>

    Methods

    • Transform documents to Typesense records.

      Parameters

      • documents: Document[]
      • vectors: number[][]

      Returns Record<string, unknown>[]

      Typesense records.

    • Transform the Typesense records to documents.

      Parameters

      • typesenseRecords: undefined | { document?: Record<string, unknown>; vector_distance: number }[]

      Returns [Document, number][]

      documents

    • Returns string

    • Add documents to the vector store. Will be updated if in the metadata there is a document with the same id if is using the default import function. Metadata will be added in the columns of the schema based on metadataColumnNames.

      Parameters

      • documents: Document[]

        Documents to add.

      Returns Promise<void>

    • Adds vectors to the vector store.

      Parameters

      • vectors: number[][]

        Vectors to add.

      • documents: Document[]

        Documents associated with the vectors.

      Returns Promise<void>

    • Delete documents from the vector store.

      Parameters

      • documentIds: string[]

        ids of the documents to delete

      Returns Promise<void>

    • Search for similar documents with their similarity score.

      Parameters

      • vectorPrompt: number[]

        vector to search for

      • Optionalk: number

        amount of results to return

      • filter: Partial<MultiSearchRequestSchema> = {}

      Returns Promise<[Document, number][]>

      similar documents with their similarity score

    • Create a vector store from documents.

      Parameters

      • docs: Document[]

        documents

      • embeddings: EmbeddingsInterface

        embeddings

      • config: TypesenseConfig

        Typesense configuration

      Returns Promise<Typesense>

      Typesense vector store

      You can omit this method, and only use the constructor and addDocuments.

    • Create a vector store from texts.

      Parameters

      • texts: string[]
      • metadatas: object[]
      • embeddings: EmbeddingsInterface
      • config: TypesenseConfig

      Returns Promise<Typesense>

      Typesense vector store