Skip to content

Add a similarity floor to meaning search of Conversation events #3574

Open

Description

@sentry-junior

#3564 adds hybrid search to searchConversationEvents. Keyword ranks (BM25) and meaning ranks (cosine distance over stored event vectors) are fused with reciprocal rank fusion.

The meaning leg has no similarity floor. It always returns its 100 nearest events (CANDIDATES_PER_LEG in packages/junior/src/chat/conversations/event-search.ts), even when none of them is related to the query. Fusion gives each of them a rank score, so unrelated events can take result slots, and a query with no real match still returns results.

No floor is tuned for voyage-4-lite yet.

Goal

Drop meaning candidates whose similarity to the query is below a floor before fusion. Keyword matches are not affected.

Work

  • Measure the cosine distance of related and unrelated events for voyage-4-lite on real Conversation history, and pick a floor from that.
  • Apply it in the meaning query. Keep the guard that compares only vectors of the same size.
  • Extend the meaning case in packages/junior-evals/evals/conversation/continuity.eval.ts, or the search integration test, with a query that has no related event.

Start after #3564 merges.

via @BYK.

--

View Session [Sentry]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions