From 5710a4d59d0dad624ff8265869fdddce07bdd5b4 Mon Sep 17 00:00:00 2001 From: enisn Date: Wed, 4 Mar 2026 12:46:28 +0300 Subject: [PATCH 1/3] Make workspace data source uploads configurable Update AI Management docs to describe configurable workspace data source upload options. Adds notes that allowed file extensions and max file size are configurable (default 10 MB), and that deleting a data source removes its embeddings, chunks, and blob. Introduces a new "Configuring Data Source Upload Options" section with a WorkspaceDataSourceOptions example (AllowedFileExtensions, MaxFileSize, ContentTypeMap), lists available properties and helper methods (GetMaxFileSizeDisplay, GetAllowedExtensionsDisplay, GetAcceptAttribute), and a note about registering content extractors for new file types. Also documents the WorkspaceDataSourceManager repository responsibility for full cleanup. --- docs/en/modules/ai-management/index.md | 59 ++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 4 deletions(-) diff --git a/docs/en/modules/ai-management/index.md b/docs/en/modules/ai-management/index.md index a7273e59dc..38693fc366 100644 --- a/docs/en/modules/ai-management/index.md +++ b/docs/en/modules/ai-management/index.md @@ -171,12 +171,16 @@ When a workspace has MCP servers associated, the AI model can invoke tools from Workspace Data Sources page is used to upload and manage RAG documents per workspace. Uploaded files are processed and indexed in the background. -* Supported file extensions: `.txt`, `.md`, `.pdf` -* Maximum file size: `10 MB` +* Supported file extensions: `.txt`, `.md`, `.pdf` (configurable) +* Maximum file size: `10 MB` (configurable) * Each uploaded file can be re-indexed individually or re-indexed in bulk per workspace +* Deleting a data source also removes its vector embeddings and document chunks > Access the page from workspace details, or navigate to `/AIManagement/WorkspaceDataSources?WorkspaceId={WorkspaceId}`. +> [!TIP] +> You can customize the allowed file extensions and maximum file size via `WorkspaceDataSourceOptions`. See [Configuring Data Source Upload Options](#configuring-data-source-upload-options) for details. + ## Workspace Configuration Workspaces are the core concept of the AI Management module. A workspace represents an AI provider configuration that can be used throughout your application. @@ -286,11 +290,16 @@ The AI Management module supports RAG (Retrieval-Augmented Generation), which en ### Supported File Formats +By default, the following file formats are supported: + * **PDF** (.pdf) * **Markdown** (.md) * **Text** (.txt) -Maximum file size: **10 MB**. +Default maximum file size: **10 MB**. + +> [!TIP] +> Both the allowed file extensions and the maximum file size are configurable via `WorkspaceDataSourceOptions`. See [Configuring Data Source Upload Options](#configuring-data-source-upload-options) for details. ### Prerequisites @@ -361,7 +370,7 @@ The module exposes workspace data source endpoints under `/api/ai-management/wor * `GET /by-workspace/{workspaceId}`: List data sources for a workspace. * `GET /{id}`: Get a data source. * `PUT /{id}`: Update data source metadata. -* `DELETE /{id}`: Delete data source and underlying blob. +* `DELETE /{id}`: Delete data source, its vector embeddings, document chunks, and underlying blob. * `GET /{id}/download`: Download original file. * `POST /{id}/reindex`: Re-index a single file. * `POST /workspace/{workspaceId}/reindex-all`: Re-index all files in a workspace. @@ -382,6 +391,47 @@ When workspace embedder or vector store configuration changes, AI Management aut * Deletes existing embeddings when embedder provider/model changes. * Re-queues all workspace data sources for re-indexing. +### Configuring Data Source Upload Options + +The `WorkspaceDataSourceOptions` class allows you to customize the file upload constraints for workspace data sources. You can configure the allowed file extensions, maximum file size, and content type mappings. + +```csharp +public override void ConfigureServices(ServiceConfigurationContext context) +{ + Configure(options => + { + // Add support for additional file types + options.AllowedFileExtensions = new[] { ".txt", ".md", ".pdf", ".docx", ".csv" }; + + // Increase the maximum file size to 50 MB + options.MaxFileSize = 50 * 1024 * 1024; + + // Add content type mappings for new extensions + options.ContentTypeMap[".docx"] = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"; + options.ContentTypeMap[".csv"] = "text/csv"; + }); +} +``` + +#### Available Properties + +| Property | Type | Default | Description | +| ----------------------- | ---------------------------- | -------------------------------------------- | ---------------------------------------------------------- | +| `AllowedFileExtensions` | `string[]` | `{ ".txt", ".md", ".pdf" }` | File extensions allowed for upload | +| `MaxFileSize` | `long` | `10485760` (10 MB) | Maximum file size in bytes | +| `ContentTypeMap` | `Dictionary` | `.txt`, `.md`, `.pdf` with their MIME types | Maps file extensions to MIME content types | + +The options class also provides helper methods: + +| Method | Description | +| ---------------------------- | -------------------------------------------------------------------- | +| `GetMaxFileSizeDisplay()` | Returns a human-readable size string (e.g., "10MB", "512KB") | +| `GetAllowedExtensionsDisplay()` | Returns a comma-separated display string (e.g., ".txt, .md, .pdf") | +| `GetAcceptAttribute()` | Returns a string for the HTML `accept` attribute (e.g., ".txt,.md,.pdf") | + +> [!NOTE] +> Adding new file extensions also requires a matching content extractor to be registered for document processing. The built-in extractors support `.txt`, `.md`, and `.pdf` files. + ## Permissions The AI Management module defines the following permissions: @@ -1239,6 +1289,7 @@ The following custom repositories are defined: - `VectorStoreInitializer`: Initializes vector store artifacts for newly configured workspaces. - `RagService`: Generates query embeddings and retrieves relevant chunks from vector stores. - `DocumentProcessingManager`: Extracts and chunks uploaded document contents. +- `WorkspaceDataSourceManager`: Manages data source lifecycle including file deletion with full cleanup (vector embeddings, document chunks, and blob storage). #### Integration Services From 2dee7d8252a91265b7978e9e179b5275ad411cf6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:36:30 +0000 Subject: [PATCH 3/3] docs: add @volo/ai-management NPM package requirement to ABP 10.2 migration guide Co-authored-by: EngincanV <43685404+EngincanV@users.noreply.github.com> --- .../release-info/migration-guides/abp-10-2.md | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/en/release-info/migration-guides/abp-10-2.md b/docs/en/release-info/migration-guides/abp-10-2.md index 6ba5b822ec..ac0b632c14 100644 --- a/docs/en/release-info/migration-guides/abp-10-2.md +++ b/docs/en/release-info/migration-guides/abp-10-2.md @@ -126,7 +126,25 @@ ABP now uses Angular's ARIA support for accessible tabs. Add the `@angular/aria` ## Pro -There are no breaking changes on the PRO side. However, if you use the Identity Pro module with Entity Framework Core, you need to make the following update: +There are no breaking changes on the PRO side. However, please check the following sections if they apply to your application. + +### Add `@volo/ai-management` NPM Package for MVC UI + +If you are using the MVC UI of the [AI Management Module](../../modules/ai-management.md), you need to add the `@volo/ai-management` package to your `package.json` file. This package was introduced in ABP v10.2 to support the enhanced markdown rendering on the chat playground. + +Add the following line to the `dependencies` section of your `package.json` file: + +```json +"@volo/ai-management": "10.2.0" +``` + +After adding the package, run the following command in the root directory of your web project: + +```bash +abp install-libs +``` + +Alternatively, you can run this command via ABP Studio. ### Add `UserInvitations` DbSet for Identity Pro EF Core DbContexts