Skip to main content
GenAI Toolkit is a private beta according to the Algolia Terms of Service (“Beta Services”).

Before you begin

To create a data source, you need the GenAI Toolkit feature in your Algolia plan, and an index with the product data you want to use for your GenAI applications.

Manage data sources with the dashboard

Create new data sources

  1. Go to the Algolia dashboard and select your Algolia .
  2. On the left sidebar, select Generative AI.
  3. Select Generative AI in the Algolia dashboard.
  4. On the left sidebar, select Data Sources.
  5. Click Create New Data Source. Screenshot of the 'Manage Data Sources' page with a table of data sources and a highlighted 'Create New Data Source' button.
  6. Enter a name for your data source. This will be used to easily identify your data sources later. Screenshot of the 'Create a Data Source' form with a text field labeled 'Data Source Name' and a placeholder 'Enter data source name'.
  7. Select one of your Algolia indices. Screenshot of a 'Create a Data Source' form with fields for 'Data Source Name' and 'Select an index,' and an 'Apply Filters' section.
  8. You can apply additional filters to your selected index to refine and enhance the relevance of your data source. You can view the changes in the preview section. Screenshot of the 'Create a Data Source' form with fields for name, index selection, and filter application.
  9. Once you are satisfied with your configuration, click Save Data Source. Screenshot of a 'Create a Data Source' form with a 'Save Data Source' button highlighted by an arrow.

Edit data sources

You can edit the details of your data sources directly in the Algolia dashboard. Start by selecting a data source from the table. Screenshot of a data sources table with columns: Name, Data Source ID, Index, Updated, and Responses. On the details screen, you can edit the name, change the selected index, or modify the filters. To save your changes, click Save Data Source.
Modifying a data source that you used for generating responses may impact those responses. Review and optionally regenerate the responses that depend on this data source.

Duplicate data sources

You can use one data source as a template for creating a new one. From the data source table, choose your base data source, click More and select Duplicate. Screenshot of a 'Manage Data Sources' page showing a table, search box, and a drop-down menu with 'Duplicate' and 'Delete Data Source' options. A new screen opens, pre-filled with the details from your base data source. You can edit the name, select a different index, or apply new filters. To save your changes, click Save Data Source button.

Delete data sources

To delete a data source in the dashboard, choose the data source you want to delete from the data source table, click More and select Delete. Screenshot of the 'Manage Data Sources' page showing a table with a drop-down menu open, highlighting the 'Delete Data Source' option in red.
Deleting a data source that was used for generating responses impacts those responses. You can choose how to handle this: you can either delete the data source and keep the responses that rely on it, or you can delete the associated responses together with the data source.

Manage data sources with the GenAI Toolkit API

You can manage your data sources with the GenAI Toolkit API.

Create a new data source

You need an API Key with the following ACLs: addObject, settings, editSettings.
Command line
curl -X POST https://generative-ai.algolia.com/create/data_source/ \
     -H 'Content-Type: application/json' \
     -H 'X-Algolia-Api-Key: $ALGOLIA_API_KEY' \
     -H 'X-Algolia-Application-ID: $ALGOLIA_APPLICATION_ID' \
     -d '{
        "name": "Phones",
        "source": "products",
        "filters": "category:\"phones\" AND price>500",
        "objectID": "b4e52d1a-2509-49ea-ba36-f6f5c3a83ba1",
     }'

Parameters

name
string
required
The name used to identify the data source.
source
string
required
The Algolia index used for retrieving contextual information.
filters
string
Filters used for further customizing the retrieval.Example:
JSON
{
  // ...
  "filters": "category:phones AND price>500"
}
objectID
string
A unique identifier used for storing the data source. If not provided, the API will automatically generate a new one.

Returns

In case of a success, the response is (HTTP status code 200):
JSON
{
  "objectID": "b4e52d1a-2509-49ea-ba36-f6f5c3a83ba1"
}
In case of an error, the response is:
JSON
{
  "name": "Error",
  "message": "Error saving the data source."
}

Update a data source

You need an API Key with the following ACLs: addObject, search.
Command line
curl -X POST https://generative-ai.algolia.com/update/data_source/ \
     -H 'Content-Type: application/json' \
     -H 'X-Algolia-Api-Key: $ALGOLIA_API_KEY' \
     -H 'X-Algolia-Application-ID: $ALGOLIA_APPLICATION_ID' \
     -d '{
        "name": "Phones",
        "source": "products",
        "filters": "category:\"phones\" AND price>500",
        "objectID": "b4e52d1a-2509-49ea-ba36-f6f5c3a83ba1",
     }'

Parameters

objectID
string
required
The ID of the data source to be updated.
filters
string
Filters used for further customizing the retrieval.Example:
JSON
{
  // ...
  "filters": "category:phones AND price>500"
}
name
string
The name used to identify the data source.
source
string
The Algolia index used for retrieving contextual information.

Returns

In case of a success, the response is (HTTP status code 200):
JSON
{
  "objectID": "b4e52d1a-2509-49ea-ba36-f6f5c3a83ba1"
}
In case of an error, the response is:
JSON
{
  "name": "Error",
  "message": "Error saving the data source."
}

Delete data sources

You need an API Key with the following ACLs: deleteObject, search.
Command line
curl -X POST https://generative-ai.algolia.com/delete/data_sources/ \
     -H 'Content-Type: application/json' \
     -H 'X-Algolia-Api-Key: $ALGOLIA_API_KEY' \
     -H 'X-Algolia-Application-ID: $ALGOLIA_APPLICATION_ID' \
     -d '{
        "objectIDs": ["b4e52d1a-2509-49ea-ba36-f6f5c3a83ba1"],
        "deleteLinkedResponses": false,
     }'

Parameters

objectIDs
string[]
required
List of IDs of the data sources to be deleted.
deleteLinkedResponses
boolean
default:false
Whether to delete responses linked to this data source.

Returns

In case of a success, the response is (HTTP status code 200):
JSON
{
  "message": "Successfully deleted data sources."
}
In case of an error, the response is:
JSON
{
  "name": "Error",
  "message": "Error when deleting the data source."
}
Last modified on March 23, 2026