Retrieve API Overview
Introduction
Welcome to the eGain Retrieve API Guide. The Retrieve API enables enterprises to directly access relevant content chunks from their organizational knowledge sources. It is designed for scenarios where developers want granular control over retrieved information, such as powering custom search, analytics, or retrieval-augmented generation (RAG) pipelines.
The Retrieve API's response will either be a Certified Answer or a list of chunks.
- Certified Answers Response : This response is observed when there's a matching certified answer to the user's query.
- Chunk List Response : This response is observed, if there is no matched Certified Answer.
Responses for both chunks and certified answers include relevance scores and metadata. By leveraging the Retrieve API, organizations can build tailored experiences while retaining confidence in the source material.
What It’s Used For
Organizations use the Retrieve API to surface knowledge in a controlled and customizable way. Key benefits include:
- Direct access to content chunks for custom search and analytics applications.
- Feeding enterprise knowledge into RAG or AI pipelines while retaining traceability.
- Enabling custom workflows that require precise filtering, scoring, and metadata.
- Ensuring compliance and auditability by exposing references to source material.
Common Use Cases
- Search-First Applications : Build knowledge search interfaces where users browse relevant document snippets with transparency.
- RAG Pipelines : Feed retrieved chunks into large language models or other AI systems for augmented response generation.
- Policy & Compliance Retrieval : Allow employees to quickly retrieve relevant regulatory or policy content while keeping traceability to sources.
- Customer Support Assist : Supply chatbots or agents with content snippets that inform responses without requiring full answers.
- Analytics and Insights : Use retrieved chunks for trend analysis, FAQ identification, or content gap detection.
Overall Workflow
-
Query Submitted
-
A request is sent to the Retrieve API, optionally including filters such as
topicIds,tags, anduserProfileIdsto narrow the scope.
-
A request is sent to the Retrieve API, optionally including filters such as
-
Certified Answer Retrieval
-
The API first checks for Certified Answers that meet or exceed the configured
certifiedAnswerThreshold. - The top result above the threshold is returned as the Certified Answer , while additional qualifying results are provided in searchResults .
-
The API first checks for Certified Answers that meet or exceed the configured
-
Chunk Retrieval (Fallback)
- If no Certified Answer meets the threshold, the API performs a hybrid search to retrieve the most relevant content chunks.
-
Response Returned
- The API returns retrieved items along with relevance scores, metadata, and source references for full transparency.
Next Steps
Explore the Retrieve API in more depth:
- Filters : Learn how to refine retrieval results by language, tags, topics, or user context.
- Certified Answers : Understand how the API can return high-confidence, source-grounded answers.