Ai management rag enhancements #21816

Back

Summary

  • Rename the RAG tool to search_documents for clearer tool-calling behavior.
  • Fix data source deletion so cleanup is complete: vector embeddings + document chunks + blob are removed, preventing deleted files from appearing in search results.
  • Introduce WorkspaceDataSourceOptions to make upload validation configurable (allowed extensions, max file size, and content type mapping) instead of hardcoded values.

Technical Changes

  • WorkspaceDataSourceAppService.DeleteAsync now delegates deletion logic to WorkspaceDataSourceManager.DeleteAsync.
  • WorkspaceDataSourceManager.DeleteAsync now:
    • Deletes vector embeddings for processed data sources.
    • Gracefully skips vector cleanup when vector store provider is not configured/found.
    • Deletes document chunks, blob data, and the data source entity.
  • Upload validation/UI now use IOptions<WorkspaceDataSourceOptions> across:
    • Application service
    • Blazor workspace data source page
    • MVC upload modal
  • Localizations updated to parameterized values for:
    • AllowedFileTypes
    • MaxFileSize
  • Added/updated unit tests:
    • WorkspaceDataSourceManager_Tests
    • WorkspaceDataSourceOptions_Tests

How to Test

  1. Run automated tests:
    • dotnet test test/Volo.AIManagement.Domain.Tests
    • dotnet test test/Volo.AIManagement.Application.Tests
    • dotnet test test/Volo.AIManagement.EntityFrameworkCore.Tests
  2. Verify data source deletion cleanup:
    • Upload and index a data source in a workspace with vector store configured.
    • Confirm document search returns results from that file.
    • Delete the data source from UI.
    • Confirm document search no longer returns content from deleted file.
  3. Verify configurable upload options:
    • Configure WorkspaceDataSourceOptions with custom values (e.g., lower MaxFileSize and different extensions).
    • Confirm validation messages and UI accept behavior follow configured values.

Checklist

  • I fully tested it as developer / designer and created unit / integration tests
  • I documented it (or no need to document or I will create a separate documentation issue)
  • I worked with the design team to get their idea for UI/UX design (or no need to design for this PR)
  • I've assigned reviewer, related labels and set a milestone for this PR
Version
10.2.0-rc.2
Release Date
09 March, 2026
Labels
abp-module-ai-management enhancement
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.