jcfischer / jcfischer/supertag-cli
tana_semantic_search (MCP) returns different results than supertag search --semantic (CLI) for the same query
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 49
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the discrepancy with supertag search --semantic and the tana_semantic_search MCP tool, then compare their LanceDB search paths and nprobes behavior. Check whether supertag embed maintain changes the results. Done means MCP returns the same relevant results as the CLI for the reported query and dataset, with tests or a reproducible check covering the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, search
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100