@@ -64,6 +64,10 @@ export function enrichPresetWorkflowWithUiMetadata(
64
64
uiMetadata = fetchVectorSearchWithRAGMetadata ( workflowVersion ) ;
65
65
break ;
66
66
}
67
+ case WORKFLOW_TYPE . HYBRID_SEARCH_WITH_RAG : {
68
+ uiMetadata = fetchHybridSearchWithRAGMetadata ( workflowVersion ) ;
69
+ break ;
70
+ }
67
71
default : {
68
72
uiMetadata = fetchEmptyMetadata ( ) ;
69
73
break ;
@@ -278,6 +282,30 @@ export function fetchVectorSearchWithRAGMetadata(version: string): UIState {
278
282
return baseState ;
279
283
}
280
284
285
+ export function fetchHybridSearchWithRAGMetadata ( version : string ) : UIState {
286
+ let baseState = fetchEmptyMetadata ( ) ;
287
+ baseState . type = WORKFLOW_TYPE . HYBRID_SEARCH_WITH_RAG ;
288
+ // Ingest config: knn index w/ an ML inference processor
289
+ baseState . config . ingest . enrich . processors = [ new MLIngestProcessor ( ) . toObj ( ) ] ;
290
+ baseState . config . ingest . index . name . value = generateId ( 'knn_index' , 6 ) ;
291
+ baseState . config . ingest . index . settings . value = customStringify ( {
292
+ [ `index.knn` ] : true ,
293
+ } ) ;
294
+ // Search config: match query => ML inference processor for generating embeddings
295
+ // with hybrid search => ML inference processor for returning LLM-generated response of results
296
+ baseState . config . search . request . value = customStringify ( MATCH_QUERY_TEXT ) ;
297
+ baseState . config . search . enrichRequest . processors = [
298
+ injectQueryTemplateInProcessor (
299
+ new MLSearchRequestProcessor ( ) . toObj ( ) ,
300
+ HYBRID_SEARCH_QUERY_MATCH_KNN
301
+ ) ,
302
+ ] ;
303
+ baseState . config . search . enrichResponse . processors = [
304
+ new MLSearchResponseProcessor ( ) . toObj ( ) ,
305
+ ] ;
306
+ return baseState ;
307
+ }
308
+
281
309
// populate the `query_template` config value with a given query template
282
310
// by default, we replace any vector pattern ("{{vector}}") with the unquoted
283
311
// vector template placeholder (${vector}) so it becomes a proper template
0 commit comments