Skip to content

Knowledge Bases

Built-in knowledge base management operations


Get All Knowledge Bases

GET
/api/v1/knowledge/bases

Get all builtin knowledge bases

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Responses

Success

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
"bases": [
{
}
]
}
}

Playground

Server
Authorization

Samples


Create Knowledge Base

POST
/api/v1/knowledge/bases

Create a new knowledge base

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Request Body

application/json
JSON
{
"name": "string",
"description": "string",
"embedding_model_uuid": "string"
}

Responses

Knowledge base created successfully

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
"uuid": "string"
}
}

Playground

Server
Authorization
Body

Samples


Get Knowledge Base Details

GET
/api/v1/knowledge/bases/{kb_uuid}

Get details info of specified knowledge base

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Parameters

Path Parameters

kb_uuid*

Knowledge Base UUID

Typestring
Required

Responses

Success

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
"base": {
}
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Update Knowledge Base Info

PUT
/api/v1/knowledge/bases/{kb_uuid}

Update knowledge base information

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Parameters

Path Parameters

kb_uuid*

Knowledge Base UUID

Typestring
Required

Request Body

application/json
JSON
{
"name": "string",
"description": "string"
}

Responses

Update successful

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
}
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples


Delete Knowledge Base

DELETE
/api/v1/knowledge/bases/{kb_uuid}

Delete a specified knowledge base

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Parameters

Path Parameters

kb_uuid*

Knowledge Base UUID

Typestring
Required

Responses

Deletion successful

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


List Knowledge Base Files

GET
/api/v1/knowledge/bases/{kb_uuid}/files

Get all files in the specified knowledge base

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Parameters

Path Parameters

kb_uuid*

Knowledge Base UUID

Typestring
Required

Responses

成功

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
"files": [
{
}
]
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Add File to Knowledge Base

POST
/api/v1/knowledge/bases/{kb_uuid}/files

Add uploaded file to knowledge base for processing

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Parameters

Path Parameters

kb_uuid*

Knowledge Base UUID

Typestring
Required

Request Body

application/json
JSON
{
"file_id": "string"
}

Responses

Addition successful

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
"task_id": "string"
}
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples


Delete File from Knowledge Base

DELETE
/api/v1/knowledge/bases/{kb_uuid}/files/{file_id}

Delete file from the specified knowledge base

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Parameters

Path Parameters

kb_uuid*

Knowledge Base UUID

Typestring
Required
file_id*

File ID

Typestring
Required

Responses

Deletion successful

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
}
}

Playground

Server
Authorization
Variables
Key
Value

Samples


Retrieve Knowledge

POST
/api/v1/knowledge/bases/{kb_uuid}/retrieve

Search for relevant knowledge in the knowledge base

Authorizations

ApiKeyAuth

API Key authentication using X-API-Key header.
Example: X-API-Key: lbk_your_api_key_here

TypeAPI Key (header: X-API-Key)
or
BearerAuth

Bearer token authentication. Can be either a user JWT token or an API key.
Example: Authorization: Bearer <token_or_key>

TypeHTTP (bearer)

Parameters

Path Parameters

kb_uuid*

Knowledge Base UUID

Typestring
Required

Request Body

application/json
JSON
{
"query": "string"
}

Responses

Retrieval successful

application/json
JSON
{
"code": 0,
"msg": "ok",
"data": {
"results": [
{
}
]
}
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples


Powered by VitePress OpenAPI