Skip to content

LCORE-1426: BYOK Config refactoring - #247

Open
are-ces wants to merge 1 commit into
lightspeed-core:mainfrom
are-ces:lcore-1426-byok-config-refactoring
Open

LCORE-1426: BYOK Config refactoring#247
are-ces wants to merge 1 commit into
lightspeed-core:mainfrom
are-ces:lcore-1426-byok-config-refactoring

Conversation

@are-ces

@are-ces are-ces commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Update the lightspeed-stack.yaml config templates generated by rag-content to match the unified RAG config format introduced in lightspeed-stack (LCORE-1426).

  • byok_rag: top-level section → rag.byok.stores
  • rag_type field → backend (faiss instead of inline::faiss, pgvector instead of remote::pgvector)
  • rag.tool: list → rag.retrieval.tool.sources
  • Updated README example YAML to reflect the new format
  • Updated unit test assertions accordingly

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement

Tools used to create PR

  • Assisted-by: Claude Opus 4.6
  • Generated by: Claude Opus 4.6

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • All 207 unit tests pass (make test-unit)
  • Verified generated YAML output matches the new lightspeed-stack schema: rag.byok.stores with backend field, rag.retrieval.tool.sources

Summary by CodeRabbit

  • New Features

    • Updated BYOK RAG configuration examples and templates to use the new store-based structure.
    • Added clearer configuration for vector store backends, embedding settings, database identifiers, and paths.
    • Updated retrieval source configuration to the latest layout.
  • Tests

    • Updated configuration validation to cover the new FAISS and pgvector formats.

… config format

Align config templates with the BYOK config refactoring in lightspeed-stack:
- byok_rag → rag.byok.stores
- rag_type → backend (faiss instead of inline::faiss, pgvector instead of remote::pgvector)
- rag.tool → rag.retrieval.tool.sources

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The BYOK RAG configuration changed from byok_rag and rag.tool to rag.byok.stores and rag.retrieval.tool.sources for FAISS and pgvector backends. README examples and Llama-Stack configuration tests were updated accordingly.

Changes

BYOK RAG schema update

Layer / File(s) Summary
Configuration templates and example
src/lightspeed_rag_content/config_templates.py, README.md
FAISS and pgvector templates and the README example now use nested stores, retrieval sources, embedding/vector settings, and backend-specific database fields.
Generated configuration assertions
tests/test_document_processor_llama_stack.py
Tests now validate the updated FAISS and pgvector configuration structure and fields.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: max-svistunov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: refactoring BYOK configuration.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 462-477: Update the db_path value in the README rag.byok.stores
example to use the generated configuration template format, including the
${env.RAG_DB_PATH:=...} environment-variable fallback around the existing
default path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c42fff80-3b30-404f-8170-f8b16706106c

📥 Commits

Reviewing files that changed from the base of the PR and between 032763f and d5cde1e.

📒 Files selected for processing (3)
  • README.md
  • src/lightspeed_rag_content/config_templates.py
  • tests/test_document_processor_llama_stack.py

Comment thread README.md
Comment on lines 462 to +477
rag:
# inline:
# - custom-docs-0_1
tool:
- custom-docs-0_1
byok:
stores:
- rag_id: custom-docs-0_1
backend: faiss
embedding_model: sentence-transformers/all-mpnet-base-v2
embedding_dimension: 768
vector_db_id: <generated-vector-store-id>
db_path: /home/<user>/rag-content/vector_db/custom_docs/0.1/faiss_store.db
retrieval:
# inline:
# sources:
# - custom-docs-0_1
tool:
sources:
- custom-docs-0_1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Update db_path in the example to match the generated template.

The generated configuration now wraps the db_path with an environment variable fallback (${env.RAG_DB_PATH:=...}). Please consider updating the example to accurately reflect the actual generated lightspeed-stack.yaml.

📝 Proposed fix
-        db_path: /home/<user>/rag-content/vector_db/custom_docs/0.1/faiss_store.db
+        db_path: ${env.RAG_DB_PATH:=/home/<user>/rag-content/vector_db/custom_docs/0.1/faiss_store.db}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
rag:
# inline:
# - custom-docs-0_1
tool:
- custom-docs-0_1
byok:
stores:
- rag_id: custom-docs-0_1
backend: faiss
embedding_model: sentence-transformers/all-mpnet-base-v2
embedding_dimension: 768
vector_db_id: <generated-vector-store-id>
db_path: /home/<user>/rag-content/vector_db/custom_docs/0.1/faiss_store.db
retrieval:
# inline:
# sources:
# - custom-docs-0_1
tool:
sources:
- custom-docs-0_1
rag:
byok:
stores:
- rag_id: custom-docs-0_1
backend: faiss
embedding_model: sentence-transformers/all-mpnet-base-v2
embedding_dimension: 768
vector_db_id: <generated-vector-store-id>
db_path: ${env.RAG_DB_PATH:=/home/<user>/rag-content/vector_db/custom_docs/0.1/faiss_store.db}
retrieval:
# inline:
# sources:
# - custom-docs-0_1
tool:
sources:
- custom-docs-0_1
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@README.md` around lines 462 - 477, Update the db_path value in the README
rag.byok.stores example to use the generated configuration template format,
including the ${env.RAG_DB_PATH:=...} environment-variable fallback around the
existing default path.

@syedriko

Copy link
Copy Markdown
Collaborator

/ok-to-test

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.

2 participants