Open Closed

AI Management: a workspace with an empty Embedder Provider ('') still adds the search_documents RAG tool to every chat call #10901


User avatar
0
AyazNaseer created

Version: ABP 10.3.0, Volo.AIManagement 10.3.0, Blazor Server, EF Core / SQL Server

Description A workspace without any embedder or vector store still gets the RAG tool on every chat request. As a result, the model often calls search_documents, the tool answers that no embedding provider is configured, and the whole prompt (including attachments) is sent to the model a second time.

Steps to reproduce

Create a workspace in the AI Management UI (OpenAI chat provider) and leave Embedder Provider and Vector Store Provider empty. Save it. In the database, EmbedderProvider and VectorStoreProvider are stored as '' (empty string), not NULL. Send a chat request through this workspace, for example via IChatClientResolver or IAIChatCompletionIntegrationService.

Expected

No RAG tool and no extra system instruction, because the workspace has no embedder.

Actual

AIManagementChatClient.PrepareOptionsAsync adds a search_documents tool (tool_choice = auto) and a system instruction to always call search_documents first. The model calls the tool, which replies that the embedding provider is not configured, and the request is sent again.

In our measurement, a request of about 186K prompt tokens was billed as about 372K. This doubles cost and rate-limit (HTTP 429) pressure.

Cause (version 10.3.0)

Two checks disagree on what "configured" means:

WorkspaceConfigurationStore: HasEmbedderConfiguration = EmbedderProvider != null, so '' counts as configured. DocumentSearchService: uses string.IsNullOrWhiteSpace(...), so '' counts as not configured. The Workspaces page saves empty fields as '', so a workspace edited in the UI can never be stored as NULL.

Suggested fix

Use !string.IsNullOrWhiteSpace(EmbedderProvider) in WorkspaceConfigurationStore, and/or normalise empty provider fields to NULL when saving a workspace.

Workaround Set the columns to NULL directly in the database. Editing the workspace in the UI afterwards brings the problem back.

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

No answer yet!
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.