Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
26242b6
Add initial services table and custom types for service classification
Feb 5, 2026
bcb3437
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into…
Feb 5, 2026
25c2a41
prompt coniguration backend to be testing
nuwangeek Feb 6, 2026
25c1b23
custom prompt configuration update and fixed Pyright issues
nuwangeek Feb 9, 2026
5f31f45
fixed copilot reviews
nuwangeek Feb 9, 2026
e15958a
pre validation step added when user query is inserted
nuwangeek Feb 10, 2026
7ec8151
added more validation cases
nuwangeek Feb 10, 2026
29787de
fixed review comments
nuwangeek Feb 10, 2026
d1d8733
Merge pull request #113 from buerokratt/wip
nuwangeek Feb 10, 2026
ed26c07
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into…
Feb 10, 2026
72d06de
Merge branch 'bug-fixes/llm-282' into wip
nuwangeek Feb 10, 2026
f6c6dc7
Merge pull request #115 from buerokratt/wip
nuwangeek Feb 10, 2026
aaa52a3
Implement CRUD operations for services with soft delete functionality
Feb 11, 2026
a93cd93
address pr comments
Feb 12, 2026
1c65f10
Add unique index on service_id for improved lookup performance
Feb 12, 2026
7a05123
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into…
Feb 12, 2026
accdd7b
Merge pull request #116 from buerokratt/wip
nuwangeek Feb 13, 2026
152d8a0
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into…
Feb 13, 2026
b748bd8
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into…
Feb 13, 2026
7ddb508
Merge branch 'wip' of https://github.com/rootcodelabs/RAG-Module into…
Feb 13, 2026
3258d6b
Merge branch 'intents-db-schema' of https://github.com/rootcodelabs/R…
Feb 13, 2026
aa29002
Refactor service management SQL scripts and update YAML configuration…
Feb 13, 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
37 changes: 37 additions & 0 deletions DSL/Liquibase/changelog/rag-search-script-v6-services.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
-- changeset Erangi Ariyasena:rag-script-v6-changeset1

-- Custom types used:
CREATE TYPE ruuter_request_type AS ENUM ('GET', 'POST');
CREATE TYPE service_state AS ENUM ('active', 'inactive', 'draft');

CREATE TABLE public.services (
-- Primary key
id SERIAL PRIMARY KEY,

-- Basic service information
name TEXT NOT NULL,
description TEXT NOT NULL,
service_id TEXT NOT NULL UNIQUE,

-- Service classification
ruuter_type ruuter_request_type DEFAULT 'GET', -- ENUM: 'GET' or 'POST'
current_state service_state DEFAULT 'draft', -- ENUM: 'active', 'inactive', 'draft'
is_common BOOLEAN NOT NULL DEFAULT FALSE,

-- Intent classification data (for LLM)
slot TEXT NOT NULL DEFAULT '',
entities text[] NOT NULL DEFAULT '{}',
examples text[] NOT NULL DEFAULT '{}',

-- Service configuration
structure JSON NOT NULL DEFAULT '{}',
endpoints JSON NOT NULL DEFAULT '[]',

-- Timestamps
created_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP
);

-- Create index for unique service_id for faster lookups
CREATE UNIQUE INDEX idx_services_service_id ON public.services(service_id);

4 changes: 3 additions & 1 deletion DSL/Liquibase/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ databaseChangeLog:
- include:
file: changelog/rag-search-script-v4-authority-data.xml
- include:
file: changelog/rag-search-script-v5-prompt-config.sql
file: changelog/rag-search-script-v6-services.sql
- include:
file: changelog/rag-search-script-v5-prompt-config.sql
2 changes: 2 additions & 0 deletions DSL/Resql/rag-search/POST/delete-service.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DELETE FROM services
WHERE id = :id;
17 changes: 17 additions & 0 deletions DSL/Resql/rag-search/POST/get-service.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SELECT
id,
name,
description,
service_id,
ruuter_type,
current_state,
is_common,
slot,
entities,
examples,
structure,
endpoints,
created_at,
updated_at
FROM services
WHERE id = :id;
43 changes: 43 additions & 0 deletions DSL/Resql/rag-search/POST/insert-service.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
INSERT INTO services (
name,
description,
service_id,
ruuter_type,
current_state,
is_common,
slot,
entities,
examples,
structure,
endpoints,
created_at,
updated_at
) VALUES (
:name,
:description,
:service_id,
:ruuter_type::ruuter_request_type,
:current_state::service_state,
:is_common,
:slot,
ARRAY[:entities]::text[],
ARRAY[:examples]::text[],
:structure::json,
:endpoints::json,
:created_at::timestamp with time zone,
:updated_at::timestamp with time zone
) RETURNING
id,
name,
description,
service_id,
ruuter_type,
current_state,
is_common,
slot,
entities,
examples,
structure,
endpoints,
created_at,
updated_at;
30 changes: 30 additions & 0 deletions DSL/Resql/rag-search/POST/update-service.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
UPDATE services
SET
name = :name,
description = :description,
service_id = :service_id,
ruuter_type = :ruuter_type::ruuter_request_type,
current_state = :current_state::service_state,
is_common = :is_common,
slot = :slot,
entities = ARRAY[:entities]::text[],
examples = ARRAY[:examples]::text[],
structure = :structure::json,
endpoints = :endpoints::json,
updated_at = :updated_at::timestamp with time zone
WHERE id = :id
RETURNING
id,
name,
description,
service_id,
ruuter_type,
current_state,
is_common,
slot,
entities,
examples,
structure,
endpoints,
created_at,
updated_at;
107 changes: 107 additions & 0 deletions DSL/Ruuter.private/rag-search/POST/services/add.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
declaration:
call: declare
version: 0.1
description: "Add a new service"
method: post
accepts: json
returns: json
namespace: rag-search
allowlist:
body:
- field: name
type: string
description: "Service name"
- field: description
type: string
description: "Service description"
- field: service_id
type: string
description: "Unique service identifier"
- field: ruuter_type
type: string
description: "Ruuter request type (GET or POST)"
- field: current_state
type: string
description: "Service state (active, inactive, draft)"
- field: is_common
type: boolean
description: "Whether the service is common"
- field: slot
type: string
description: "Intent classification slot"
- field: entities
type: array
description: "Array of entities for intent classification"
- field: examples
type: array
description: "Array of example phrases for intent classification"
- field: structure
type: object
description: "Service configuration structure"
- field: endpoints
type: array
description: "Array of service endpoints"

extract_request_data:
assign:
name: ${incoming.body.name}
description: ${incoming.body.description}
service_id: ${incoming.body.service_id}
ruuter_type: ${incoming.body.ruuter_type || "GET"}
current_state: ${incoming.body.current_state || "draft"}
is_common: ${incoming.body.is_common || false}
slot: ${incoming.body.slot || ""}
entities: ${incoming.body.entities}
examples: ${incoming.body.examples}
structure: ${JSON.stringify(incoming.body.structure)}
endpoints: ${JSON.stringify(incoming.body.endpoints)}
created_at: ${new Date().toISOString()}
updated_at: ${new Date().toISOString()}
next: validate_required_fields

validate_required_fields:
switch:
- condition: "${!name || !description || !service_id}"
next: return_validation_error
next: insert_service

insert_service:
call: http.post
args:
url: "[#RAG_SEARCH_RESQL]/insert-service"
body:
name: ${name}
description: ${description}
service_id: ${service_id}
ruuter_type: ${ruuter_type}
current_state: ${current_state}
is_common: ${is_common}
slot: ${slot}
entities: ${entities}
examples: ${examples}
structure: ${structure}
endpoints: ${endpoints}
created_at: ${created_at}
updated_at: ${updated_at}
result: insert_result
next: handle_insert_response

handle_insert_response:
switch:
- condition: "${insert_result.response.statusCodeValue >= 400}"
next: return_error
next: return_success

return_success:
return: "Service created successfully"
next: end

return_validation_error:
status: 400
return: "Missing required fields: name, description, and service_id are required"
next: end

return_error:
status: 500
return: "Failed to create service"
next: end
74 changes: 74 additions & 0 deletions DSL/Ruuter.private/rag-search/POST/services/delete.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
declaration:
call: declare
version: 0.1
description: "Delete a service (soft delete)"
method: post
accepts: json
returns: json
namespace: rag-search
allowlist:
body:
- field: id
type: number
description: "Service ID"

extract_request_data:
assign:
id: ${Number(incoming.body.id)}
updated_at: ${new Date().toISOString()}
next: validate_id

validate_id:
switch:
- condition: "${!id}"
next: return_validation_error
next: check_service_exists

check_service_exists:
call: http.post
args:
url: "[#RAG_SEARCH_RESQL]/get-service"
body:
id: ${id}
result: existing_service
next: validate_service_exists

validate_service_exists:
switch:
- condition: "${existing_service.response.body.length > 0}"
next: delete_service
next: return_not_found

delete_service:
call: http.post
args:
url: "[#RAG_SEARCH_RESQL]/delete-service"
body:
id: ${id}
result: delete_result
next: handle_delete_response

handle_delete_response:
switch:
- condition: "${delete_result.response.statusCodeValue >= 400}"
next: return_error
next: return_success

return_success:
return: "Service deleted successfully"
next: end

return_validation_error:
status: 400
return: "Missing required field: id is required"
next: end

return_not_found:
status: 404
return: "Service not found"
next: end

return_error:
status: 500
return: "Failed to delete service"
next: end
Loading
Loading