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

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

Properties

Properties

similarity?: ((a: NumberArray, b: NumberArray) => number)

Type declaration

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

      Parameters

      • a: NumberArray

        first vector

      • b: NumberArray

        second vector

      Returns number