Skip to content

Conversation

@ysmoradi
Copy link
Member

@ysmoradi ysmoradi commented Dec 23, 2025

closes #11916

Summary by CodeRabbit

  • New Features

    • Added PostgreSQL vector database support with enhanced JSON handling capabilities.
  • Configuration

    • Updated embedding service endpoints to use local URLs for development environments.
    • Removed local embedding service fallback, requiring explicit configuration.
    • Added configuration documentation for setup guidance.
  • Chores

    • Removed unused package dependencies and improved setup documentation.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 23, 2025

Walkthrough

Removes the SmartComponents.LocalEmbeddings.SemanticKernel NuGet dependency from the boilerplate project across package configuration and project files. Updates service registration to remove the fallback local embedding generator and reconfigures HuggingFace embedding endpoints to point to a local inference service at http://localhost:7000.

Changes

Cohort / File(s) Summary
Package Dependency Removal
src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props, src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Boilerplate.Server.Api.csproj
Removed central package version entry and project-level PackageReference for SmartComponents.LocalEmbeddings.SemanticKernel
Service Configuration
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs
Removed fallback LocalTextEmbeddingGenerationService registration; added PostgreSQL vector support via dataSourceBuilder.UseVector() and EnableDynamicJson(); commented out related using directives
Embedding Endpoint Configuration
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json, src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/appsettings.json
Updated HuggingFace EmbeddingEndpoint from null to http://localhost:7000; added descriptive comment for local Docker setup in API configuration
Realm Configuration
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Realms/dev-realm.json
Added top-level Comment field describing dev realm configuration

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A package goes, a docker comes, \
Local embeddings now hum, hum, hum! \
From SmartComponents to inference so sleek, \
Vector support peaks and squeaks—purr, purr, squeak! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed The PR successfully replaces SmartComponents.LocalEmbeddings.SemanticKernel with text-embeddings-inference:cpu-1.6 by removing package dependencies, removing fallback embedding generator code, and updating endpoint configurations to use local URL (http://localhost:7000), fulfilling issue #11916 requirements.
Out of Scope Changes check ✅ Passed All changes directly support the replacement objective: package removal from Directory.Packages.props and csproj, code changes to Program.Services.cs for PostgreSQL vector support, and endpoint configuration updates align with the migration to text-embeddings-inference.
Title check ✅ Passed The PR title clearly describes the main change: replacing SmartComponents.LocalEmbeddings.SemanticKernel with text-embeddings-inference:cpu-1.8, which aligns with the file changes removing the package and updating embedding configuration.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

@ysmoradi ysmoradi marked this pull request as ready for review December 23, 2025 14:44
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs (1)

494-503: Add validation for embedding service configuration to prevent startup failures.

The fallback LocalTextEmbeddingGenerationService has been removed, creating a hard dependency on one of three external embedding services (OpenAI, AzureOpenAI, or HuggingFace). However, if none of these services are configured, the IEmbeddingGenerator dependency in ProductEmbeddingService will fail to resolve at startup or when the service is injected, resulting in a DependencyInjectionException rather than a clear error message.

The error handling in ProductEmbeddingService (lines 26-27, 61-62) only addresses the case where embeddings are registered but disabled via AppDbContext.IsEmbeddingEnabled. There is no validation in Program.Services.cs to warn users if none of the three external embedding services are configured.

Add an explicit check after the if-else-if chain to validate that at least one embedding service is configured, with a clear exception message guiding users to configure one of the three supported services.

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3c8d959 and 84add8c.

📒 Files selected for processing (6)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Boilerplate.Server.Api.csproj
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.AppHost/Realms/dev-realm.json
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Web/appsettings.json
💤 Files with no reviewable changes (2)
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.props
  • src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Boilerplate.Server.Api.csproj
🔇 Additional comments (3)
src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs (2)

8-11: LGTM: Conditional compilation directives properly restructured.

The using directive for Npgsql is now correctly placed within the PostgreSQL conditional compilation block, which is necessary for the vector extension support added later in the file.


281-288: LGTM: PostgreSQL vector support properly configured.

The PostgreSQL data source builder is correctly configured with:

  • UseVector() to enable pgvector extension support
  • EnableDynamicJson() for dynamic JSON handling
  • The EF Core options properly call UseVector() on the database options

This configuration is essential for the vector embedding operations that will use the new text-embeddings-inference service.

src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/appsettings.json (1)

67-68: Documentation quality confirmed with verified compatibility.

The EmbeddingModel__Comment provides clear setup instructions, and verification confirms both points:

  1. HuggingFaceEmbeddingGenerator accepts the Uri endpoint format directly (Program.Services.cs:496), making it fully compatible with the self-hosted TEI service.
  2. BAAI/bge-small-en-v1.5 produces 384-dimensional embeddings, which matches the vector database schema configured as vector(384) (ProductConfiguration.cs:22).

Signed-off-by: Yas Moradi <ysmoradi@outlook.com>
@ysmoradi ysmoradi changed the title Replace bit Boilerplate's SmartComponents.LocalEmbeddings.SemanticKernel with text-embeddings-inference:cpu-1.6 (#11916) Replace bit Boilerplate's SmartComponents.LocalEmbeddings.SemanticKernel with text-embeddings-inference:cpu-1.8 (#11916) Dec 23, 2025
@ysmoradi ysmoradi merged commit c46c9ed into bitfoundation:develop Dec 23, 2025
3 checks passed
@ysmoradi ysmoradi deleted the 11916 branch December 23, 2025 16:54
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.

bit Boilerplate's SmartComponents.LocalEmbeddings.SemanticKernel must be replaced with text-embeddings-inference:cpu-1.8

1 participant