{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"To create a knowledge base, send a POST request to `/v2/gen-ai/knowledge_bases`.","properties":{"body":{"$ref":"#/definitions/apiCreateKnowledgeBaseInputPublic"}},"required":[],"additionalProperties":false,"definitions":{"apiCreateKnowledgeBaseInputPublic":{"description":"Data to create a new knowledge base.","properties":{"database_id":{"description":"Identifier of the DigitalOcean OpenSearch database this knowledge base will use, optional.\nIf not provided, we create a new database for the knowledge base in\nthe same region as the knowledge base.","type":"string","examples":["\"12345678-1234-1234-1234-123456789012\""]},"datasources":{"description":"Optional data sources to attach at creation. Omit or use an empty list to create the knowledge base without sources, then add sources (with chunking strategy and sizes) using [Add a Data Source to a Knowledge Base](#operation/create_knowledge_base_data_source). When provided, see [Organize Data Sources](https://docs.digitalocean.com/products/inference/how-to/create-manage-agent-knowledge-bases/#add-data-sources) for best practices.","items":{"$ref":"#/definitions/apiKBDataSource"},"type":"array"},"embedding_model_uuid":{"description":"Identifier for the [embedding model](https://docs.digitalocean.com/products/genai-platform/details/models/#embedding-models).","type":"string","examples":["\"12345678-1234-1234-1234-123456789012\""]},"name":{"description":"Name of the knowledge base.","type":"string","examples":["\"My Knowledge Base\""]},"project_id":{"description":"Identifier of the DigitalOcean project this knowledge base will belong to.","type":"string","examples":["\"12345678-1234-1234-1234-123456789012\""]},"region":{"description":"The datacenter region to deploy the knowledge base in.","type":"string","examples":["\"tor1\""]},"reranking_config":{"$ref":"#/definitions/apiRerankingConfiguration"},"size":{"$ref":"#/definitions/apiOpenSearchPlanSize"},"tags":{"description":"Tags to organize your knowledge base.","items":{"type":"string","examples":["example string"]},"type":"array","examples":[["example string"]]},"vpc_uuid":{"description":"The VPC to deploy the knowledge base database in","type":"string","examples":["\"12345678-1234-1234-1234-123456789012\""]}},"type":"object"},"apiKBDataSource":{"properties":{"aws_data_source":{"$ref":"#/definitions/apiAWSDataSource"},"bucket_name":{"description":"Deprecated, moved to data_source_details","type":"string","examples":["example name"]},"bucket_region":{"description":"Deprecated, moved to data_source_details","type":"string","examples":["example string"]},"chunking_algorithm":{"$ref":"#/definitions/apiChunkingAlgorithm"},"chunking_options":{"$ref":"#/definitions/apiChunkingOptions"},"dropbox_data_source":{"$ref":"#/definitions/apiDropboxDataSource"},"file_upload_data_source":{"$ref":"#/definitions/apiFileUploadDataSource"},"google_drive_data_source":{"$ref":"#/definitions/apiGoogleDriveDataSource"},"item_path":{"type":"string","examples":["example string"]},"spaces_data_source":{"$ref":"#/definitions/apiSpacesDataSource"},"web_crawler_data_source":{"$ref":"#/definitions/apiWebCrawlerDataSource"}},"type":"object"},"apiRerankingConfiguration":{"description":"Configuration for cross-encoder reranking during retrieval.","properties":{"enabled":{"description":"Whether reranking is enabled for retrieval","type":"boolean","examples":[true]},"model":{"description":"Reranker model internal name","type":"string","examples":["\"bge-reranker-v2-m3\""]}},"type":"object"},"apiOpenSearchPlanSize":{"default":"OPEN_SEARCH_PLAN_SIZE_UNSPECIFIED","enum":["OPEN_SEARCH_PLAN_SIZE_UNSPECIFIED","OPEN_SEARCH_PLAN_SIZE_SMALL","OPEN_SEARCH_PLAN_SIZE_MEDIUM","OPEN_SEARCH_PLAN_SIZE_LARGE","OPEN_SEARCH_PLAN_SIZE_EXTRA_LARGE"],"type":"string","examples":["OPEN_SEARCH_PLAN_SIZE_UNSPECIFIED"]},"apiAWSDataSource":{"description":"AWS S3 Data Source","properties":{"bucket_name":{"description":"Spaces bucket name","type":"string","examples":["example name"]},"item_path":{"type":"string","examples":["example string"]},"key_id":{"description":"The AWS Key ID","type":"string","examples":["123e4567-e89b-12d3-a456-426614174000"]},"region":{"description":"Region of bucket","type":"string","examples":["example string"]},"secret_key":{"description":"The AWS Secret Key","type":"string","examples":["example string"]}},"type":"object"},"apiChunkingAlgorithm":{"default":"CHUNKING_ALGORITHM_UNKNOWN","enum":["CHUNKING_ALGORITHM_UNKNOWN","CHUNKING_ALGORITHM_SECTION_BASED","CHUNKING_ALGORITHM_HIERARCHICAL","CHUNKING_ALGORITHM_SEMANTIC","CHUNKING_ALGORITHM_FIXED_LENGTH"],"type":"string","examples":["CHUNKING_ALGORITHM_UNKNOWN"]},"apiChunkingOptions":{"properties":{"child_chunk_size":{"type":"integer","examples":[350]},"max_chunk_size":{"description":"Common options","type":"integer","examples":[750]},"parent_chunk_size":{"description":"Hierarchical options","type":"integer","examples":[1000]},"semantic_threshold":{"description":"Semantic options","type":"number","examples":[0.5]}},"type":"object"},"apiDropboxDataSource":{"description":"Dropbox Data Source","properties":{"folder":{"type":"string","examples":["example string"]},"refresh_token":{"description":"Refresh token. you can obrain a refresh token by following the oauth2 flow. see /v2/gen-ai/oauth2/dropbox/tokens for reference.","type":"string","examples":["example string"]}},"type":"object"},"apiFileUploadDataSource":{"description":"File to upload as data source for knowledge base.","properties":{"original_file_name":{"description":"The original file name","type":"string","examples":["example name"]},"size_in_bytes":{"description":"The size of the file in bytes","type":"string","examples":["12345"]},"stored_object_key":{"description":"The object key the file was stored as","type":"string","examples":["example string"]}},"type":"object"},"apiGoogleDriveDataSource":{"description":"Google Drive Data Source","properties":{"folder_id":{"type":"string","examples":["123e4567-e89b-12d3-a456-426614174000"]},"refresh_token":{"description":"Refresh token. you can obrain a refresh token by following the oauth2 flow. see /v2/gen-ai/oauth2/google/tokens for reference.","type":"string","examples":["example string"]}},"type":"object"},"apiSpacesDataSource":{"description":"Spaces Bucket Data Source","properties":{"bucket_name":{"description":"Spaces bucket name","type":"string","examples":["example name"]},"item_path":{"type":"string","examples":["example string"]},"region":{"description":"Region of bucket","type":"string","examples":["example string"]}},"type":"object"},"apiWebCrawlerDataSource":{"description":"WebCrawlerDataSource","properties":{"base_url":{"description":"The base url to crawl.","type":"string","examples":["example string"]},"crawling_option":{"$ref":"#/definitions/apiCrawlingOption"},"embed_media":{"description":"Whether to ingest and index media (images, etc.) on web pages.","type":"boolean","examples":[true]},"exclude_tags":{"description":"Declaring which tags to exclude in web pages while webcrawling","items":{"type":"string","examples":["example string"]},"type":"array","examples":[["example string"]]}},"type":"object"},"apiCrawlingOption":{"default":"UNKNOWN","description":"Options for specifying how URLs found on pages should be handled.\n\n - UNKNOWN: Default unknown value\n - SCOPED: Only include the base URL.\n - PATH: Crawl the base URL and linked pages within the URL path.\n - DOMAIN: Crawl the base URL and linked pages within the same domain.\n - SUBDOMAINS: Crawl the base URL and linked pages for any subdomain.\n - SITEMAP: Crawl URLs discovered in the sitemap.","enum":["UNKNOWN","SCOPED","PATH","DOMAIN","SUBDOMAINS","SITEMAP"],"type":"string","examples":["UNKNOWN"]}}},"name":"Create a Knowledge Base","id":"digitalocean.genai_create_knowledge_base","example":{},"maxRequests":1,"summary":false}}