RAG
Retrieval, generative answer, and highlight related APIs
This API allows you to retrieve bounding box coordinates for answer highlights in a knowledge base document page.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Your API key for authentication
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
OK
Enum representing different types of answers that can be provided.
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
GET /webapi/v2/highlights/{clue_id} HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
{
"bboxes": [
{
"left": 1,
"top": 1,
"right": 1,
"bottom": 1
}
],
"type": "PARAGRAPH"
}Return highlight bboxes for a single Retrieval result resolved straight from the retrieved page chunk (kbId + pageNo + subTextIndex), without a generative-answer clue id.
Your API key for authentication
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
1OK
Enum representing different types of answers that can be provided.
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
POST /webapi/v2/retrieval/highlight HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 98
{
"kbId": "text",
"pageNo": 1,
"subTextIndex": 1,
"passageText": "text",
"question": "text",
"answer": "text"
}{
"bboxes": [
{
"left": 1,
"top": 1,
"right": 1,
"bottom": 1
}
],
"type": "PARAGRAPH"
}This API allows you to retrieve the RARE build/generate status for the project.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Your API key for authentication
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
OK
""""Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
GET /webapi/v2/rare/status HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
{
"build_status": "text",
"job_status": "text",
"job_type": "text",
"build_run_id": "text",
"error_message": "text",
"build_progress": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"generate_progress": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"build_stats": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"generate_stats": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"folder_ids": [
"text"
],
"default_model": "",
"generation_model": ""
}This API allows you to start a RARE build task for the project.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Request Body
language (string, optional): Language for the build.
default_model (string, optional): Default LLM model to use.
similarity_threshold (number, optional): Similarity threshold for matching.
top_k_per_chunk (integer, optional): Top K results per chunk.
max_similar_items (integer, optional): Maximum similar items to return.
max_workers (integer, optional): Maximum parallel workers.
folder_ids (array[string], optional): Folder IDs to include in the build.
Your API key for authentication
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
Koreangpt54_nano0.51256100OK
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
POST /webapi/v2/rare/build HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 161
{
"language": "Korean",
"default_model": "gpt54_nano",
"similarity_threshold": 0.5,
"top_k_per_chunk": 1,
"max_similar_items": 256,
"max_workers": 100,
"folder_ids": [
"text"
]
}{
"message": "text",
"task_id": "text"
}This API allows you to start a RARE generate task. Requires build to be completed first.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Request Body
num_samples (integer, optional): Number of samples to generate.
input_pool_size (integer, optional): Input pool size.
num_questions (integer, optional): Number of questions per sample.
num_information (integer, optional): Number of information items per sample.
language (string, optional): Language for generation.
default_model (string, optional): Default LLM model.
generation_model (string, optional): Model to use for generation.
rare_user_prompt (string, optional): Custom user prompt for generation.
Your API key for authentication
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
1050102Koreangpt54_nanogpt54""OK
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
POST /webapi/v2/rare/generate HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 176
{
"num_samples": 10,
"input_pool_size": 50,
"num_questions": 10,
"num_information": 2,
"language": "Korean",
"default_model": "gpt54_nano",
"generation_model": "gpt54",
"rare_user_prompt": ""
}{
"message": "text",
"task_id": "text"
}This API allows you to request cooperative cancellation for a running RARE job.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Your API key for authentication
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
OK
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
POST /webapi/v2/rare/cancel HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
{
"message": "text",
"task_id": "text"
}This API allows you to list recent RARE generate results for the project.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Your API key for authentication
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
OK
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
GET /webapi/v2/rare/results HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
{
"results": [
{
"id": "text",
"created_at": "text",
"n_samples": 1,
"rare_config": "text",
"result_file_url": "text"
}
]
}This API allows you to delete a RARE generate result by ID.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Your API key for authentication
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
OK
No content
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
DELETE /webapi/v2/rare/results/{result_id} HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
No content
This API allows you to download a RARE CSV result file from storage.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Query Parameters
path (string, optional): The storage path of the CSV file.
Your API key for authentication
""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
OK
No content
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
GET /webapi/v2/rare/csv HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
No content
This API allows you to start bulk processing (GA or RAG) by uploading a CSV file.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Query Parameters
bulk_type (string, optional): Must be
ga,rag, orrag_agent_v2. Defaults to ga.rag_agent_v2runs RAG Agent V2 (General Agent) with the same CSV asrag.
Request Body (multipart/form-data)
file (binary, required): CSV file with columns: question, model, search_type.
Your API key for authentication
gaPossible values: 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
OK
No content
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
POST /webapi/v2/bulk_processing/run HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 17
{
"file": "binary"
}No content
This API allows you to list bulk processing results with pagination.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Query Parameters
page (integer, optional): Page number for pagination. Defaults to 1.
Your API key for authentication
1Optional: 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
OK
No content
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
GET /webapi/v2/bulk_processing/results HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
No content
This API allows you to download a bulk processing result as a CSV file.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Query Parameters
file_url (string, required): The URL of the result file to download.
Your API key for authentication
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
OK
No content
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
GET /webapi/v2/bulk_processing/download?file_url=text HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
No content
This API allows you to delete a bulk processing result by ID.
Headers
API-KEY (string, required): Your assigned API key. You can find it in the Settings menu of the dashboard.
AGENT-EMAIL (string, optional): The email address of the agent performing the API call.
USER-EMAIL (string, optional): The email address to associate with the user.
OWN-USER-ID (string, optional): The user ID to identify or create a user.
Your API key for authentication
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
OK
No content
Invalid request parameters.
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
Internal server error.
DELETE /webapi/v2/bulk_processing/results/{result_id} HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Accept: */*
No content
Generative Answer API finds an answer from your unstructured text documents, Q&A, and even from complex tables. It synthesizes information from various sources to provide comprehensive responses to user queries.
Your API key for authentication
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
This is a query string.
Utilize the LLM of your choice when generating answers. Default model is GPT4o. Please see documentation for available options.
Determine the format of the response given for easier integrations. Acceptable values are DRAFTJS and MARKDOWN. Default format is DRAFTJS.
To use follow-up question, previous conversation history is required. The conversation history is managed by threadId. If you set isStateful option to True and enter a threadId, the query will be rewritten with reference to the previous conversation history. Default = False.
threadId is used when isStateful = True. The first time you start a conversation, send it empty, and from the next query on, send it using the threadId from the output. However, if you want to set the threadId from the beginning, write it as a UUID and send it. Example UUID - 36e7bb2b-1063-47ec-. Default = None.
Select which group prompt from your project to use for generating responses. The ID is located within the URL when viewing the group prompt within the Settings page. This is a very helpful option for a project with multiple different group prompts that are altered for specific tasks.
Whether to output data as stream or sync. Current available values: sync OR stream (default=sync). When in stream mode, .json strings with the same output format as sync are outputted as streaming.
Whether to include the text of the document used as a clue. Default = False. ONLY works if clues is enabled.
Whether to include clues in the output that will be used to create a generative answer. Default = False.
Whether to include detailed citation information in the response. Citations provide structured references to source documents used in generating the answer. Default = False.
Specifies the range of source data for Generative Answer to find data from. Currently available values are: web, qna, document, and enter data in the form of a list. For example -> ["web", "qna"]
Controls the randomness of the output. Higher values make the output more random. Default = 0.
(Legacy) Limits the search to specific knowledge base IDs. Use 'source' parameter instead for better control over shared/personal documents.
(Legacy) Limits the search to specific folder IDs. Use 'source' parameter instead for better control over shared/personal documents.
Successfully generated answer
It's the answer extracted from uploaded documents in the dashboard, formatted according to the answerFormat parameter.
This is used to identify the answer to give or cancel feedback.
It shows the confidence value from AI model. Shown as a number value between 0 and 1.
When you provide feedback to the query result, it automatically trains the AI model. Effective confidence is the adjusted score with these users' and agents' feedback. Shown as a number value between 0 and 1.
The document's ID where the answer is extracted from.
The document's name where the answer is extracted from.
The hashtags attached to the document.
The page number in the document where the answer was derived.
The date when the document was uploaded.
The feedback from agents (through dashboard and REST calls) about this document.
The feedback from users about this document.
If returnPreview is true in the request, the html body of the document search preview is displayed.
If returnPreview is true in the request, the css of the document search preview is displayed.
If returnPdfPreview is true in the request, the URL to a PDF preview of the document with the answer highlighted is displayed. Note that the URL can be restricted using the Download IP Allowlist setting.
If the answer is found from a folder under the Documents database, the folder name will be returned here.
List of the agents' email who has the editor access to the documents (if they're set in the Alli dashboard).
List of the agents' email who has the viewer access to the documents (if they're set in the Alli dashboard).
A UUID that can be used for follow-up questions when isStateful is true.
Suggested follow-up question for the user when isStateful is true.
The detected intent of the query.
If clues is true in the request, the sources used to generate the answer are returned here.
Bad request
Unauthorized
Access denied. The project is inactive or the request IP is not allowed.
Rate limit exceeded
Internal server error.
POST /webapi/generative_answer HTTP/1.1
Host: backend.alli.ai
API-KEY: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 609
{
"query": "text",
"model": "text",
"answerFormat": "text",
"isStateful": true,
"threadId": "123e4567-e89b-12d3-a456-426614174000",
"promptGroupId": "text",
"mode": "text",
"clueText": true,
"clues": true,
"includeCitations": true,
"hashtags": {
"qnaInclude": [
"text"
],
"qnaIncludeOption": "or",
"qnaExclude": [
"text"
],
"qnaExcludeOption": "or",
"docsInclude": [
"text"
],
"docsIncludeOption": "or",
"docsExclude": [
"text"
],
"docsExcludeOption": "or"
},
"search_from": [
"text"
],
"temperature": 1,
"source": {
"sharedKnowledgeBaseNodeIds": [
"text"
],
"personalKnowledgeBaseNodeIds": [
"text"
],
"webSites": [
"text"
]
},
"knowledgeBaseIds": [
"text"
],
"folderIds": [
"text"
]
}{
"answer": {},
"answerHash": "text",
"confidence": 1,
"effectiveConfidence": 1,
"documentId": "text",
"documentName": "text",
"hashtags": [],
"pageNo": 1,
"createdDate": "2026-01-01",
"agentFeedback": {},
"userFeedback": {},
"body": "text",
"css": "text",
"pdfPreview": "text",
"folder": "text",
"editor": [
"text"
],
"viewer": [
"text"
],
"threadId": "text",
"fuQuestion": "text",
"intent": "text",
"clues": [],
"citations": [
{
"index": 1,
"clueId": "text",
"source": "text",
"title": "text",
"pageNo": 1,
"knowledgeBaseId": "text",
"faqId": "text",
"url": "text",
"text": "text"
}
]
}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.
Your API key for authentication
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
Also search the requesting user's personal documents (default false). Takes effect only when the request also carries a user identity (Own-User-Id / User-Email) AND names personal ids below; otherwise the personal half is skipped and only shared documents are searched. There is deliberately no "all of my personal documents" mode.
IDs of the requesting user's personal folders to search within. Ids the user does not own are dropped. Personal ids belong here, not in folderIds — the shared and personal scopes are OR-ed, so a personal id sent as a shared one matches nothing.
IDs of the requesting user's personal knowledge bases to search within. See personalFolderIds.
Whether to extract and use keywords for search
Whether to use feedback data to improve search results
Overrides the project's cognitive_config.use_reranker for this request. When omitted, the project config value is used.
Overrides the number of candidate pages passed to the reranker. Only effective when reranking is enabled. Defaults to 16 when omitted.
Overrides the maximum token length per candidate sent to the reranker. Only effective when reranking is enabled. Defaults to 1024 when omitted.
Successfully retrieved results
Invalid parameters
Authentication failed. The API-KEY header is missing or invalid.
Access denied. The project is inactive or the request IP is not allowed.
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: 514
{
"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"
],
"enablePersonalFolderSearch": true,
"personalFolderIds": [
"text"
],
"personalDocumentIds": [
"text"
],
"use_keywords": true,
"use_clue_feedback": true,
"use_reranker": true,
"reranker_candidates_num": 1,
"reranker_max_tokens": 1
}{
"result": [
{
"ranking": 1,
"title": "text",
"text": "text",
"pageNo": 1,
"kb_id": "text"
}
]
}Last updated