Alli Retrieval API

The Retrieval API allows you to obtain the top N page information related to a question from documents uploaded to Alli.

POST https://backend.alli.ai/webapi/retrieval

Parameters

Name
Type
Description

API-KEY

string

This is your assigned API key. It can be found in the settings menu > general tab of the dashboard.

Request Body

Name
Type
Description

question (required)*

string

Question

max_document_clues

integer

Determines how many related pages to retrieve. The default value is 3.

bm25_score_weight(optional)

float

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 0 meaning keyword search is not used. The default value is 9.

text_vector_score_weight (optional)

float

This is the weight for semantic search on document content. The higher this value, the more it is reflected. Similarly, values between 0-9 are appropriate, with 0 meaning semantic search on document content is not used. The default value is 1.

title_vector_score_weight (optional)

float

This is the weight for semantic search on document titles. Similarly, values between 0-9 are appropriate, with 0 meaning semantic search on document titles is not used. The default value is 0.

If the request is successful, you can obtain the results in JSON format.

ranking : Rank of the page related to the question

title : Title of the document related to the question

text : Content of the page related to the question

page_no : Page number

Notes

  • Keyword search : Assigns scores based on whether tokens match when the sentence is divided into tokens.

  • Semantic search : Measures similarity by converting sentences into embedding vectors. Can respond to synonyms.

Response Example

At this time, you need to replace the REST API KEY with your project's API key. Please refer to the "Getting API Key" section.

Response Example

Last updated

Was this helpful?