Enrichment
API Call
Call external APIs during retrieval for real-time enrichment and data augmentation
Why do anything?
Search results may need real-time data from external systems (pricing, inventory, user data).
Why now?
Modern applications integrate multiple data sources. In-pipeline API calls reduce latency.
Why this feature?
Call any HTTP API during retrieval with request templating, response parsing, and error handling.
How It Works
API call enables external data integration during retrieval.
1
Request Templating
Build request from document data
2
API Invocation
Call external API with retry logic
3
Response Parsing
Parse and map response data
4
Document Enrichment
Add API data to documents
Why This Approach
In-pipeline API calls enable real-time enrichment. Templating supports flexible integrations.
Where This Is Used
Integration
retriever = client.retrievers.create(stages=[{"type": "api_call", "endpoint": "..."}])