Interface for the arguments that can be passed to the MemoryVectorStore constructor. It includes an optional similarity function.

interface MemoryVectorStoreArgs {
    similarity?: ((a: number[], b: number[]) => number);
}

Properties

Properties

similarity?: ((a: number[], b: number[]) => number)

Type declaration

    • (a, b): number
    • Returns the average of cosine distances between vectors a and b

      Parameters

      • a: number[]

        first vector

      • b: number[]

        second vector

      Returns number