Skip to content

Notify LLM on endpoint create/update#1005

Merged
ffrose merged 10 commits into
buerokratt:devfrom
rootcodelabs:990/notify_LLM_about_endpoints
May 19, 2026
Merged

Notify LLM on endpoint create/update#1005
ffrose merged 10 commits into
buerokratt:devfrom
rootcodelabs:990/notify_LLM_about_endpoints

Conversation

@ruwinirathnamalala
Copy link
Copy Markdown
Collaborator

#990

Overview

Integrates LLM RAG (Retrieval-Augmented Generation) indexing into the endpoint lifecycle. When an endpoint is created or updated, its data is automatically sent to the LLM api-tools indexing service.

Changes

Liquibase

  • 20260513120000_add-is-llm-synced-to-endpoints.xml/sql — New migration that adds an is_llm_synced BOOLEAN column to the endpoints table to track whether each endpoint has been successfully indexed by the LLM.
  • ..._rollback.sql — Rollback script that drops the is_llm_synced column.

Resql

  • get_endpoint_by_id.sql — New query that retrieves a single endpoint's details (name, description, selected URL, HTTP method, and parameters) by resolving the isSelected definition entry. Used by the LLM indexing flow to build the indexing payload.
  • update_endpoint_llm_sync_status.sql — New query that updates the is_llm_synced flag on an endpoint to true (success) or false (failure) after an indexing attempt.

Ruuter

  • index-llm.yml (new) — Standalone POST endpoint that orchestrates the full LLM indexing flow for a given endpointId:
    1. Validates the input.
    2. Fetches endpoint details via Resql.
    3. Calls LLM_RUUTER_PUBLIC /api-tools/index with the endpoint payload.
    4. Updates is_llm_synced based on the LLM response (success → true, failure/not-found → false).
    5. Returns appropriate HTTP status codes (200, 400, 404, 502).
  • create-endpoint.yml — Updated to call the index-llm flow after a successful endpoint creation.
  • update-endpoint.yml — Updated to call the index-llm flow after a successful endpoint update.

Configuration

  • constants.ini — Added LLM_RUUTER_PUBLIC=http://ruuter-public:8086/rag-search to configure the LLM service base URL.

@matKlju matKlju linked an issue May 14, 2026 that may be closed by this pull request
9 tasks
@matKlju matKlju requested a review from Thirunayan22 May 14, 2026 12:51

const initialHistoryState = {
nodes: JSON.parse(JSON.stringify(nodes)),
edges: JSON.parse(JSON.stringify(edges)),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The structuredClone approach failed with DataCloneError because flow nodes contain function references (onDelete, onEdit, setClickedNode, update), which cannot be cloned by the structured clone algorithm. The JSON.parse(JSON.stringify()) method is used here to strip functions from nodes before saving to history, which are then manually re-attached during undo/redo operations.


const currentState = stateOverride
? {
nodes: JSON.parse(JSON.stringify(stateOverride.nodes)),
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The structuredClone approach failed with DataCloneError because flow nodes contain function references (onDelete, onEdit, setClickedNode, update), which cannot be cloned by the structured clone algorithm. The JSON.parse(JSON.stringify()) method is used here to strip functions from nodes before saving to history, which are then manually re-attached during undo/redo operations.

@sonarqubecloud
Copy link
Copy Markdown

@ffrose ffrose merged commit f5194b9 into buerokratt:dev May 19, 2026
6 of 8 checks passed
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.

Notify LLM on endpoint create/update

3 participants