This document explains how APIs are generated for data products in IBM Data Product Hub (DPH) and how they can be consumed by AI agents and applications.
- Once the CI/CD pipeline publishes the data product to DPH, the platform automatically registers the data product.
- The registration process includes:
- Storing the contract metadata.
- Validating the semantic query.
- Applying the specified policy (e.g.,
internal_only).
- DPH generates a governed API endpoint for the data product.
- Example API endpoint:
GET /metrics/invoice_collection_risk_14d - The API is governed by the policies defined in the contract (e.g., access control, data masking).
- DPH automatically generates an OpenAPI specification for the API.
- Example OpenAPI snippet:
openapi: 3.0.0 info: title: Invoice Collection Risk (14 Days) description: API for retrieving the value of unpaid invoices due within 14 days. version: 1.0.0 paths: /metrics/invoice_collection_risk_14d: get: summary: Retrieve invoice collection risk responses: '200': description: Successful response content: application/json: schema: type: object properties: value: type: number description: Total value of unpaid invoices due within 14 days.
- Applications and AI agents can query the API to retrieve the data product's metric.
- Example query:
curl -X GET https://dph.example.com/metrics/invoice_collection_risk_14d \ -H "Authorization: Bearer <token>"
-
AI agents (e.g., Claude, ChatGPT) can use the API to answer user queries.
-
Example user query:
What is the invoice collection risk over the next 14 days?
-
Example agent response:
The invoice collection risk over the next 14 days is $1,250,000.
- The API enforces the policies defined in the contract:
- Access Control: Ensures only authorized users can access the API.
- Data Masking: Applies masking to sensitive fields if required.
- The API provides real-time data based on the semantic query.
- Example:
- If new invoices are added to the database, the API reflects the updated metric immediately.
- Governance: Ensures data access complies with organizational policies.
- Automation: Eliminates manual API creation.
- Integration: Enables seamless consumption by AI agents and applications.
- DPH automates the generation of governed APIs for data products.
- These APIs can be consumed by AI agents and applications to provide real-time insights while enforcing governance policies.