Retrieval
Retrieval related APIs
The Retrieval API allows you to obtain the top N page information related to a question from documents uploaded to Alli. This API combines keyword search and semantic search capabilities to provide the most relevant document pages for your queries.
Optional: Email of the agent to use for this request
Optional: Email address to associate with the user
Optional: User ID to identify or create a user
Question to search for in the document base
Determines how many related pages to retrieve. The default value is 3.
This is the weight for keyword search. The higher this value, the more the keyword score is reflected. Values between 0-9 are appropriate, with a value of 0 meaning keyword search is not used. The default value is 9.
This is the weight for semantic search on document content. The higher this value, the more it is reflected. Values between 0-9 are appropriate, with a value of 0 meaning semantic search on document content is not used. The default value is 1.
This is the weight for semantic search on document titles. Similarly, values between 0-9 are appropriate, with a value of 0 meaning semantic search on document titles is not used. The default value is 0.
Filter results to include only documents with these hashtags
Logical operator for hashtags (default is "or")
Filter results to exclude documents with these hashtags
Logical operator for exclude_hashtags (default is "or")
Names of folders to search within
IDs of folders to search within
IDs of specific knowledge bases to search within
Whether to extract and use keywords for search
Whether to use feedback data to improve search results
Successfully retrieved results
Invalid parameters
Internal server error
POST /webapi/retrieval HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 348
{
"question": "text",
"maxDocumentClues": 1,
"bm25_score_weight": 1,
"text_vector_score_weight": 1,
"title_vector_score_weight": 1,
"hashtags": [
"text"
],
"hashtags_operator": "and",
"exclude_hashtags": [
"text"
],
"exclude_hashtags_operator": "and",
"targetFolders": [
"text"
],
"folderIds": [
"text"
],
"knowledgeBaseIds": [
"text"
],
"use_keywords": true,
"use_clue_feedback": true
}
{
"result": [
{
"ranking": 1,
"title": "text",
"text": "text",
"pageNo": 1,
"kb_id": "text"
}
]
}
Was this helpful?