Concept | API query enrichments#

Watch the video

Let’s discuss API query enrichment in Dataiku.

Definition#

In some cases, an API request to an endpoint won’t include all features required for processing the request. In such cases, a query enrichment may be able to retrieve the additional features needed for the endpoint to process the request. By performing a lookup on another table, the enrichment enables a valid response.

Slide depicting the concept of query enrichment.

Example#

In a credit card fraud detection use case, at the time of the transaction, the client making the API request could know the transaction amount. However, it might not have any information on the cardholder’s FICO score, a measure of creditworthiness in the US.

However, the features that are missing from the API request, such as the FICO score, are stored in the company’s internal database. Thus, you can use an enrichment to retrieve these features and pass them to the prediction endpoint. This way, the endpoint will have all the features needed for processing the request and return a valid response.

Slide depicting an API query enrichment for a credit card fraud example.

Deployment policy#

You can configure query enrichments in the Enrichment panel of the API Designer. In our credit card fraud example, we’ll enrich each query with a few additional features about our cardholders.

Enrichment data can either be bundled or referenced (for SQL data).

Deployment policy

Meaning

Bundled

The contents of the lookup table are copied and deployed as part of the API service on the API node. This mode is generally preferred when the lookup table is small.

Referenced

The data for the lookup table isn’t managed by the API node. When you export an API service from Dataiku, the service doesn’t contain the data. It only contains a reference to the original dataset, such as a connection name and a table name. It’s only available for SQL data.

Slide depicting enrichment deployment policy.

Additional options#

Once the enrichment is configured, you can try running a few test queries that have missing features, so that these missing features can be retrieved through enrichment.

If you’ve selected the option to return post-query enrichment in the Advanced panel, you will see the results of the enrichment in the Details section of each query.

Configure settings for data enrichment.

Next steps#

To get hands-on practice on using endpoints and enrichments, follow Tutorial | Real-time API deployment.

See also

See the reference documentation for more information on Enriching prediction queries.