Skip to content

tana_semantic_search (MCP) returns different results than supertag search --semantic (CLI) for the same query #98

Description

@evielync

Version

2.5.10

Description

supertag-mcp's tana_semantic_search tool consistently returns fewer and different results compared to supertag search --semantic on the same database and query. Relevant nodes with similarity scores well above any threshold are found by the CLI but completely absent from MCP results.

Steps to Reproduce

CLI search:

supertag search "llm wiki" --semantic --limit 10

MCP search via stdio:

printf '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}\n{"jsonrpc":"2.0","method":"tools/call","id":2,"params":{"name":"tana_semantic_search","arguments":{"query":"llm wiki","limit":10}}}\n' \
  | supertag-mcp

Results

CLI output (correct):

1  41.6%  Karpathy's LLM Wiki
2  39.6%  Weekly LinkedIn Researcher
3  39.0%  Need Weekly LinkedIn Inspiration?
...

MCP output (same query, same database):

1  39.6%  Weekly LinkedIn Researcher
2  37.8%  week
...

Karpathy's LLM Wiki (41.6% similarity in CLI) is completely absent from MCP results, even with no minSimilarity threshold set. The raw: true parameter makes no difference.

Root Cause Hypothesis

The CLI appears to perform a full vector scan while supertag-mcp uses the LanceDB ANN (approximate nearest neighbour) index with a low nprobes value. This causes the MCP to miss vectors in clusters it didn't probe.

Evidence: Before running supertag embed maintain (which rebuilds the ANN index), the MCP was finding "LLM Knowledge Wiki" correctly at 37.65%. After the index rebuild changed the cluster partitioning, the MCP stopped finding it entirely — while the CLI continued to find it accurately. This behaviour is consistent across queries; the MCP results diverge from CLI results in a way that correlates with index cluster boundaries.

Expected Behaviour

tana_semantic_search should return results consistent with supertag search --semantic for the same query and dataset.

Suggested Fix

Either increase nprobes in the MCP's LanceDB search call, or align the MCP to use the same search path as the CLI (full scan for datasets of this size, ~435k vectors).

Environment

  • macOS (Apple Silicon, Mac Mini)
  • supertag 2.5.10
  • 435,569 embeddings, bge-m3 model, LanceDB
  • Workspace: ~435k named nodes, ~546k embeddable after filtering

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