Retrieve relevant document chunks without generating an answer.
Path Parameters:
engine_id: Unique identifier of the answer engineRequest Body:
query: The search query (required, cannot be empty)top_k (optional): Number of chunks to return (1-50). Default: 5Returns:
answer_engine_id: ID of the engine usedquery: Echo of the submitted querydocuments: List of retrieved document chunksmetadata: Retrieval metadataRaises:
404: Engine not found422: Invalid request bodyExample Request:
POST /api/v3/answer-engine/ae_8c625d9d71/retrieve
Headers: {"Authorization": "Bearer <api_key>"}
{
"query": "What is Machine Learning?",
"top_k": 5
}
Example Response:
{
"answer_engine_id": "ae_8c625d9d71",
"query": "What is Machine Learning?",
"documents": [],
"metadata": {
"org_id_verify": "org_415",
"user_id_verify": "user_415",
"total_chunks_searched": 0,
"retrieval_time_ms": 0,
"message": "No documents have been uploaded to this answer engine yet"
}
}
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Unique answer engine identifier