Skip to content

feat: add DigitalOcean Create Knowledge Base component#3896

Draft
gaga1307 wants to merge 3 commits intomainfrom
feature/knowledgebase-management
Draft

feat: add DigitalOcean Create Knowledge Base component#3896
gaga1307 wants to merge 3 commits intomainfrom
feature/knowledgebase-management

Conversation

@gaga1307
Copy link
Copy Markdown
Collaborator

@gaga1307 gaga1307 commented Apr 1, 2026

Description

Adds a Create Knowledge Base component for the DigitalOcean Gradient AI Platform, allowing users to automate knowledge base creation for use with AI agents via RAG.

Component

  • Supports two data source types: Spaces Bucket (selected from dropdown, region inferred automatically) and Web/Sitemap URL (with crawling scope and nav link options)
  • Four chunking strategies: section-based (default), semantic, hierarchical, and fixed-length
  • OpenSearch database: create new or connect to an existing one

Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
@superplanehq-integration
Copy link
Copy Markdown

👋 Commands for maintainers:

  • /sp start - Start an ephemeral machine (takes ~30s)
  • /sp stop - Stop a running machine (auto-executed on pr close)

Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Unused ListKnowledgeBases function is dead code
    • Removed the unused exported ListKnowledgeBases method from the DigitalOcean client.
  • ✅ Fixed: Unused CreateKnowledgeBaseOutput type is dead code
    • Removed the unused exported CreateKnowledgeBaseOutput interface from the DigitalOcean workflow mapper types.

Create PR

Or push these changes by commenting:

@cursor push f4ce97b40e
Preview (f4ce97b40e)
diff --git a/pkg/integrations/digitalocean/client.go b/pkg/integrations/digitalocean/client.go
--- a/pkg/integrations/digitalocean/client.go
+++ b/pkg/integrations/digitalocean/client.go
@@ -2453,25 +2453,6 @@
 	return &response.KnowledgeBase, nil
 }
 
-// ListKnowledgeBases retrieves all knowledge bases in the account
-func (c *Client) ListKnowledgeBases() ([]KnowledgeBase, error) {
-	url := fmt.Sprintf("%s/gen-ai/knowledge_bases?per_page=200", c.BaseURL)
-	responseBody, err := c.execRequest(http.MethodGet, url, nil)
-	if err != nil {
-		return nil, err
-	}
-
-	var response struct {
-		KnowledgeBases []KnowledgeBase `json:"knowledge_bases"`
-	}
-
-	if err := json.Unmarshal(responseBody, &response); err != nil {
-		return nil, fmt.Errorf("error parsing response: %v", err)
-	}
-
-	return response.KnowledgeBases, nil
-}
-
 // AppNodeMetadata stores metadata about an app for display in the UI
 type AppNodeMetadata struct {
 	AppID   string `json:"appId" mapstructure:"appId"`

diff --git a/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts b/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts
--- a/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts
+++ b/web_src/src/pages/workflowv2/mappers/digitalocean/types.ts
@@ -255,14 +255,3 @@
   parentChunkSize?: number;
   childChunkSize?: number;
 }
-
-export interface CreateKnowledgeBaseOutput {
-  uuid?: string;
-  name?: string;
-  region?: string;
-  embeddingModelUUID?: string;
-  projectId?: string;
-  databaseId?: string;
-  tags?: string[];
-  createdAt?: string;
-}

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

}

return response.KnowledgeBases, nil
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unused ListKnowledgeBases function is dead code

Low Severity

ListKnowledgeBases is a new exported method added in this PR but has zero callers anywhere in the codebase. It's not referenced in list_resources.go, not used in create_knowledge_base.go, and not called from any other file. This is dead code that adds maintenance burden without providing value.

Fix in Cursor Fix in Web

databaseId?: string;
tags?: string[];
createdAt?: string;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unused CreateKnowledgeBaseOutput type is dead code

Low Severity

CreateKnowledgeBaseOutput is an exported interface that is never imported or referenced anywhere in the codebase. The mapper in create_knowledge_base.ts accesses output data using Record<string, unknown> casts instead. This is unused dead code.

Fix in Cursor Fix in Web

gaga1307 added 2 commits April 2, 2026 09:18
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
Signed-off-by: Dragica Draskic <dragica.draskic@gmail.com>
@gaga1307 gaga1307 marked this pull request as draft April 2, 2026 07:49
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.

2 participants