Skip to main content
POST
/
v2
/
knowledge
/
{knowledge_id}
/
search
Search knowledge base
curl --request POST \
  --url https://api.orq.ai/v2/knowledge/{knowledge_id}/search \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "query": "<string>",
  "top_k": 50,
  "threshold": 0.5,
  "search_type": "hybrid_search",
  "filter_by": {},
  "search_options": {
    "include_vectors": true,
    "include_metadata": true,
    "include_scores": true
  },
  "rerank_config": {
    "model": "cohere/rerank-multilingual-v3.0",
    "threshold": 0,
    "top_k": 10
  },
  "agentic_rag_config": {
    "model": "<string>"
  }
}'
{
  "matches": [
    {
      "id": "<string>",
      "text": "<string>",
      "vector": [
        123
      ],
      "metadata": {},
      "scores": {
        "rerank_score": 123,
        "search_score": 123
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

knowledge_id
string
required

The unique identifier or key of the knowledge base

Body

application/json

A search request for chunks in a knowledge base

query
string
required

The query to use to search the knowledge base

top_k
integer

The number of results to return. If not provided, will default to the knowledge base configured top_k.

Required range: 1 <= x <= 100
threshold
number

The threshold to apply to the search. If not provided, will default to the knowledge base configured threshold

Required range: 0 <= x <= 1
search_type
enum<string>
default:hybrid_search

The type of search to perform. If not provided, will default to the knowledge base configured retrieval_type

Available options:
vector_search,
keyword_search,
hybrid_search
filter_by
object

The metadata filter to apply to the search. Check the Searching a Knowledge Base for more information.

  • Search operator
  • and
  • or
search_options
object

Additional search options

rerank_config
object

Override the rerank configuration for this search. If not provided, will use the knowledge base configured rerank settings.

agentic_rag_config
object

Override the agentic RAG configuration for this search. If not provided, will use the knowledge base configured agentic RAG settings.

Response

200 - application/json

Search knowledge base

matches
object[]
required