How do I schedule automatic reindexing for my knowledge bases?

Validated on 8 Jul 2025 • Last edited on 8 Jul 2025

You can create a scheduled function to automatically reindex your knowledge base on a schedule you choose.

For example, you can use the following Python script, which triggers a reindex usin gPyDo’s create_indexing_job():

from pydo import Client
import os

c = Client(os.getenv("DO_API_KEY"))
c.genai.create_indexing_job(body={
  "knowledge_base_uuid": "KB UUID",
  "data_source_uuids": ["DS UUID"]  # optional, reindexes all data sources if not specified
})

You can also write your own function that sends a POST request to the indexing jobs API endpoint.

Learn More

How to Schedule Functions

Schedule functions to run periodically.

DigitalOcean API Reference

Complete reference documentation for the DigitalOcean API, including request samples in cURL, Python, Go, and Ruby.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.