Skip to main content
POST
/
query
Query Data
curl --request POST \
  --url https://api.example.com/query \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "topK": 123
}
'
{
  "query": "<string>",
  "hits": [
    {
      "id": "<string>",
      "score": 123,
      "text": "<string>",
      "title": "<string>"
    }
  ]
}

Body

query
string
required
The question or text you want to find matches for in the vector store.
topK
number
The maximum number of chunks to return. Defaults to 5.

Response

query
string
The original query.
hits
array
An array of retrieved chunk objects.
Example Request
{
  "query": "How do I configure the RAG server?",
  "topK": 3
}
Example Response
{
  "query": "How do I configure the RAG server?",
  "hits": [
    {
      "id": "chunk-123",
      "score": 0.89,
      "text": "The RAG server is configured via the .ragtoolkit workspace...",
      "title": "Server Manual"
    }
  ]
}