Skip to content

Search results: cut weak matches and show real relevance #199

Open

Description

@s3rot0n1n

Found while smoke-testing #196 on QA with a real OpenAI key (team "Acme Invoicing RAG Smoke").

1. Site search and ticket suggestions pad results with weak matches

searchContent returns the top results of the keyword + embedding fusion with no relevance cutoff, and only the chatbot and help desk rerank them. The site search box (docs-search.tsx) and the ticket form's "This might help" suggestions show whatever comes back.

Examples on QA:

  • "how do I get my money back": the blog post "How to get paid twice as fast" ranked above Refunds.
  • "reimbursement": Refunds first, but the Payment reminders changelog and the blog post also listed.
  • Ticket subject "Locked out after getting a new phone": suggested the right 2FA doc plus the unrelated blog post.

Options, simplest first:

  • Drop vector-only hits below a cosine floor higher than today's 0.25, and keyword-only hits with a very low ts_rank_cd.
  • Show fewer results (e.g. 5) in the search box.
  • Optionally rerank site search too when the team has a chat model. That adds latency and cost to every keystroke search, so probably not.

2. Relevance percentages don't mean much

similarity is the fused rank score normalised to 0–1, so the top results nearly always read 95–100%, even for weak matches. The inbox "Docs retrieved" list shows these as "(99%)". On QA, the unrelated blog post scored 0.98 for "money back".

Options:

  • Expose the real cosine similarity (when embeddings exist) or a coarse label (strong / partial match) instead of a percentage.
  • Or hide the number in the inbox and keep only the order.

Done when

  • The QA examples above no longer show unrelated results, or show them clearly below the good one.
  • The inbox no longer shows high percentages for weak matches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions