Michael ReaM
Convex Community2y ago
2 replies
Michael Rea

Vector search filter: Id NOT in array

    const similarMessagesVectors = await ctx.vectorSearch("messageEmbeddings", "by_embedding", {
        vector: promptEmbedding,
        limit: 5,
        filter: (q) => q.eq("userId", userId) && q.eq("chatId", chatId),
    });


I'm trying to vector search on messages but want to exclude a message (the most recent user prompt) based on Id before the search.

Is this possible with the filter or does it just have to be done after?
Was this page helpful?