Skip to content

fix(lightspeed): stop hardcoding vector_store_ids to product docs only#3626

Open
rajin-kichannagari wants to merge 2 commits into
redhat-developer:mainfrom
rajin-kichannagari:fix/byok-vector-store-ids
Open

fix(lightspeed): stop hardcoding vector_store_ids to product docs only#3626
rajin-kichannagari wants to merge 2 commits into
redhat-developer:mainfrom
rajin-kichannagari:fix/byok-vector-store-ids

Conversation

@rajin-kichannagari

Copy link
Copy Markdown
Contributor

Summary

The backend plugin was explicitly setting vector_store_ids to only the rhdh-product-docs vector store, which prevented BYOK RAG sources configured in rag.inline from being queried via inline RAG.

By removing this override, the lightspeed-stack uses its own rag.inline config to determine which stores to query, enabling multi-source RAG.

Context

When BYOK knowledge sources are configured in lightspeed-stack.yaml, the _fetch_byok_rag() function in lightspeed-stack filters the request's vector_store_ids against rag.inline. Since the plugin was only sending the product docs store ID, BYOK stores were always filtered out and inline RAG was silently skipped.

✔️ Checklist

  • A changeset describing the change and affected packages.
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

Rajin Kichannagari added 2 commits June 29, 2026 11:40
The backend plugin was explicitly setting vector_store_ids to only
the rhdh-product-docs vector store, which prevented BYOK (Bring Your
Own Knowledge) RAG sources from being queried via inline RAG.

By removing this override, the lightspeed-stack uses its own rag.inline
config to determine which stores to query, enabling multi-source RAG.
@rhdh-gh-app

rhdh-gh-app Bot commented Jun 29, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-lightspeed-backend workspaces/lightspeed/plugins/lightspeed-backend patch v2.9.1

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 52.93%. Comparing base (9881bf8) to head (5ae204f).
⚠️ Report is 7 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3626      +/-   ##
==========================================
+ Coverage   52.89%   52.93%   +0.04%     
==========================================
  Files        2324     2324              
  Lines       89087    89268     +181     
  Branches    24900    24999      +99     
==========================================
+ Hits        47122    47257     +135     
- Misses      41740    41787      +47     
+ Partials      225      224       -1     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.70% <ø> (ø) Carriedforward from 9881bf8
ai-integrations 67.95% <ø> (ø) Carriedforward from 9881bf8
app-defaults 69.79% <ø> (ø) Carriedforward from 9881bf8
augment 46.39% <ø> (ø) Carriedforward from 9881bf8
boost 74.35% <ø> (ø) Carriedforward from 9881bf8
bulk-import 72.46% <ø> (ø) Carriedforward from 9881bf8
cost-management 14.10% <ø> (ø) Carriedforward from 9881bf8
dcm 61.81% <ø> (ø) Carriedforward from 9881bf8
extensions 61.53% <ø> (ø) Carriedforward from 9881bf8
global-floating-action-button 71.18% <ø> (ø) Carriedforward from 9881bf8
global-header 59.71% <ø> (ø) Carriedforward from 9881bf8
homepage 49.84% <ø> (ø) Carriedforward from 9881bf8
install-dynamic-plugins 56.77% <ø> (ø) Carriedforward from 9881bf8
konflux 91.49% <ø> (ø) Carriedforward from 9881bf8
lightspeed 68.74% <ø> (+0.19%) ⬆️
mcp-integrations 85.46% <ø> (ø) Carriedforward from 9881bf8
orchestrator 37.11% <ø> (ø) Carriedforward from 9881bf8
quickstart 63.76% <ø> (ø) Carriedforward from 9881bf8
sandbox 79.56% <ø> (ø) Carriedforward from 9881bf8
scorecard 82.67% <ø> (ø) Carriedforward from 9881bf8
theme 61.26% <ø> (ø) Carriedforward from 9881bf8
translations 7.25% <ø> (ø) Carriedforward from 9881bf8
x2a 57.25% <ø> (ø) Carriedforward from 9881bf8

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9881bf8...5ae204f. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment on lines -604 to -616
// get the vector store id for the rhdh-product-docs vector store
if (lightspeed_vector_store_id === '') {
const vectorStores = await vectorStoresOperator.vectorStores.list();
lightspeed_vector_store_id =
vectorStores.data.find((v: any) =>
v.name.startsWith('rhdh-product-docs'),
)?.id || '';
}

if (lightspeed_vector_store_id !== '') {
request.body.vector_store_ids = [lightspeed_vector_store_id];
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@maysunfaisal @rajin-kichannagari Do we still need to get the vector store ID from the vector stores this way if the platform engineer does not use BYOK? If so, we might want to add some additional logic here to determine if this is a BYOK situation or not.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure we still need this explicit vector_store setup or otherwise Developer LIghtspeed tool will also query from Notebooks vector_store.

@maysunfaisal maysunfaisal Jun 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@JslYoon is that why it was introduced in the first place? We also need to remove this hardcoded vector store dependency because OKP also cannot function if we are calling LCORE with hardcoded vector store names 🤔

@JslYoon JslYoon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe we deliberately disabled rag.inline and only enabled tool.rag because the two conflicted and caused an infinite loop.


logger.info(`/v1/query receives call from user: ${userEntityRef}`);

// get the vector store id for the rhdh-product-docs vector store

@maysunfaisal maysunfaisal Jun 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to Claude,

The test fixture at fixtures/lcsHandlers.ts:281-282 mocks the vector stores endpoint returning rhdh-product-docs. Since the PR removes the code that calls that endpoint to look up the vector store
ID, this mock handler will just go unused — it won't break any tests, but it's now dead fixture code.

@maysunfaisal

maysunfaisal commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

@rajin-kichannagari This PR is still valid and addresses a concern for both BYOK and OKP. I shared some insights on the Slack thread. Maybe we can chat more about this on the Parking Lot or we can discuss on Slack.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants