Skip to content

fix(rag): use correct provider credentials and support local dev config sync - #1476

Merged
larryro merged 1 commit into
mainfrom
fix/rag-provider-config-sync
Apr 13, 2026
Merged

larryro merged 1 commit into
mainfrom
fix/rag-provider-config-sync

Conversation

@larryro

@larryro larryro commented Apr 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Embedding uses wrong API key in multi-provider setups: get_llm_config() was discarding the embedding provider's api_key and base_url, always using the chat provider's credentials for EmbeddingService. Fixed by adding embedding_api_key / embedding_base_url to the config dict and using them in both _do_initialize() and _maybe_refresh_clients().

  • Local dev config not syncing to RAG/crawler containers: When platform runs locally via bun dev, it writes provider config to examples/providers/ on the host. RAG/crawler containers were reading from the platform-data Docker named volume — a completely different filesystem. Fixed by parameterizing the shared config volume mount with ${PLATFORM_SHARED_CONFIG:-platform-data}. Set PLATFORM_SHARED_CONFIG=./examples in .env for local dev.

Test plan

  • Multi-provider: configure chat on provider A, embedding on provider B → verify RAG uses provider B's key for embeddings
  • Local dev: set PLATFORM_SHARED_CONFIG=./examples in .env, restart RAG/crawler, change API key in dashboard → verify RAG picks up the new key within 15s
  • Production: leave PLATFORM_SHARED_CONFIG unset → verify containers use platform-data named volume as before

Summary by CodeRabbit

Release Notes

  • New Features

    • Embedding services can now be configured independently with separate credentials and endpoints, enabling flexible provider selection.
  • Improvements

    • Deployment configuration is now more flexible through environment variable support for shared platform configuration.

…local dev config sync

Two fixes:

1. RAG embedding service now uses the embedding provider's own api_key and
   base_url instead of incorrectly reusing the chat provider's credentials.
   This fixes multi-provider setups where chat and embedding are on different
   providers.

2. compose.yml now uses ${PLATFORM_SHARED_CONFIG:-platform-data} for the
   shared config volume mount. In local dev (bun dev), set
   PLATFORM_SHARED_CONFIG=./examples in .env so RAG/crawler containers
   read provider config from the same directory the local platform writes to.
@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5e8929b8-53ba-44a7-8810-4c59fc6ad689

📥 Commits

Reviewing files that changed from the base of the PR and between 7844697 and 4867c02.

📒 Files selected for processing (3)
  • compose.yml
  • services/rag/app/config.py
  • services/rag/app/services/rag_service.py

📝 Walkthrough

Walkthrough

The changes introduce configurable embedding service credentials separate from the main LLM provider settings. The compose configuration now supports a PLATFORM_SHARED_CONFIG environment variable for the platform config volume mount. The RAG service's config.py exports embedding-specific API key and base URL fields, while rag_service.py is updated to initialize and refresh the EmbeddingService using these dedicated embedding credentials instead of the generic LLM credentials.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: fixing provider credential usage in RAG and supporting local dev config synchronization via environment variable configuration.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rag-provider-config-sync

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

@larryro
larryro merged commit f44e5e7 into main Apr 13, 2026
23 checks passed
@larryro
larryro deleted the fix/rag-provider-config-sync branch April 13, 2026 02:08
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.

1 participant