feat: expand unifiedSearch to accept object input with optional vector (#855)#1184
Open
pyramation wants to merge 1 commit into
Open
feat: expand unifiedSearch to accept object input with optional vector (#855)#1184pyramation wants to merge 1 commit into
pyramation wants to merge 1 commit into
Conversation
#855) Changes unifiedSearch from String to UnifiedSearchInput: - text: keyword query dispatched to tsvector + BM25 + trgm (text adapters) - vector: query vector dispatched to pgvector (semantic search) - metric: COSINE/L2/IP (default COSINE) - distance: max distance threshold for vector results - includeChunks: enable/disable chunk-aware vector search When both text and vector are provided, WHERE clauses are OR-combined for true hybrid retrieval. searchScore blends all active signals (text + vector) into a single 0..1 relevance number. Hook point for future Graphile LLM plugin: when vector is omitted and an LLM plugin is loaded, it can intercept the text input and auto-generate the vector before the search plugin processes it.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
|
Found 59 test failures on Blacksmith runners: Failures
|
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
Resolves the unifiedSearch input modality mismatch (#855). Previously,
unifiedSearchaccepted a plainStringthat could only be dispatched to text-compatible adapters (tsvector, BM25, trgm). pgvector couldn't participate because it needs a vector array, not text.Before:
After:
Changes:
UnifiedSearchInputGraphQL input type registered in theinithook with fields:text,vector,metric,distance,includeChunksunifiedSearchfilter field type changed fromStringtoUnifiedSearchInputsearchScoreblends all active signals (text + vector) into a single 0..1 relevance numbervector,metric,distance,includeChunks) only appear when a pgvector adapter is registeredvectoris omitted and an LLM plugin is loaded, it can intercept thetextinput and auto-generate the vector before the search plugin processes itBreaking change:
unifiedSearchno longer accepts a plain string. Callers must useunifiedSearch: { text: \"...\" }instead ofunifiedSearch: \"...\".Review & Testing Checklist for Human
Medium risk — API shape change for existing unifiedSearch consumers.
unifiedSearch: \"text\"is updated tounifiedSearch: { text: \"text\" }textandvector— verify rows matching EITHER path are returned (OR semantics)unifiedSearch: { vector: [...], distance: 1.0 }— verify vector distance scoring workssearchScorecorrectly blends text + vector signals when both are activeincludeChunksoption works for vector search throughunifiedSearchinputNotes
UnifiedSearchInputtype conditionally includes vector fields — only when a pgvector adapter is registered. Without pgvector, onlytextis available.tsvTsv,bm25Body,vectorEmbedding, etc.) continue to work independently and can be combined withunifiedSearch.Link to Devin session: https://app.devin.ai/sessions/2b5a29d83d3f478e8d3d972653b4879c
Requested by: @pyramation