Repository navigation
feat(search): public anonymous semantic_search over content corpus (#2246) - #2253
Merged
Merged
Conversation
…2246) Expose an anonymous HTTP function + MCP tool on SearchService that embeds caller TEXT server-side and returns scored content references only — never raw vectors, never accepts a caller-supplied vector. - semanticSearchEnabled ChatSettings flag (default OFF; 503 when off), registered in feature-flags/registry.js - corpora: tutorials | concepts | external | all (cosine over stored Vector(1536); HANA COSINE_SIMILARITY, SQLite JS-cosine) - topK clamped [1,50]; minScore default from ChatSettings; query-embedding cached by hash(query+model) - per-IP rate limiter (429) reusing DB-backed SearchSettings budget - MCP manifest tool entry + @requires:'any' CDS function - unit + handler tests (SQLite); caches on globalThis to survive Windows Vitest module duplication across served vs imported instances
…ch-2246 # Conflicts: # test/unit/mcp-contract.test.js
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.
Closes #2246.
What
Public, anonymous semantic/vector search — an HTTP
function semantic_searchonSearchServiceplus a matching MCP tool — over the existing tutorial/concept/external embedding corpus.Contract (non-negotiable): the caller sends TEXT; the server embeds it server-side (
embedding-client.embed()) and returns scored content references only — never raw embedding vectors, never accepts a caller-supplied vector.Scope
semanticSearchEnabledChatSettings flag, default OFF →503when off; registered infeature-flags/registry.js.tutorials | concepts | external | all(cosine over storedVector(1536); HANACOSINE_SIMILARITYraw-SQL / SQLite JS-cosine).topKclamped[1,50];minScoredefault from ChatSettings; query embedding cached byhash(query+model).429) reusing the DB-backedSearchSettingsbudget.@requires:'any'CDS function; wire shape ={slug,title,stepNumber,snippet,score,url,contentType}.Tests
test/unit/semantic-search.test.js— core module: corpus routing, topK clamp, minScore floor, wire shape (no vectors), embed-once + query cache.test/unit/semantic-search-handler.test.js— service handler: 503 gate, scored refs when enabled, 429 rate limit.test/unit/mcp-contract.test.js— anonymous-tool contract updated.srv-qa/lib/parsers.bundle.mjsbuild artifact, app graph deps) — unrelated to this change.Notes
ChatSettings, rate limiter, embed test hook, cache handle) live onglobalThissymbols to survive the Windows Vitest served-vs-imported module duplication.mta.yamlchange —content-store.jsdoesn't reach the new files and srv-qa serves its own minimalsearch-service.cds.