pydo.genai.update_knowledge_base()

Generated on 7 Jul 2026 from pydo version v0.39.0

Usage

client.genai.update_knowledge_base(
    uuid="\"123e4567-e89b-12d3-a456-426614174000\"",
    body={
        "database_id": "\"12345678-1234-1234-1234-123456789012\"",
        "name": "\"My Knowledge Base\"",
        "project_id": "\"12345678-1234-1234-1234-123456789012\"",
        ...,
    },
)
Returns JSONRaises HttpResponseError

Description

To update a knowledge base, send a PUT request to /v2/gen-ai/knowledge_bases/{uuid}.

Parameters

uuid string required

Knowledge base id

database_id string optional

Example: "12345678-1234-1234-1234-123456789012"

The id of the DigitalOcean database this knowledge base will use, optional.

name string optional

Example: "My Knowledge Base"

Knowledge base name

project_id string optional

Example: "12345678-1234-1234-1234-123456789012"

The id of the DigitalOcean project this knowledge base will belong to

reranking_config object optional

Configuration for cross-encoder reranking during retrieval.

Show child properties
enabled boolean optional

Example: True

Whether reranking is enabled for retrieval

model string optional

Example: "bge-reranker-v2-m3"

Reranker model internal name

tags array of strings optional

Example: ['example string']

Tags to organize your knowledge base.

uuid string optional

Example: "12345678-1234-1234-1234-123456789012"

Knowledge base id

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "database_id": "\"12345678-1234-1234-1234-123456789012\"",
  "name": "\"My Knowledge Base\"",
  "project_id": "\"12345678-1234-1234-1234-123456789012\"",
  "reranking_config": {
    "enabled": True,
    "model": "\"bge-reranker-v2-m3\""
  },
  "tags": [
    "example string"
  ],
  "uuid": "\"12345678-1234-1234-1234-123456789012\""
}

resp = client.genai.update_knowledge_base(uuid="\"123e4567-e89b-12d3-a456-426614174000\"", body=req)

Response Example

Show Response Example
{
  "knowledge_base": {
    "added_to_agent_at": "2023-01-01T00:00:00Z",
    "created_at": "2023-01-01T00:00:00Z",
    "database_id": "123e4567-e89b-12d3-a456-426614174000",
    "embedding_model_uuid": "123e4567-e89b-12d3-a456-426614174000",
    "is_public": true,
    "last_indexing_job": {
      "completed_datasources": 123,
      "created_at": "2023-01-01T00:00:00Z",
      "data_source_jobs": [],
      "data_source_uuids": [
        "example string"
      ],
      "finished_at": "2023-01-01T00:00:00Z",
      "is_report_available": true,
      "knowledge_base_uuid": "123e4567-e89b-12d3-a456-426614174000",
      "phase": "BATCH_JOB_PHASE_UNKNOWN",
      "started_at": "2023-01-01T00:00:00Z",
      "status": "INDEX_JOB_STATUS_UNKNOWN",
      "tokens": 123,
      "total_datasources": 123,
      "total_tokens": "12345",
      "updated_at": "2023-01-01T00:00:00Z",
      "uuid": "123e4567-e89b-12d3-a456-426614174000"
    },
    "name": "example name",
    "project_id": "123e4567-e89b-12d3-a456-426614174000",
    "region": "example string",
    "reranking_config": {
      "enabled": true,
      "model": "\"bge-reranker-v2-m3\""
    },
    "tags": [
      "example string"
    ],
    "updated_at": "2023-01-01T00:00:00Z",
    "user_id": "12345",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  }
}

More Information

See /v2/gen-ai/knowledge_bases/{uuid} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.