Updated on 2025-08-13 GMT+08:00

Search augmentation

Function

RAG.

URI

POST /v1/koosearch/search

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

query

Yes

String

Definition:

User question.

Constraints:

N/A

Value range:

The maximum length is 1,024 characters.

Default value:

N/A

knowledge_threshold

No

Float

Definition:

Unidata knowledge base threshold.

Constraints:

N/A

Value range:

0-1

Default value:

0.98

faq_threshold

No

Float

Definition:

Unidata FAQ library threshold.

Constraints:

N/A

Value range:

0-1

Default value:

0.9

repo_id

No

String

Definition:

KooSearch knowledge base ID.

Constraints:

N/A

Value range:

The value can contain 1 to 64 characters. It can only contain letters, digits, underscores (_), and hyphens (-).

Default value:

N/A

plan

No

SearchPlanningRsp object

Definition:

Search planning response.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

debug

No

Boolean

Definition:

Whether to enable the debug mode

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Table 2 SearchPlanningRsp

Parameter

Mandatory

Type

Description

category

No

String

Query classification. For industry knowledge, prefix matching is recommended and allows for future extensions.

Chit-chat: It's so exhausting taking a long-distance train.

NLP task: Please write an email of about 460 words asking for details about a new IT project. This email will be sent to the company's IT project manager.

Persona: What's your name?

General knowledge: What is the difference between soybean juice and soy milk?

Weather: What is the weather like in Beijing tomorrow?

Industry knowledge:

  • Industry knowledge - finance: What is the definition of loan restructuring?

    • Industry knowledge-Government: What are the main guidelines in the New-Generation Artificial Intelligence Development Plan issued by the State Council of China?

  • Industry knowledge - manufacturing:

  • Industry knowledge - medical: What are the common Western medicines for children's constipation on the market?

If an industry knowledge category is not considered, it is generally classified as "industry knowledge".

sub_queries

No

Array of strings

Sub-query questions after multi-round rewriting and complex question decomposition may contain multiple values.

language

No

String

Query language.

zh: Chinese

en: English

ar: Arabic

fr: French

th: Thai

mix: hybrid

unknown: unknown

timeliness

No

Boolean

Time-sensitive query, for example, what is the weather today?

date_range

No

String

Extract the time range from the query. If there are multiple sub-queries, use semicolons (;) to separate the extraction results of each sub-query.

For example:

query: What is the maximum power input to Shandong from external power sources when the maximum power consumption load on the entire network in 2022?

date_range : 2022-01-01~2022-12-31

query: Huawei's revenue for the first quarter

date_range : 2024-01-01~2024-03-31

query: Today's time

date_range: 2024-04-01

query: What is the discharge capacity of the supporting energy storage on November 30, 2023?

date_range: 2023-11-30~2023-11-30

query: What major events happened in Beijing two days ago?

date_range: 2024-03-30~2024-03-30

Date range involved in the query. If there are multiple sub-queries, use semicolons (;) to separate them.

For example:

query: GDP of Shandong and Shanxi in the first quarter of 2023

date_range: 2023-01-01~2023-03-31;2023-01-01~2023-03-31

calculation

No

Boolean

Query that involves math calculation, for example, economic growth rate

output_language

No

String

Whether the query contains the expression "Please answer in xx language". The output will be in the specified language. For example, zh, en, ar, fr, and th. If no result is output, "" is returned.

Query language.

cost

No

Float

Request processing duration, in ms

term_weight

No

Map<String,Number>

Word weight result

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

query

String

Definition:

Original user question.

Value range:

N/A

documents

Array of Document objects

Definition:

Search result.

Value range:

N/A

Table 4 Document

Parameter

Type

Description

title

String

Definition:

Title. Use this name and URL to create a hyperlink. Clicking the hyperlink will take the user to the web page.

Value range:

N/A

content

String

Definition:

Content.

Value range:

N/A

url

String

Definition:

Hyperlink.

Value range:

N/A

score

Float

Definition:

Relevance.

Value range:

N/A

timestamp

String

Definition:

Update time (time when the web page is captured last time). The date format is YYYY-MM-DDTHH:MM:SS.

Value range:

N/A

category

String

Definition:

Directory, single value.

Value range:

N/A

tags

Array of strings

Definition:

Tag list.

Value range:

N/A

query

String

Definition:

Query.

Value range:

N/A

type

String

Definition:

Search type.

Value range:

N/A

id

String

Definition:

ID.

Value range:

N/A

file_id

String

Definition:

File ID.

Value range:

N/A

size

Long

Definition:

Size.

Value range:

N/A

has_html

Boolean

Definition:

Whether HTML is used.

Value range:

N/A

rank

String

Definition:

Ranking of the documents during web search recall.

Value range:

N/A

source

String

Definition:

Source

Value range:

N/A

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error Code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition:

Error Code.

Value range:

N/A

error_msg

String

Definition:

Error message.

Value range:

N/A

Example Requests

None

Example Responses

None

Status Codes

Status Code

Description

200

Search response.

400

Client error.

500

Server error.

Error Codes

See Error Codes.