Skip to content

Llm reindex services - #1168

Open
ruwinirathnamalala wants to merge 3 commits into
buerokratt:v3.3.3from
rootcodelabs:llm-reinex-service
Open

Llm reindex services#1168
ruwinirathnamalala wants to merge 3 commits into
buerokratt:v3.3.3from
rootcodelabs:llm-reinex-service

Conversation

@ruwinirathnamalala

Copy link
Copy Markdown
Collaborator

#1164

Overview

Implements a manual LLM re-index flow for services, mirroring the existing endpoint re-index flow, and fixes the service activation flow so it correctly triggers LLM enrichment with proper status tracking. Changes span a Liquibase database migration, a new Resql SQL query, and Ruuter DSL flows.

Liquibase Migrations (DSL/Liquibase/)

Migration Change
20260907120000_add-llm-index-status-to-services Adds llm_index_status column to the services table, reusing the llm_index_status enum type (SUCCESS, IN_PROGRESS, FAILED) already introduced for endpoints

Includes rollback script.

Resql (DSL/Resql/services/POST/services/)

update_service_llm_sync_status.sql (new)

Updates a service's llm_index_status by service_id.

Ruuter (DSL/Ruuter/services/POST/services/)

reindex-service.yml (new)

Public entry point for manual re-index (POST /services/services/reindex-service):

  • Fetches the service by serviceId and validates it exists and is active before proceeding
    • 400 if serviceId is missing
    • 404 if the service doesn't exist
    • 400 "Service is not active, LLM indexing skipped" if the service isn't active
  • Passes the already-fetched service fields (name, description, examples, entities, type, state, isCommon) to service-index-llm, avoiding a redundant DB fetch inside it
  • On indexing failure, marks the service's sync status FAILED and returns 500

service-index-llm.yml (new)

Internal indexing flow (POST /services/services/service-index-llm), called by both reindex-service and status.yml (service activation):

  • Marks the service IN_PROGRESS
  • Calls [#LLM_RUUTER_PUBLIC]/services/enrich with the mapped payload (service_id, name, description, examples, entities, ruuter_type, current_state, is_common)
  • Marks SUCCESS or FAILED based on the enrich response

status.yml (modified)

The existing "activate service → enrich in LLM" call was pointed at the wrong URL and used a stale field-naming contract, so LLM enrichment silently failed on every activation:

  • call_llm_enrich → renamed to call_llm_index, now calls [#SERVICE_RUUTER]/services/service-index-llm (routing through the new tracked flow) instead of hitting [#LLM_RUUTER_PUBLIC]/services/enrich directly — activation now gets the same status tracking as manual re-index
  • Field names aligned to the new contract: service_idserviceId, ruuter_typetype, current_statestate, is_commonisCommon
  • Forwards the caller's cookie header, required by the internal call's auth guard

@ruwinirathnamalala ruwinirathnamalala linked an issue Sep 8, 2026 that may be closed by this pull request
15 tasks
@sonarqubecloud

sonarqubecloud Bot commented Sep 8, 2026

Copy link
Copy Markdown

@ruwinirathnamalala ruwinirathnamalala changed the title Llm reinex service Llm reindex services Sep 8, 2026
@matKlju
matKlju requested a review from 1AhmedYasser September 9, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Service indexing from Service Module to LLM Module

1 participant