Repository navigation
feat(routing): calibrated hybrid semantic search scoring, explicit search modes, and test bench simulator overhaul - #261
Merged
Conversation
added 8 commits
October 2, 2026 21:47
…d testbench alignment
…ation and testbench alignment
…h modes (MCP-40, MCP-41)
… and search_tools MCP tool (MCP-41, MCP-42)
… presets, score badges, and tool testing transition (UI-142, UI-143)
…rt layout inspector tests (UI-07, UI-141)
| catch (Exception ex) | ||
| { | ||
| rrfScores[matched.Tool] = rrf; | ||
| logger?.LogWarning(ex, "Failed to generate query embedding for '{Query}'. Falling back to keyword ranking.", query); |
added 2 commits
October 2, 2026 22:54
…tion, and eliminate test theater (MCP-40, MCP-41, MCP-42)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR aligns Model Context Gateway's semantic search and simulator with ContextCortex (PR #36), introducing calibrated hybrid scoring, explicit search modes, decomposed score diagnostics, and a redesigned Semantic Router Simulator.
1. Calibrated Hybrid Scoring & Explicit Search Modes (
MCP-40,MCP-41,MCP-42)374453\text{Score} = \alpha \cdot \text{DenseScore} + (1.0 - \alpha) \cdot \text{SparseScore}374453
0.5balanced).hybrid: Balanced or weighted combination of dense vector similarity and normalized lexical matching.semantic: Pure dense SIMD vector similarity (lexical: Pure sparse / token keyword matching (ToolSearchResultexposesScore,DenseScore,SparseScore,DenseRank, andSparseRank.search_tools: MCP tool declaration and execution updated with optionalmodeanddense_weightparameters with 100% backward compatibility for existing callers.POST /api/test/semantic-searchreceivesmode,denseWeight, andlimit, returning an envelope with decomposed results.2. Semantic Router Simulator Redesign (
UI-142,UI-143)Hybrid Fusion,Semantic (Vector), andLexical (Keyword).Semantic X% / Keyword Y%) and 5 quick calibration presets:Balanced (50/50)Semantic Bias (70/30)Keyword Bias (30/70)Pure Semantic (100/0)Pure Keyword (0/100)5,10,15, or25tools.Score: XX.X%,Semantic: XX.X%,Keyword: XX.X%), server badges, and formatted markdown descriptions.3. Documentation & Live Real Screenshots
docs/assets/semantic_router_simulator.jpg.docs/user-guide/test-bench/semantic-search.mdandARCHITECTURE.mdwith scoring diagrams, formula, modes, and API guides.4. Verification & Quality Gates
wwwroot/.5.21.0acrossModelContextGateway.csproj,frontend/package.json,useUserStore.ts,CHANGELOG.md, andREADME.md.