Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f635768
Merge pull request #97 from buerokratt/wip
Thirunayan22 Dec 16, 2025
b674b5e
updated docker compose ec2
Thirunayan22 Dec 16, 2025
9fec475
integrate streaming endpoint with test prodction connection page
Jan 7, 2026
9caa51d
formatted response with markdown
Jan 7, 2026
49a78eb
fe logic for the encryption
Jan 9, 2026
e8af3fa
vault secret update after fixing issues
nuwangeek Jan 9, 2026
dd3fa8b
fixed formatting issue
nuwangeek Jan 9, 2026
023d53a
Merge pull request #100 from rootcodelabs/RAG-201-Fix
nuwangeek Jan 9, 2026
6e7e45f
integration with be
Jan 9, 2026
620af8c
update cron manager vault script
nuwangeek Jan 9, 2026
509d0f0
Merge pull request #101 from rootcodelabs/RAG-201-Fix
nuwangeek Jan 9, 2026
c6351eb
tested integration of vault security update
nuwangeek Jan 12, 2026
30f05bb
fix security issues
nuwangeek Jan 13, 2026
8b54764
Merge pull request #102 from rootcodelabs/streaming-response-formatting
nuwangeek Jan 13, 2026
7b1c830
Merge branch 'RAG-206' into encrypt-llm-keys
nuwangeek Jan 13, 2026
4fe08d1
Merge pull request #103 from rootcodelabs/encrypt-llm-keys
nuwangeek Jan 13, 2026
9af1a1e
creation success model changes
Jan 13, 2026
6e5234c
Merge branch 'encrypt-llm-keys' of https://github.com/rootcodelabs/RA…
Jan 13, 2026
6830670
clean vite config generated files
Jan 13, 2026
a416995
fixed issue references are not sending with streming tokens
nuwangeek Jan 13, 2026
0352184
complete #192 and #206 bug fixes
nuwangeek Jan 14, 2026
925af1c
production inference display logic change
Jan 14, 2026
b584e44
change production inference display logic
Jan 14, 2026
ce0916d
fixed requested issue
nuwangeek Jan 14, 2026
6f95769
Merge pull request #105 from buerokratt/wip
nuwangeek Jan 14, 2026
5cc3963
Merge branch 'RAG-192' into wip
nuwangeek Jan 14, 2026
f6ea894
Merge pull request #108 from buerokratt/wip
erangi-ar Jan 19, 2026
08ce120
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into…
Jan 19, 2026
c854c94
Merge branch 'encrypt-llm-keys' of https://github.com/rootcodelabs/RA…
Jan 19, 2026
9f8074e
Refactor Docker Compose configuration for vault agents and update CSP…
Jan 19, 2026
fb08609
Remove obsolete Vite configuration files and associated plugins
Jan 19, 2026
355ca1c
Merge pull request #109 from rootcodelabs/encrypt-llm-keys
erangi-ar Jan 19, 2026
c2bfedb
Add prompt configuration management feature
Jan 20, 2026
f4d83d8
Add prompt configuration retrieval and update endpoint paths
Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- liquibase formatted sql

-- changeset Erangi Ariyasena:rag-script-v5-changeset1
CREATE TABLE public.prompt_configuration (
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY,
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The database migration is missing a PRIMARY KEY constraint on the id column. While the column is defined as an IDENTITY column, it should explicitly be marked as PRIMARY KEY to ensure proper indexing and prevent duplicate IDs.

Suggested change
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY,
id BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,

Copilot uses AI. Check for mistakes.
prompt TEXT
);

4 changes: 3 additions & 1 deletion DSL/Liquibase/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ databaseChangeLog:
- include:
file: changelog/rag-search-script-v3-configuration.sql
- include:
file: changelog/rag-search-script-v4-authority-data.xml
file: changelog/rag-search-script-v4-authority-data.xml
- include:
file: changelog/rag-search-script-v5-prompt-config.sql
5 changes: 5 additions & 0 deletions DSL/Resql/rag-search/GET/get-prompt-configuration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SELECT
id,
prompt
FROM prompt_configuration
LIMIT 1
3 changes: 3 additions & 0 deletions DSL/Resql/rag-search/POST/insert-prompt-configuration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
INSERT INTO prompt_configuration (prompt)
VALUES (:prompt)
RETURNING id, prompt
4 changes: 4 additions & 0 deletions DSL/Resql/rag-search/POST/update-prompt-configuration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
UPDATE prompt_configuration
SET prompt = :prompt
WHERE id = :id
RETURNING id, prompt
39 changes: 39 additions & 0 deletions DSL/Ruuter.private/rag-search/GET/prompt-configuration/get.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
declaration:
call: declare
version: 0.1
description: "Get prompt configuration"
method: get
accepts: json
returns: json
namespace: rag-search

get_prompt_configuration:
call: http.get
args:
url: "[#RAG_SEARCH_RESQL]/get-prompt-configuration"
result: prompt_result
next: check_prompt_exists

check_prompt_exists:
switch:
- condition: "${prompt_result.response.body.length > 0}"
next: transform_response
next: transform_empty_response

transform_response:
assign:
data: ${prompt_result.response.body}
next: return_success

transform_empty_response:
assign:
emptyData: []
next: return_empty

return_success:
return: ${data}
next: end

return_empty:
return: ${emptyData}
next: end
58 changes: 58 additions & 0 deletions DSL/Ruuter.private/rag-search/POST/prompt-configuration/save.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
declaration:
call: declare
version: 0.1
description: "Update or insert prompt configuration"
method: post
accepts: json
returns: json
namespace: rag-search
allowlist:
body:
- field: prompt
type: string
description: "Prompt text to save"

extract_request_data:
assign:
prompt: ${incoming.body.prompt ?? ""}
Comment on lines +15 to +17
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The endpoint doesn't validate that the prompt field is non-empty before attempting to save. While the frontend performs trim validation, the backend should also validate that the prompt is not empty or only whitespace to prevent storing invalid data.

Copilot uses AI. Check for mistakes.
next: get_existing_prompt

get_existing_prompt:
call: http.get
args:
url: "[#RAG_SEARCH_RESQL]/get-prompt-configuration"
result: existing_prompt
next: check_if_exists

check_if_exists:
switch:
- condition: "${existing_prompt.response.body.length > 0}"
next: update_prompt
next: insert_prompt

update_prompt:
call: http.post
args:
url: "[#RAG_SEARCH_RESQL]/update-prompt-configuration"
body:
id: ${existing_prompt.response.body[0].id}
prompt: ${prompt}
result: update_result
next: return_update_success

insert_prompt:
call: http.post
args:
url: "[#RAG_SEARCH_RESQL]/insert-prompt-configuration"
body:
prompt: ${prompt}
result: insert_result
next: return_insert_success

return_update_success:
return: ${update_result.response.body[0]}
next: end

return_insert_success:
return: ${insert_result.response.body[0]}
next: end
2 changes: 1 addition & 1 deletion DSL/Ruuter.private/rag-search/POST/vault/secret/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ declaration:
method: post
accepts: json
returns: json
namespace: classifier
namespace: rag-search
allowlist:
body:
- field: connectionId
Expand Down
2 changes: 1 addition & 1 deletion DSL/Ruuter.private/rag-search/POST/vault/secret/delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ declaration:
method: post
accepts: json
returns: json
namespace: classifier
namespace: rag-search
allowlist:
body:
- field: connectionId
Expand Down
2 changes: 2 additions & 0 deletions GUI/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import ViewLLMConnection from 'pages/LLMConnections/ViewLLMConnection';
import UserManagement from 'pages/UserManagement';
import TestLLM from 'pages/TestModel';
import TestProductionLLM from 'pages/TestProductionLLM';
import PromptConfigurations from 'pages/PromptConfigurations';

const App: FC = () => {
const navigate = useNavigate();
Expand Down Expand Up @@ -62,6 +63,7 @@ const App: FC = () => {
<Route path="/llm-connections" element={<LLMConnections />} />
<Route path="/create-llm-connection" element={<CreateLLMConnection />} />
<Route path="/view-llm-connection" element={<ViewLLMConnection />} />
<Route path="/prompt-configurations" element={<PromptConfigurations />} />
<Route path="/test-llm" element={<TestLLM />} />
<Route path="/test-production-llm" element={<TestProductionLLM />} />

Expand Down
16 changes: 13 additions & 3 deletions GUI/src/components/MainNavigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,19 @@ const MainNavigation: FC = () => {
},
{
id: 'llmConnections',
label: t('menu.llmConnections'),
path: '/llm-connections',
label: t('menu.llmConnections._self'),
path: '',
icon: <MdOutlineDataset />,
children: [
{
label: t('menu.llmConnections.overview'),
path: '/llm-connections',
},
{
label: t('menu.llmConnections.promptConfigurations'),
path: '/prompt-configurations',
}
],
},
{
id: 'testLLM',
Expand All @@ -37,7 +47,7 @@ const MainNavigation: FC = () => {
},
{
id: 'testProductionLLM',
label: 'Test Production LLM',
label: t('menu.testProductionLLM'),
path: '/test-production-llm',
icon: <MdSearch />
}
Expand Down
39 changes: 39 additions & 0 deletions GUI/src/pages/PromptConfigurations/PromptConfigurations.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.prompt-configurations {
padding: 2rem;

.container {
max-width: 1200px;
margin: 0 auto;
}

.title-container {
margin-bottom: 2rem;

.title {
font-size: 2rem;
font-weight: 600;
margin-bottom: 0.5rem;
color: #1a1a1a;
}

.subtitle {
font-size: 1rem;
color: #666;
margin: 0;
}
}

.prompt-form {
background: #fff;
border-radius: 8px;
padding: 2rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);

.form-actions {
margin-top: 1.5rem;
display: flex;
justify-content: flex-end;
gap: 1rem;
}
}
}
100 changes: 100 additions & 0 deletions GUI/src/pages/PromptConfigurations/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { FC, useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
import { Button, FormTextarea } from 'components';
import { ButtonAppearanceTypes, ToastTypes } from 'enums/commonEnums';
import CircularSpinner from 'components/molecules/CircularSpinner/CircularSpinner';
import { getPromptConfiguration, savePromptConfiguration } from 'services/promptConfiguration';
import { promptConfigurationQueryKeys } from 'utils/queryKeys';
import { useToast } from 'hooks/useToast';
import './PromptConfigurations.scss';

const PromptConfigurations: FC = () => {
const { t } = useTranslation();
const toast = useToast();
const queryClient = useQueryClient();
const [promptText, setPromptText] = useState('');
const [isUpdating, setIsUpdating] = useState(false);

// Fetch prompt configuration
const { data: promptConfig, isLoading } = useQuery({
queryKey: promptConfigurationQueryKeys.current(),
queryFn: getPromptConfiguration,
});


// Update promptText when data is loaded
useEffect(() => {
if (promptConfig && promptConfig.length > 0) {
setPromptText(promptConfig[0].prompt || '');
setIsUpdating(true);
}
}, [promptConfig]);

// Save prompt mutation
const saveMutation = useMutation({
mutationFn: savePromptConfiguration,
onSuccess: () => {
queryClient.invalidateQueries({ queryKey: promptConfigurationQueryKeys.current() });
toast.open({
type: ToastTypes.SUCCESS,
title: t('toast.success.title'),
message: t('promptConfigurations.submitSuccess'),
});
},
onError: (error: any) => {
console.error('Error saving prompt:', error);
toast.open({
type: ToastTypes.ERROR,
title: t('toast.error.title'),
message: t('promptConfigurations.submitError'),
});
},
});

const handleSubmit = () => {
if (!promptText.trim()) {
return;
}
saveMutation.mutate(promptText);
};

if (isLoading) {
return <CircularSpinner />;
}

return (
<div className="prompt-configurations">
<div className="container">
<div className="title_container">
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The class name in JSX is title_container (line 69) but the SCSS file defines .title-container with a hyphen (line 9). This naming mismatch will cause the styles not to be applied. The class name should be consistent between JSX and SCSS.

Suggested change
<div className="title_container">
<div className="title-container">

Copilot uses AI. Check for mistakes.
<div className="title">{t('promptConfigurations.title')}</div>
</div>

<div className="prompt-form">
<FormTextarea
label={t('promptConfigurations.promptLabel')}
name="promptText"
value={promptText}
onChange={(e) => setPromptText(e.target.value)}
minRows={10}
/>

<div className="form-actions">
<Button
appearance={ButtonAppearanceTypes.PRIMARY}
onClick={handleSubmit}
disabled={saveMutation.isLoading || !promptText.trim()}
>
{saveMutation.isLoading
Comment on lines +86 to +88
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The deprecated property isLoading is being used for both useQuery and useMutation. In newer versions of @tanstack/react-query (v4+), this property has been renamed to isPending for mutations. Consider updating to use isPending for the mutation or ensure the code is compatible with the version being used.

Suggested change
disabled={saveMutation.isLoading || !promptText.trim()}
>
{saveMutation.isLoading
disabled={saveMutation.isPending || !promptText.trim()}
>
{saveMutation.isPending

Copilot uses AI. Check for mistakes.
? (isUpdating ? t('promptConfigurations.updating') : t('promptConfigurations.saving'))
: (isUpdating ? t('promptConfigurations.updateButton') : t('promptConfigurations.submitButton'))
}
</Button>
</div>
</div>
</div>
</div>
);
};

export default PromptConfigurations;
23 changes: 23 additions & 0 deletions GUI/src/services/promptConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import apiDev from './api-dev';
import { promptConfigurationEndpoints } from 'utils/endpoints';

export interface PromptConfiguration {
id: number | null;
prompt: string;
}

export interface PromptConfigurationResponse {
response: PromptConfiguration[];
}

export const getPromptConfiguration = async (): Promise<PromptConfiguration[]> => {
const { data } = await apiDev.get(promptConfigurationEndpoints.GET_PROMPT_CONFIGURATION());
return data?.response || [];
};

export const savePromptConfiguration = async (prompt: string): Promise<PromptConfiguration[]> => {
const { data } = await apiDev.post(promptConfigurationEndpoints.SAVE_PROMPT_CONFIGURATION(), {
prompt,
});
return data?.response;
Comment on lines +18 to +22
Copy link

Copilot AI Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The return type of savePromptConfiguration is Promise<PromptConfiguration[]> but based on the Ruuter endpoint implementation, it returns a single object (either update_result.response.body[0] or insert_result.response.body[0]), not an array. The return type should be Promise<PromptConfiguration> to match the actual response structure.

Copilot uses AI. Check for mistakes.
};
5 changes: 5 additions & 0 deletions GUI/src/utils/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ export const vaultEndpoints = {
CREATE_VAULT_SECRET: (): string => `/rag-search/vault/secret/create`,
DELETE_VAULT_SECRET: (): string => `/rag-search/vault/secret/delete`,
}

export const promptConfigurationEndpoints = {
GET_PROMPT_CONFIGURATION: (): string => `/rag-search/prompt-configuration/get`,
SAVE_PROMPT_CONFIGURATION: (): string => `/rag-search/prompt-configuration/save`,
}
5 changes: 5 additions & 0 deletions GUI/src/utils/queryKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ export const inferenceQueryKeys = {
results: () => [...inferenceQueryKeys.all(), 'results'] as const,
result: (request: InferenceRequest) => [...inferenceQueryKeys.results(), request] as const,
};

export const promptConfigurationQueryKeys = {
all: () => ['prompt-configuration'] as const,
current: () => [...promptConfigurationQueryKeys.all(), 'current'] as const,
};
Loading
Loading