Hacker News new | ask | show | jobs
by malandin 7 days ago
Interesting idea! What are you suggesting to do with relevance? I feel like one MEANS request returns just one best matching result while a user may want to have more. We decided to express it in SQL logic like what you see below but I'm really curious how the MEANS operator could be applied.

-----

SELECT id

FROM index_name

ORDER BY emb <-> $query_vector

LIMIT k;

-----

$query_vector may come from anywhere including being transformed on the fly from 'some text'.

1 comments

Yeah I’d say sorting by relevance is similar but MEANS is strictly a boolean operator only allowed in WHERE clauses at the moment.

The way it works is: 1. Prune rows based on semantic index 2. Run surviving rows through the LLM which answer yes or no to the given predicate. 3. Collect final result.

Order by relevance is on the roadmap but I haven’t given it much thought.

The use case I’ve been working with is querying meeting transcripts. May I ask what your use cases are and how you’d like order by relevance to work?

A-ha! So you have re-ranking discreetly baked into the pipeline. I'd argue that this could be better for a user to decide but it depends on the use-case really. Speaking of 'order by relevance', the cases that I had in mind could be connected to the re-ranking use case. For example, what if I was looking for a photo of a chihuahua and then wanted to take the best 20 and run them through a re-ranker to come up with the best 5 (or best 1 even).