Skip to main content
POST
/
api
/
v2
/
query
Extract chunks from knowledge base
curl --request POST \
  --url https://paradigm.lighton.ai/api/v2/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>"
}'
[
  {
    "query": "<string>",
    "chunks": [
      {
        "uuid": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "text": "<string>",
        "metadata": {},
        "score": 123
      }
    ]
  }
]

Authorizations

Authorization
string
header
required

Bearer token authentication

Body

Request serializer for retrieving top n chunks per query.

query
string
required

A single string or a list of strings representing the search queries

collection
string | null

The collection to query, defaults to 'base_collection' if not specified

n
integer | null

Number of top chunks to retrieve per query, defaults to 5 if not specified

Response

Successful response

chunks
object[]
required

List of retrieved document chunks with their relevance scores

query
string

The original query used for retrieval

I