Skip to content

smart-search returns an empty scoped page when stronger rows from other projects or agents fill the over-fetch window #1668

Closed

Description

@dmazhukov

Version: main @ ce95e5e

With project or an agent filter, mem::smart-search asks the hybrid ranker for max(min(limit * 10, 300), 100) results and only then drops rows that belong to other projects or agents (src/functions/smart-search.ts:197-199 and :220-228). When more stronger rows from other scopes exist than that window holds, the scoped page comes back empty or short, although matching rows are in the store.

Reproduce

BM25 only, real HybridSearch over an in-memory KV:

  • 400 observations in project beta (agent agent-b), each in its own session, text deploy rollback;
  • 3 observations in project alpha (agent agent-a), one session, a longer text that also contains deploy rollback.

mem::smart-search { query: "deploy rollback", project: "alpha" } returns results: [] for limit 5, 20 and 100. agentId: "agent-a" in place of project gives the same empty page.

Expected

The search scoped to alpha (or to agent-a) returns the three alpha rows.

Notes

memory_recall (mem::search) over-fetches the same way; #1647 addresses that path.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions