[ Web Proxy ]
URL:
Viewing: https://docs.digitalocean.com/reference/pydo/reference/genai/list_knowledge_bases/ [Back]  [Original]

pydo.genai.list_knowledge_bases() | DigitalOcean Documentation

For AI agents: The documentation index is at https://docs.digitalocean.com/llms.txt. Markdown versions of pages use the same URL with index.html.md in place of the HTML page (for example, append index.html.md to the directory path instead of opening the HTML document).

pydo.genai.list_knowledge_bases()

Generated on 3 Aug 2026 from pydo version v0.40.0

Copy page as Markdown View page as Markdown

Usage

client.genai.list_knowledge_bases(page=None, per_page=None)
Returns JSONRaises HttpResponseError

Description

To list all knowledge bases, send a GET request to /v2/gen-ai/knowledge_bases.

Parameters

page integer optional

Page number.

per_page integer optional

Items per page.

Pagination

This method returns paginated results. The response includes a links.pages object with URLs for navigating between pages. To retrieve the next page, parse the next URL and pass the page parameter:

from urllib.parse import urlparse, parse_qs

resp = client.genai.list_knowledge_bases()
pages = resp.get("links", {}).get("pages", {})

while "next" in pages:
    parsed = urlparse(pages["next"])
    page = int(parse_qs(parsed.query)["page"][0])
    resp = client.genai.list_knowledge_bases(page=page)
    pages = resp.get("links", {}).get("pages", {})

Response Example

Show Response Example
{
  "knowledge_bases": [
    {
      "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,
      "name": "example name",
      "project_id": "123e4567-e89b-12d3-a456-426614174000",
      "region": "example string",
      "tags": [
        "example string"
      ],
      "updated_at": "2023-01-01T00:00:00Z",
      "user_id": "12345",
      "uuid": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "links": {
    "pages": {
      "first": "example string",
      "last": "example string",
      "next": "example string",
      "previous": "example string"
    }
  },
  "meta": {
    "page": 123,
    "pages": 123,
    "total": 123
  }
}

More Information

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

In this article...


We can't find any results for your search.

Try using different keywords or simplifying your search terms.


Web Proxy Viewer  |  New URL  |  Original Page