feat(storage): add multi-instance storage backends per workspace

Introduce tenant-scoped storage backend registry so workspaces can register
multiple storage instances and bind each knowledge base to a specific backend,
with migration from legacy tenant-level storage config and new settings UI.
This commit is contained in:
wizardchen
2026-07-15 13:26:29 +08:00
committed by lyingbug
parent 139ec1e6b8
commit f8b3e5f148
58 changed files with 2863 additions and 470 deletions
+6 -3
View File
@@ -27,9 +27,10 @@ type Handler struct {
agentShareService interfaces.AgentShareService // Service for resolving shared agents (KB scope in retrieval)
kbShareService interfaces.KBShareService // Service for resolving shared KB permissions
fileService interfaces.FileService // Service for file storage (image uploads)
modelService interfaces.ModelService // Service for model management (VLM access)
userService interfaces.UserService // Service for resolving per-user preferences (e.g. enable_memory default)
attachmentProcessor *AttachmentProcessor // Processor for file attachments
storageResolver interfaces.StorageBackendResolver
modelService interfaces.ModelService // Service for model management (VLM access)
userService interfaces.UserService // Service for resolving per-user preferences (e.g. enable_memory default)
attachmentProcessor *AttachmentProcessor // Processor for file attachments
}
// NewHandler creates a new instance of Handler with all necessary dependencies
@@ -45,6 +46,7 @@ func NewHandler(
agentShareService interfaces.AgentShareService,
kbShareService interfaces.KBShareService,
fileService interfaces.FileService,
storageResolver interfaces.StorageBackendResolver,
modelService interfaces.ModelService,
userService interfaces.UserService,
documentReader interfaces.DocumentReader,
@@ -62,6 +64,7 @@ func NewHandler(
agentShareService: agentShareService,
kbShareService: kbShareService,
fileService: fileService,
storageResolver: storageResolver,
modelService: modelService,
userService: userService,
attachmentProcessor: NewAttachmentProcessor(