Skip to content

Commit f75fc9a

Browse files
committed
Remove RAG w lexical search
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
1 parent d3c40e5 commit f75fc9a

File tree

6 files changed

+17
-78
lines changed

6 files changed

+17
-78
lines changed

common/constants.ts

-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ export enum WORKFLOW_TYPE {
166166
SEMANTIC_SEARCH = 'Semantic Search',
167167
MULTIMODAL_SEARCH = 'Multimodal Search',
168168
HYBRID_SEARCH = 'Hybrid Search',
169-
RAG = 'RAG with Lexical Retrieval',
170169
VECTOR_SEARCH_WITH_RAG = 'RAG with Vector Retrieval',
171170
HYBRID_SEARCH_WITH_RAG = 'RAG with Hybrid Search',
172171
CUSTOM = 'Custom Search',

common/utils.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import moment from 'moment';
7-
import { DATE_FORMAT_PATTERN, WORKFLOW_TYPE, Workflow } from './';
7+
import { DATE_FORMAT_PATTERN, WORKFLOW_TYPE } from './';
88
import { isEmpty } from 'lodash';
99

1010
export function toFormattedDate(timestampMillis: number): String {
@@ -61,7 +61,6 @@ export function isRAGUseCase(workflowType?: WORKFLOW_TYPE): boolean {
6161
return (
6262
workflowType !== undefined &&
6363
[
64-
WORKFLOW_TYPE.RAG,
6564
WORKFLOW_TYPE.VECTOR_SEARCH_WITH_RAG,
6665
WORKFLOW_TYPE.HYBRID_SEARCH_WITH_RAG,
6766
].includes(workflowType)

public/pages/workflows/new_workflow/quick_configure_modal.tsx

+15-33
Original file line numberDiff line numberDiff line change
@@ -158,24 +158,21 @@ export function QuickConfigureModal(props: QuickConfigureModalProps) {
158158
}),
159159
};
160160
}
161-
// all workflows besides custom and vanilla RAG require an embedding model
162-
if (workflowType !== WORKFLOW_TYPE.RAG) {
163-
tempFormValues = {
164-
...tempFormValues,
165-
embeddingModel: getInitialValue('model'),
166-
};
167-
tempFormSchemaObj = {
168-
...tempFormSchemaObj,
169-
embeddingModel: yup.object({
170-
id: yup
171-
.string()
172-
.trim()
173-
.min(1, 'Too short')
174-
.max(MAX_STRING_LENGTH, 'Too long')
175-
.required('Required'),
176-
}),
177-
};
178-
}
161+
tempFormValues = {
162+
...tempFormValues,
163+
embeddingModel: getInitialValue('model'),
164+
};
165+
tempFormSchemaObj = {
166+
...tempFormSchemaObj,
167+
embeddingModel: yup.object({
168+
id: yup
169+
.string()
170+
.trim()
171+
.min(1, 'Too short')
172+
.max(MAX_STRING_LENGTH, 'Too long')
173+
.required('Required'),
174+
}),
175+
};
179176
}
180177
setFormValues(tempFormValues);
181178
setFormSchemaObj(tempFormSchemaObj);
@@ -315,7 +312,6 @@ export function QuickConfigureModal(props: QuickConfigureModalProps) {
315312
</EuiFlexItem>
316313
)}
317314
{props.workflow?.ui_metadata?.type !== WORKFLOW_TYPE.CUSTOM &&
318-
props.workflow?.ui_metadata?.type !== WORKFLOW_TYPE.RAG &&
319315
!isEmpty(deployedModels) && (
320316
<EuiFlexItem>
321317
<>
@@ -463,20 +459,6 @@ function injectQuickConfigureFields(
463459
}
464460
break;
465461
}
466-
case WORKFLOW_TYPE.RAG: {
467-
if (!isEmpty(quickConfigureFields) && workflow.ui_metadata?.config) {
468-
workflow.ui_metadata.config = updateIndexConfig(
469-
workflow.ui_metadata.config,
470-
quickConfigureFields
471-
);
472-
workflow.ui_metadata.config = updateRAGSearchResponseProcessors(
473-
workflow.ui_metadata.config,
474-
quickConfigureFields,
475-
llmInterface
476-
);
477-
}
478-
break;
479-
}
480462
case WORKFLOW_TYPE.VECTOR_SEARCH_WITH_RAG:
481463
case WORKFLOW_TYPE.HYBRID_SEARCH_WITH_RAG: {
482464
if (!isEmpty(quickConfigureFields) && workflow.ui_metadata?.config) {

public/pages/workflows/new_workflow/quick_configure_optional_fields.tsx

+1-13
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ export function QuickConfigureOptionalFields(
8282
};
8383
break;
8484
}
85-
case WORKFLOW_TYPE.RAG: {
86-
defaultFieldValues = {
87-
textField: DEFAULT_TEXT_FIELD,
88-
promptField: '',
89-
llmResponseField: DEFAULT_LLM_RESPONSE_FIELD,
90-
};
91-
break;
92-
}
9385
case WORKFLOW_TYPE.VECTOR_SEARCH_WITH_RAG:
9486
case WORKFLOW_TYPE.HYBRID_SEARCH_WITH_RAG: {
9587
defaultFieldValues = {
@@ -160,11 +152,7 @@ export function QuickConfigureOptionalFields(
160152
fullWidth={true}
161153
label={'Text field'}
162154
isInvalid={false}
163-
helpText={`The name of the text document field to be ${
164-
props.workflowType === WORKFLOW_TYPE.RAG
165-
? 'used as context to the large language model (LLM).'
166-
: 'embedded.'
167-
}`}
155+
helpText={`The name of the text document field to be embedded`}
168156
>
169157
<EuiCompressedFieldText
170158
data-testid="textFieldQuickConfigure"

public/pages/workflows/new_workflow/utils.ts

-15
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ export function enrichPresetWorkflowWithUiMetadata(
5656
uiMetadata = fetchHybridSearchMetadata(workflowVersion);
5757
break;
5858
}
59-
case WORKFLOW_TYPE.RAG: {
60-
uiMetadata = fetchRAGMetadata(workflowVersion);
61-
break;
62-
}
6359
case WORKFLOW_TYPE.VECTOR_SEARCH_WITH_RAG: {
6460
uiMetadata = fetchVectorSearchWithRAGMetadata(workflowVersion);
6561
break;
@@ -247,17 +243,6 @@ export function fetchHybridSearchMetadata(version: string): UIState {
247243
return baseState;
248244
}
249245

250-
export function fetchRAGMetadata(version: string): UIState {
251-
let baseState = fetchEmptyMetadata();
252-
baseState.type = WORKFLOW_TYPE.RAG;
253-
baseState.config.ingest.index.name.value = generateId('my_index', 6);
254-
baseState.config.search.request.value = customStringify(FETCH_ALL_QUERY);
255-
baseState.config.search.enrichResponse.processors = [
256-
new MLSearchResponseProcessor().toObj(),
257-
];
258-
return baseState;
259-
}
260-
261246
export function fetchVectorSearchWithRAGMetadata(version: string): UIState {
262247
let baseState = fetchEmptyMetadata();
263248
baseState.type = WORKFLOW_TYPE.VECTOR_SEARCH_WITH_RAG;

server/resources/templates/lexical_search_with_rag.json

-14
This file was deleted.

0 commit comments

Comments
 (0)