search

Perform search on an assistant

Perform search with either SIMPLE or FULL mode. SIMPLE does semantic search while FULL does semantic search, reranking and hybrid search. Use topN to control number of chunks in response, max limit is 50. Default to 5.

post/api/v1/assistants/{assistantId}/actions/search

Path parameters

assistantIdstring uuid required
Example:507f191e810c19729de860ea

The ID for the Assistant of interest

Request body

topNinteger

Number of chunks to return in results.

promptstring required

Query text or question to search.

searchMode'SIMPLE' | 'FULL'

Search mode to use. Allowed values: SIMPLE and FULL. Default: SIMPLE.

Example request

{
  "topN": 20,
  "prompt": "What is LLM?",
  "searchMode": "SIMPLE"
}

Response

Chunks retrieved successfully.

Example response

{
  "chunks": [
    {
      "text": "LLM stands for Large Language Model",
      "tfidfScore": 0.9,
      "semanticScore": 0.63
    }
  ]
}