Skip to content

recall: a multi-word query is answered strictly with an OR fallback, but the docs say the words are OR-ed; sentence-style questions find little #405

Done

Description

@kevintseng

recall treats a multi-word query as if the words were combined strictly, with a looser fallback only when that finds nothing, while AGENTS.md and the MCP tool description say the words are OR-ed. Sentence-style questions, which is how an agent usually asks, find little.

Measured on a copy of a real graph (~3,000 entities), memesh recall "<q>" --limit 30 --json:

query results
release 30
release zzzqqxnotaword 30 (the nonsense word is ignored)
worktree isolation 30
worktree isolation for file-editing agents 1 (adding words shrinks the result)

That pattern fits "all words first, OR only when that is empty" (my inference from these counts; I did not read the query builder). An independent tester ran 25 realistic questions about this project: 18 had a useful top 3 (72%); the misses were sentence-style (a question about why a branch was deleted returned one irrelevant hit although a project doc records the decision; "review receipt required before commit" had no relevant hit in the top 5). In every case retrieval reports {"mode":"fts","degraded":false}, so the caller cannot tell the query was answered in a stricter mode than documented.

Fix direction: measure first with the benchmark (npm run its real-path scorer; the published figure is R@5 95.60%), then try dropping stopwords and/or OR with BM25 ranking as documented; make the docs match whatever ships; report the mode actually used in retrieval.

Activity

  1. kevintseng commented on Sep 21, 2026

    @kevintseng
    CollaboratorAuthor

    A live example from the same dogfood pass, using the MCP recall tool of the installed 4.10.2 on the real graph:

    So the second question was answered with commit noise and no signal that nothing curated matched. Auto-captured commits are about 45% of this project's entities; ranking that prefers curated types (decision, lesson, pattern, reference) over commit when both match, or a type filter default, would fit the goal of #405 as well.

  2. kevintseng commented on Sep 25, 2026

    @kevintseng
    CollaboratorAuthor

    Still present in v4.10.5 (b6b402e): the MCP recall description is now correct, but the agent-facing text still says the words are OR-ed:

    • skills/memesh/SKILL.md:251: "Query words are OR-ed… extra words narrow the ranking, not the result set"
    • AGENTS.md:101: "words are OR-ed"

    AGENTS.md:145 also gives the default recall limit as 30; the tool schema and CLI say 20.

  3. kevintseng commented on Sep 28, 2026

    @kevintseng
    CollaboratorAuthor

    Status at v4.10.8:

  4. kevintseng commented on Sep 28, 2026

    @kevintseng
    CollaboratorAuthor

    Seen on 4.10.8 with about 3,300 memories: recall "how to run tests without touching the real memesh database" returned one unrelated memory and none of the relevant ones. Its size (61.9 KB) is #494.

  5. kevintseng commented on Dec 2, 2026

    @kevintseng
    CollaboratorAuthor

    Word queries now use any-term FTS matching and report their strategy. The 500-question benchmark improved from 477 to 478 top-five hits. Verified on the open PR #650.

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