Submit a question — retrieve relevant documents only

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Title
Submit a question — retrieve relevant documents only

Description
Send a natural-language search to the specified dataset.
The service retrieves and ranks the most relevant document snippets but does not generate an AI answer.
Typical uses:

  • Build your own answer logic while relying on AutoDriveDDF for retrieval.
  • Feed the snippets into a separate LLM or analytics pipeline.
  • Batch offline processing where you first collect context, then post-process.

The call returns quickly with a question_id.
Use GET /dataset/{dataset_id}/question/{question_id} to fetch the snippets.


HTTP Request

POST /dataset/{dataset_id}/question



Authentication

In your REST client (Postman/Insomnia), select Basic Auth and enter your Username and Password.

The client will automatically generate the Authorization: Basic … header for you. Do not add that header manually.



Request Headers

HeaderExampleRequiredNotes
Content-Typeapplication/jsonJSON payload
Acceptapplication/jsonEnsures JSON response

Path Parameters

LocationNameTypeRequiredDescription
Pathdataset_idstringUUID of the dataset you want to search, e.g. c8004e22-87f7-441f-8302-80c934841196

Request Body

FieldTypeRequiredDescription
questionstringNatural-language query (max 1000 chars).
kintegerOptional. Number of top snippets to keep (default server value, e.g. 5).

Example JSON

{
  "question": "How do I configure the data pipeline?",
  "k": 5
}

Example Request (cURL)

curl -u admin:mypassword \
     -H "Content-Type: application/json" \
     -d '{"question":"How do I configure the data pipeline?"}' \
     https://api.autodriveddf.example/dataset/c8004e22-87f7-441f-8302-80c934841196/question

Success Response 200 OK

{
  "dataset_id": "c8004e22-87f7-441f-8302-80c934841196",
  "question_id": "73a1f41a-0754-48cb-8b6d-4d9c25a6fc0b"
}
FieldDescription
dataset_idUUID of the dataset queried.
question_idUUID for this question. Use it with GET /dataset/{dataset_id}/question/{question_id} to retrieve the snippets.

Error Responses

CodeReasonWhen it happensExample Body
400Bad Requestquestion missing / empty, or malformed JSON{ "detail": "Field 'question' is required." }
401UnauthorizedMissing / wrong Basic Auth
404Not FoundDataset UUID does not exist{ "detail": "Dataset not found." }
422Unprocessable EntityDataset is still processing or failed (status ≠ success){ "detail": "Dataset is not available for querying yet." }
500Server ErrorUnexpected failure while registering the question{ "detail": "Unexpected error." }

Next Steps

  1. Wait briefly, then call GET /dataset/{dataset_id}/question/{question_id}.
  2. The response will include question_text and an array relevant_documents.
  3. Use those snippets however you like—display to users, feed into another model, etc.
Path Params
string
required
Body Params
string
required

Question that will be asked to the dataset

metadata_filter
object
    This field can be used to filter documents using the metadata
      of the documents.

    Example:
    metadata_filter={"source": "file.txt"}

    In this scenario, before selecting the documents, the following filter
      would be routerlied to the dataset.
    
string
enum
Defaults to cos
    Distance Metric in Embedding Distances

    In the realm of embeddings, where data points are represented as
      vectors in a continuous space, a distance metric quantifies the
      similarity or dissimilarity between these vectors. It allows us
      to gauge how close or far apart two embeddings are, helping
      capture semantic or contextual relationships.

    Available metrics:
      - "L2": "Euclidean Distance"
      - "L1": "Nuclear distance"
      - "max": "L-infinity"
      - "cos": "Cosine"
      - "dot": "dot product"
    
Allowed:
boolean
Defaults to true
    Whether to use MMR (Maximal Marginal Relevance) in the selection of documents
    to retrieve.

    MMR is an algorithm commonly used in information retrieval and text summarization.
      Its primary goal is to balance relevance and diversity. When retrieving or
      summarizing documents, MMR ensures that the selected items are
      not only relevant to the query or topic but also diverse enough
      to provide comprehensive information. This prevents redundancy and
      offers a broader perspective on the topic.
    
integer
Defaults to 10

Amount of Langchain documents to pass to MMR algorithm.

integer
Defaults to 3

Amount of Langchain documents to return

boolean
Defaults to true
Responses

Language
Credentials
Basic
base64
:
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json