Skip to main content

NucliaDB REST API (v1)

API reference for the NucliaDB, covering all the endpoints related to pushing or searching contents.

Resources

Knowledge Box resource endpoints

Get Resource (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
query Parameters
show
Array of strings (Show)
Default: "basic"
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"
field_type
Array of strings (Field Type)
Default: "text&field_type=file&field_type=link&field_type=conversation&field_type=generic"
Items Enum: "text" "file" "link" "conversation" "generic"
extracted
Array of strings (Extracted)
Default: "text&extracted=metadata&extracted=link&extracted=file"
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"
header Parameters
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "slug": "string",
  • "title": "string",
  • "summary": "string",
  • "icon": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "computedmetadata": {
    },
  • "created": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "last_seqid": 0,
  • "last_account_seq": 0,
  • "queue": "private",
  • "hidden": true,
  • "origin": {
    },
  • "extra": {
    },
  • "relations": [
    ],
  • "data": {
    },
  • "security": {
    }
}

Modify Resource (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
header Parameters
x-skip-store
boolean (X-Skip-Store)
Default: false

If set to true, file fields will not be saved in the blob storage. They will only be sent to process.

x-nucliadb-user
string (X-Nucliadb-User)
Default:
Request Body schema: application/json
required
Title (string) or Title (null) (Title)
Summary (string) or Summary (null) (Summary)
Slug (string) or Slug (null) (Slug)

The slug is the user-defined id for the resource

Thumbnail (string) or Thumbnail (null) (Thumbnail)
InputMetadata (object) or null
UserMetadata (object) or null
Array of Fieldmetadata (objects) or Fieldmetadata (null) (Fieldmetadata)
InputOrigin (object) or null
Extra (object) or null
object (Files)
Default: {}

Dictionary of file fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Links)
Default: {}

Dictionary of link fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Texts)
Default: {}

Dictionary of text fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Conversations)
Default: {}

Dictionary of conversation fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

PushProcessingOptions (object) or null
Default: {"ml_text":true}
ResourceSecurity (object) or Security (null) (Security)

Security metadata for the resource. It can be used to have fine-grained control over who can access the resource.

Hidden (boolean) or Hidden (null) (Hidden)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "summary": "string",
  • "slug": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "origin": {
    },
  • "extra": {
    },
  • "files": { },
  • "links": { },
  • "texts": { },
  • "conversations": { },
  • "processing_options": {
    },
  • "security": {
    },
  • "hidden": true
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Delete Resource (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Reindex Resource (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
query Parameters
reindex_vectors
boolean (Reindex Vectors)
Default: false

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Reprocess resource (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
header Parameters
x-nucliadb-user
string (X-Nucliadb-User)
Default:

Responses

Response samples

Content type
application/json
{
  • "seqid": 0
}

List Resources

List of resources of a knowledgebox

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
query Parameters
page
integer (Page)
Default: 0

Requested page number (0-based)

size
integer (Size)
Default: 20

Page size

Responses

Response samples

Content type
application/json
{
  • "resources": [
    ],
  • "pagination": {
    }
}

Create Resource

Create a new Resource in a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
header Parameters
x-skip-store
boolean (X-Skip-Store)
Default: false

If set to true, file fields will not be saved in the blob storage. They will only be sent to process.

Request Body schema: application/json
required
Title (string) or Title (null) (Title)
Summary (string) or Summary (null) (Summary)
Slug (string) or Slug (null) (Slug)

The slug is the user-defined id for the resource

Icon (string) or Icon (null) (Icon)
Thumbnail (string) or Thumbnail (null) (Thumbnail)
InputMetadata (object) or null
UserMetadata (object) or null
Array of Fieldmetadata (objects) or Fieldmetadata (null) (Fieldmetadata)
InputOrigin (object) or null
Extra (object) or null
Hidden (boolean) or Hidden (null) (Hidden)
object (Files)
Default: {}

Dictionary of file fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Links)
Default: {}

Dictionary of link fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Texts)
Default: {}

Dictionary of text fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Conversations)
Default: {}

Dictionary of conversation fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

PushProcessingOptions (object) or null
Default: {"ml_text":true}
ResourceSecurity (object) or Security (null) (Security)

Security metadata for the resource. It can be used to have fine-grained control over who can access the resource.

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "summary": "string",
  • "slug": "string",
  • "icon": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "origin": {
    },
  • "extra": {
    },
  • "hidden": true,
  • "files": { },
  • "links": { },
  • "texts": { },
  • "conversations": { },
  • "processing_options": {
    },
  • "security": {
    }
}

Response samples

Content type
application/json
{
  • "uuid": "string",
  • "elapsed": 0,
  • "seqid": 0
}

Get Resource (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
query Parameters
show
Array of strings (Show)
Default: "basic"
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"
field_type
Array of strings (Field Type)
Default: "text&field_type=file&field_type=link&field_type=conversation&field_type=generic"
Items Enum: "text" "file" "link" "conversation" "generic"
extracted
Array of strings (Extracted)
Default: "text&extracted=metadata&extracted=link&extracted=file"
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"
header Parameters
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "slug": "string",
  • "title": "string",
  • "summary": "string",
  • "icon": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "computedmetadata": {
    },
  • "created": "2019-08-24T14:15:22Z",
  • "modified": "2019-08-24T14:15:22Z",
  • "last_seqid": 0,
  • "last_account_seq": 0,
  • "queue": "private",
  • "hidden": true,
  • "origin": {
    },
  • "extra": {
    },
  • "relations": [
    ],
  • "data": {
    },
  • "security": {
    }
}

Modify Resource (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
header Parameters
x-skip-store
boolean (X-Skip-Store)
Default: false

If set to true, file fields will not be saved in the blob storage. They will only be sent to process.

x-nucliadb-user
string (X-Nucliadb-User)
Default:
Request Body schema: application/json
required
Title (string) or Title (null) (Title)
Summary (string) or Summary (null) (Summary)
Slug (string) or Slug (null) (Slug)

The slug is the user-defined id for the resource

Thumbnail (string) or Thumbnail (null) (Thumbnail)
InputMetadata (object) or null
UserMetadata (object) or null
Array of Fieldmetadata (objects) or Fieldmetadata (null) (Fieldmetadata)
InputOrigin (object) or null
Extra (object) or null
object (Files)
Default: {}

Dictionary of file fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Links)
Default: {}

Dictionary of link fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Texts)
Default: {}

Dictionary of text fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Conversations)
Default: {}

Dictionary of conversation fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

PushProcessingOptions (object) or null
Default: {"ml_text":true}
ResourceSecurity (object) or Security (null) (Security)

Security metadata for the resource. It can be used to have fine-grained control over who can access the resource.

Hidden (boolean) or Hidden (null) (Hidden)

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "summary": "string",
  • "slug": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "origin": {
    },
  • "extra": {
    },
  • "files": { },
  • "links": { },
  • "texts": { },
  • "conversations": { },
  • "processing_options": {
    },
  • "security": {
    },
  • "hidden": true
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Delete Resource (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Reindex Resource (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
query Parameters
reindex_vectors
boolean (Reindex Vectors)
Default: false

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Reprocess resource (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
header Parameters
x-nucliadb-user
string (X-Nucliadb-User)
Default:

Responses

Response samples

Content type
application/json
{
  • "seqid": 0
}

Resource fields

Knowledge Box resource's fields endpoints

Upload binary file on a Resource (by id)

Upload a file as a field on an existing resource, if the field exists will return a conflict (419)

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
path_rid
required
string (Path Rid)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
header Parameters
Array of X-Filename (strings) or X-Filename (null) (X-Filename)
Array of X-Password (strings) or X-Password (null) (X-Password)
Array of X-Language (strings) or X-Language (null) (X-Language)
Array of X-Md5 (strings) or X-Md5 (null) (X-Md5)

Responses

Response samples

Content type
application/json
{
  • "seqid": 0,
  • "uuid": "string",
  • "field_id": "string"
}

Add resource conversation field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
required
Array of objects (Messages)
Default: []
Array
Timestamp (string) or Timestamp (null) (Timestamp)
Who (string) or Who (null) (Who)
to
Array of strings (To)
Default: []
required
object (InputMessageContent)
ident
required
string (Ident)
MessageType (string) or null

Responses

Request samples

Content type
application/json
{
  • "messages": [ ]
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Download conversation binary field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_id
required
string (Field Id)
message_id
required
string (Message Id)
file_num
required
integer (File Num)

Responses

Response samples

Content type
application/json
null

Append messages to conversation field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
required
Array
Timestamp (string) or Timestamp (null) (Timestamp)
Who (string) or Who (null) (Who)
to
Array of strings (To)
Default: []
required
object (InputMessageContent)
ident
required
string (Ident)
MessageType (string) or null

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "seqid": 0
}

Add resource file field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
header Parameters
x-skip-store
boolean (X-Skip-Store)
Default: false

If set to true, file fields will not be saved in the blob storage. They will only be sent to process.

Request Body schema: application/json
required
Language (string) or Language (null) (Language)
Password (string) or Password (null) (Password)
required
object (File)

Responses

Request samples

Content type
application/json
{
  • "language": "string",
  • "password": "string",
  • "file": {
    }
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Download field binary field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_id
required
string (Field Id)
query Parameters
inline
boolean (Inline)
Default: false

Responses

Response samples

Content type
application/json
null

Reprocess file field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
header Parameters
x-nucliadb-user
string (X-Nucliadb-User)
Default:
X-File-Password (string) or X-File-Password (null) (X-File-Password)

If a file is password protected, the password must be provided here for the file to be processed

Responses

Response samples

Content type
application/json
{
  • "seqid": 0
}

Add resource text field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
required
body
required
string (Body) <= 2097152 characters

The text body. The format of the text should be specified in the format field. The sum of all text fields in the request may not exceed 2MB. If you need to store more text, consider using a file field instead or splitting into multiple requests for each text field.

format
string (TextFormat)
Enum: "PLAIN" "HTML" "RST" "MARKDOWN" "JSON" "KEEP_MARKDOWN" "JSONL" "PLAIN_BLANKLINE_SPLIT"

Responses

Request samples

Content type
application/json
{
  • "body": "string",
  • "format": "PLAIN"
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Get Resource field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_type
required
string (FieldTypeName)
Enum: "text" "file" "link" "conversation" "generic"

This map assumes that both values and extracted data field containers use the same names for its fields. See models.ResourceFieldValues and models.ResourceFieldExtractedData

field_id
required
string (Field Id)
query Parameters
show
Array of strings (Show)
Default: "value"
Items Enum: "value" "extracted" "error"
extracted
Array of strings (Extracted)
Default: "text&extracted=metadata&extracted=link&extracted=file"
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"
Page (string) or Page (integer) (Page)
Default: "last"

Responses

Response samples

Content type
application/json
{
  • "field_type": "text",
  • "field_id": "string",
  • "value": null,
  • "extracted": {
    },
  • "error": {
    }
}

Delete Resource field (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_type
required
string (FieldTypeName)
Enum: "text" "file" "link" "conversation" "generic"

This map assumes that both values and extracted data field containers use the same names for its fields. See models.ResourceFieldValues and models.ResourceFieldExtractedData

field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Download extracted binary file (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field_type
required
string (FieldTypeName)
Enum: "text" "file" "link" "conversation" "generic"

This map assumes that both values and extracted data field containers use the same names for its fields. See models.ResourceFieldValues and models.ResourceFieldExtractedData

field_id
required
string (Field Id)
download_field
required
string (Download Field)

Responses

Response samples

Content type
application/json
null

Add resource conversation field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
required
Array of objects (Messages)
Default: []
Array
Timestamp (string) or Timestamp (null) (Timestamp)
Who (string) or Who (null) (Who)
to
Array of strings (To)
Default: []
required
object (InputMessageContent)
ident
required
string (Ident)
MessageType (string) or null

Responses

Request samples

Content type
application/json
{
  • "messages": [ ]
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Download conversation binary field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_id
required
string (Field Id)
message_id
required
string (Message Id)
file_num
required
integer (File Num)

Responses

Response samples

Content type
application/json
null

Append messages to conversation field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
required
Array
Timestamp (string) or Timestamp (null) (Timestamp)
Who (string) or Who (null) (Who)
to
Array of strings (To)
Default: []
required
object (InputMessageContent)
ident
required
string (Ident)
MessageType (string) or null

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "seqid": 0
}

Add resource file field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
header Parameters
x-skip-store
boolean (X-Skip-Store)
Default: false

If set to true, file fields will not be saved in the blob storage. They will only be sent to process.

Request Body schema: application/json
required
Language (string) or Language (null) (Language)
Password (string) or Password (null) (Password)
required
object (File)

Responses

Request samples

Content type
application/json
{
  • "language": "string",
  • "password": "string",
  • "file": {
    }
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Download field binary field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_id
required
string (Field Id)
query Parameters
inline
boolean (Inline)
Default: false

Responses

Response samples

Content type
application/json
null

Upload binary file on a Resource (by slug)

Upload a file as a field on an existing resource, if the field exists will return a conflict (419)

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
header Parameters
Array of X-Filename (strings) or X-Filename (null) (X-Filename)
Array of X-Password (strings) or X-Password (null) (X-Password)
Array of X-Language (strings) or X-Language (null) (X-Language)
Array of X-Md5 (strings) or X-Md5 (null) (X-Md5)

Responses

Response samples

Content type
application/json
{
  • "seqid": 0,
  • "uuid": "string",
  • "field_id": "string"
}

Add resource text field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
required
body
required
string (Body) <= 2097152 characters

The text body. The format of the text should be specified in the format field. The sum of all text fields in the request may not exceed 2MB. If you need to store more text, consider using a file field instead or splitting into multiple requests for each text field.

format
string (TextFormat)
Enum: "PLAIN" "HTML" "RST" "MARKDOWN" "JSON" "KEEP_MARKDOWN" "JSONL" "PLAIN_BLANKLINE_SPLIT"

Responses

Request samples

Content type
application/json
{
  • "body": "string",
  • "format": "PLAIN"
}

Response samples

Content type
application/json
{
  • "seqid": 0
}

Get Resource field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_type
required
string (FieldTypeName)
Enum: "text" "file" "link" "conversation" "generic"

This map assumes that both values and extracted data field containers use the same names for its fields. See models.ResourceFieldValues and models.ResourceFieldExtractedData

field_id
required
string (Field Id)
query Parameters
show
Array of strings (Show)
Default: "value"
Items Enum: "value" "extracted" "error"
extracted
Array of strings (Extracted)
Default: "text&extracted=metadata&extracted=link&extracted=file"
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"
Page (string) or Page (integer) (Page)
Default: "last"

Responses

Response samples

Content type
application/json
{
  • "field_type": "text",
  • "field_id": "string",
  • "value": null,
  • "extracted": {
    },
  • "error": {
    }
}

Delete Resource field (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_type
required
string (FieldTypeName)
Enum: "text" "file" "link" "conversation" "generic"

This map assumes that both values and extracted data field containers use the same names for its fields. See models.ResourceFieldValues and models.ResourceFieldExtractedData

field_id
required
string (Field Id) ^[a-zA-Z0-9:_-]+$

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Download extracted binary file (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field_type
required
string (FieldTypeName)
Enum: "text" "file" "link" "conversation" "generic"

This map assumes that both values and extracted data field containers use the same names for its fields. See models.ResourceFieldValues and models.ResourceFieldExtractedData

field_id
required
string (Field Id)
download_field
required
string (Download Field)

Responses

Response samples

Content type
application/json
null

Resource field TUS uploads

Endpoints for TUS Resumable File Uploads protocol. This endpoints are compliant with the TUS protocol. You're not suposed to uses this endpoints directly, but use a TUS client in your language.

We also support the Creation extension on top of the Core TUS protocol

See https://tus.io/ for more info.

Create new upload on a Resource (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
path_rid
required
string (Path Rid)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
Any of
Title (string) or Title (null) (Title)
Summary (string) or Summary (null) (Summary)
Slug (string) or Slug (null) (Slug)

The slug is the user-defined id for the resource

Icon (string) or Icon (null) (Icon)
Thumbnail (string) or Thumbnail (null) (Thumbnail)
InputMetadata (object) or null
UserMetadata (object) or null
Array of Fieldmetadata (objects) or Fieldmetadata (null) (Fieldmetadata)
InputOrigin (object) or null
Extra (object) or null
Hidden (boolean) or Hidden (null) (Hidden)
object (Files)
Default: {}

Dictionary of file fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Links)
Default: {}

Dictionary of link fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Texts)
Default: {}

Dictionary of text fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Conversations)
Default: {}

Dictionary of conversation fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

PushProcessingOptions (object) or null
Default: {"ml_text":true}
ResourceSecurity (object) or Security (null) (Security)

Security metadata for the resource. It can be used to have fine-grained control over who can access the resource.

Responses

Request samples

Content type
application/json
Example
{
  • "title": "string",
  • "summary": "string",
  • "slug": "string",
  • "icon": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "origin": {
    },
  • "extra": {
    },
  • "hidden": true,
  • "files": { },
  • "links": { },
  • "texts": { },
  • "conversations": { },
  • "processing_options": {
    },
  • "security": {
    }
}

Response samples

Content type
application/json
null

Upload information


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
path_rid
required
string (Path Rid)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Upload data on a Resource (by id)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Create new upload on a Resource (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
Request Body schema: application/json
Any of
Title (string) or Title (null) (Title)
Summary (string) or Summary (null) (Summary)
Slug (string) or Slug (null) (Slug)

The slug is the user-defined id for the resource

Icon (string) or Icon (null) (Icon)
Thumbnail (string) or Thumbnail (null) (Thumbnail)
InputMetadata (object) or null
UserMetadata (object) or null
Array of Fieldmetadata (objects) or Fieldmetadata (null) (Fieldmetadata)
InputOrigin (object) or null
Extra (object) or null
Hidden (boolean) or Hidden (null) (Hidden)
object (Files)
Default: {}

Dictionary of file fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Links)
Default: {}

Dictionary of link fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Texts)
Default: {}

Dictionary of text fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Conversations)
Default: {}

Dictionary of conversation fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

PushProcessingOptions (object) or null
Default: {"ml_text":true}
ResourceSecurity (object) or Security (null) (Security)

Security metadata for the resource. It can be used to have fine-grained control over who can access the resource.

Responses

Request samples

Content type
application/json
Example
{
  • "title": "string",
  • "summary": "string",
  • "slug": "string",
  • "icon": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "origin": {
    },
  • "extra": {
    },
  • "hidden": true,
  • "files": { },
  • "links": { },
  • "texts": { },
  • "conversations": { },
  • "processing_options": {
    },
  • "security": {
    }
}

Response samples

Content type
application/json
null

Upload data on a Resource (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Upload information


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
rslug
required
string (Rslug)
field
required
string (Field) ^[a-zA-Z0-9:_-]+$
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Knowledge Boxes

NucliaDB Knowledge Box endpoints

NOTE:

Except for getting a Knowledge box or listing Knowledge boxes, the rest of operations may be not available in your NucliaDB instance. Creating and managing Knowledge Boxes directly from NucliaDB is available only on standalone usage. If you have a NucliaDB Cloud or a NucliaDB On-prem, you need to manage them from the global API.

Get Knowledge Box (by slug)


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • MANAGER
  • READER
path Parameters
slug
required
string (Slug)

Responses

Response samples

Content type
application/json
{
  • "slug": "string",
  • "uuid": "string",
  • "config": {
    },
  • "model": {
    }
}

Get Knowledge Box


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • MANAGER
  • READER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "slug": "string",
  • "uuid": "string",
  • "config": {
    },
  • "model": {
    }
}

Knowledgebox Models Configuration

Current configuration of models assigned to a knowledgebox

path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "semantic_model": "string",
  • "anonymization_model": "string",
  • "generative_model": "string",
  • "ner_model": "string",
  • "semantic_vector_similarity": "string",
  • "semantic_vector_size": 0
}

Update Knowledge Box models configuration

Update current configuration of models assigned to a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Create Knowledge Box models configuration

Create configuration of models assigned to a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Knowledgebox Counters

Summary of amount of different things inside a knowledgebox

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
  • MANAGER
path Parameters
kbid
required
string (Kbid)
query Parameters
debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

Responses

Response samples

Content type
application/json
{
  • "resources": 0,
  • "paragraphs": 0,
  • "fields": 0,
  • "sentences": 0,
  • "shards": [
    ],
  • "index_size": 0
}

Start an export of a Knowledge Box


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • MANAGER
  • WRITER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "export_id": "string"
}

Download a Knowledge Box export


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • MANAGER
  • READER
path Parameters
kbid
required
string (Kbid)
export_id
required
string (Export Id)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Get the status of a Knowledge Box Export


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • MANAGER
  • READER
path Parameters
kbid
required
string (Kbid)
export_id
required
string (Export Id)

Responses

Response samples

Content type
application/json
{
  • "status": "scheduled",
  • "total": 0,
  • "processed": 0,
  • "retries": 0
}

Start an import to a Knowledge Box


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • MANAGER
  • WRITER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "import_id": "string"
}

Get the status of a Knowledge Box Import


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • MANAGER
  • READER
path Parameters
kbid
required
string (Kbid)
import_id
required
string (Import Id)

Responses

Response samples

Content type
application/json
{
  • "status": "scheduled",
  • "total": 0,
  • "processed": 0,
  • "retries": 0
}

Upload binary file on a Knowledge Box

Upload a file onto a Knowledge Box, field id will be file and rid will be autogenerated.

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
header Parameters
Array of X-Filename (strings) or X-Filename (null) (X-Filename)
Array of X-Password (strings) or X-Password (null) (X-Password)
Array of X-Language (strings) or X-Language (null) (X-Language)
Array of X-Md5 (strings) or X-Md5 (null) (X-Md5)

Responses

Response samples

Content type
application/json
{
  • "seqid": 0,
  • "uuid": "string",
  • "field_id": "string"
}

Learning Configuration Schema

Get jsonschema definition for learning_configuration field of knowledgebox creation payload

Responses

Response samples

Content type
application/json
{ }

Knowledge Box TUS uploads

Endpoints for TUS Resumable File Uploads protocol. This endpoints are compliant with the TUS protocol. It is usually preferable to use them through a TUS client library in your language.

We also support the Creation extension on top of the Core TUS protocol

See https://tus.io/ for more info.

Create new upload on a Knowledge Box


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
Any of
Title (string) or Title (null) (Title)
Summary (string) or Summary (null) (Summary)
Slug (string) or Slug (null) (Slug)

The slug is the user-defined id for the resource

Icon (string) or Icon (null) (Icon)
Thumbnail (string) or Thumbnail (null) (Thumbnail)
InputMetadata (object) or null
UserMetadata (object) or null
Array of Fieldmetadata (objects) or Fieldmetadata (null) (Fieldmetadata)
InputOrigin (object) or null
Extra (object) or null
Hidden (boolean) or Hidden (null) (Hidden)
object (Files)
Default: {}

Dictionary of file fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Links)
Default: {}

Dictionary of link fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Texts)
Default: {}

Dictionary of text fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

object (Conversations)
Default: {}

Dictionary of conversation fields to be added to the resource. The keys correspond to the field id, and must comply with the regex: ^[a-zA-Z0-9:_-]+$

PushProcessingOptions (object) or null
Default: {"ml_text":true}
ResourceSecurity (object) or Security (null) (Security)

Security metadata for the resource. It can be used to have fine-grained control over who can access the resource.

Responses

Request samples

Content type
application/json
Example
{
  • "title": "string",
  • "summary": "string",
  • "slug": "string",
  • "icon": "string",
  • "thumbnail": "string",
  • "metadata": {
    },
  • "usermetadata": {
    },
  • "fieldmetadata": [
    ],
  • "origin": {
    },
  • "extra": {
    },
  • "hidden": true,
  • "files": { },
  • "links": { },
  • "texts": { },
  • "conversations": { },
  • "processing_options": {
    },
  • "security": {
    }
}

Response samples

Content type
application/json
null

TUS Server information

path Parameters
kbid
required
string (Kbid)
query Parameters
Rid (string) or Rid (null) (Rid)
Rslug (string) or Rslug (null) (Rslug)
Upload Id (string) or Upload Id (null) (Upload Id)
Field (string) or Field (null) (Field)

Responses

Response samples

Content type
application/json
null

Upload data on a Knowledge Box


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Upload information


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Knowledge Box Services

NucliaDB labels & entities endpoints

Get Knowledge Box Custom Synonyms


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "synonyms": {
    }
}

Set Knowledge Box Custom Synonyms


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
required
object (Synonyms)
property name*
additional property
Array of strings

Responses

Request samples

Content type
application/json
{
  • "synonyms": {
    }
}

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Delete Knowledge Box Custom Synonyms


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Get a Knowledge Box Entities Group


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
group
required
string (Group)

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "color": "string",
  • "custom": false,
  • "entities": { }
}

Update Knowledge Box Entities Group


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
group
required
string (Group)
Request Body schema: application/json
required
Title (string) or Title (null) (Title)
Color (string) or Color (null) (Color)
object (Add)
Default: {}
object (Update)
Default: {}
delete
Array of strings (Delete)
Default: []

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "color": "string",
  • "add": { },
  • "update": { },
  • "delete": [ ]
}

Response samples

Content type
application/json
null

Delete Knowledge Box Entities


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
group
required
string (Group)

Responses

Response samples

Content type
application/json
null

Get Knowledge Box Entities


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
query Parameters
show_entities
boolean (Show Entities)
Default: false

Responses

Response samples

Content type
application/json
{
  • "uuid": "string",
  • "groups": { }
}

Create Knowledge Box Entities Group


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
group
required
string (Group)
object (Entities)
Default: {}
Title (string) or Title (null) (Title)
Color (string) or Color (null) (Color)

Responses

Request samples

Content type
application/json
{
  • "group": "string",
  • "entities": { },
  • "title": "string",
  • "color": "string"
}

Response samples

Content type
application/json
null

Get a Knowledge Box Label Set


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
labelset
required
string (Labelset)

Responses

Response samples

Content type
application/json
{
  • "title": "no title",
  • "color": "blue",
  • "multiple": true,
  • "kind": [ ],
  • "labels": [ ]
}

Set Knowledge Box Labels


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
labelset
required
string (Labelset)
Request Body schema: application/json
required
Title (string) or Title (null) (Title)
Default: "no title"
Color (string) or Color (null) (Color)
Default: "blue"
multiple
boolean (Multiple)
Default: true
kind
Array of strings (Kind)
Default: []
Items Enum: "RESOURCES" "PARAGRAPHS" "SENTENCES" "SELECTIONS"
Array of objects (Labels)
Default: []

Responses

Request samples

Content type
application/json
{
  • "title": "no title",
  • "color": "blue",
  • "multiple": true,
  • "kind": [ ],
  • "labels": [ ]
}

Response samples

Content type
application/json
null

Delete Knowledge Box Label


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • WRITER
path Parameters
kbid
required
string (Kbid)
labelset
required
string (Labelset)

Responses

Response samples

Content type
application/json
null

Get Knowledge Box Label Sets


Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "uuid": "string",
  • "labelsets": { }
}

Knowledge Box Notifications Stream

Provides a stream of activity notifications for the given Knowledge Box. The stream will be automatically closed after 2 minutes.

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
null

Knowledge Box Processing Status

Provides the status of the processing of the given Knowledge Box.

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
query Parameters
Cursor (string) or Cursor (null) (Cursor)
Scheduled (boolean) or Scheduled (null) (Scheduled)
limit
integer (Limit)
Default: 20

Responses

Response samples

Content type
application/json
{
  • "results": [ ],
  • "cursor": "string"
}

Models

Models API

Get model metadata

Get metadata for a particular model

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
model_id
required
string (Model Id)

Responses

Response samples

Content type
application/json
null

Get available models

Get available models

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
null

Download the Knowledege Box model

Download the trained model or any other generated file as a result of a training task on a Knowledge Box.

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
model_id
required
string (Model Id)
filename
required
string (Filename)

Responses

Response samples

Content type
application/json
null

Learning configuration schema

Get jsonschema definition to update the learning_configuration of your Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
null

Search

Search API

Ask Knowledge Box

Ask questions on a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:
x-synchronous
boolean (X-Synchronous)
Default: false

When set to true, outputs response as JSON in a non-streaming way. This is slower and requires waiting for entire answer to be ready.

Request Body schema: application/json
required
Audit metadata (object) or Audit metadata (null) (Audit metadata)

A dictionary containing optional audit-specific metadata, such as user_id, environment, or other contextual information. This metadata can be leveraged for filtering and analyzing activity logs in future operations. Each key-value pair represents a piece of metadata relevant to the user's request.

query
required
string (Query) <= 20000 characters

The query to get a generative answer for

top_k
integer (Top k) [ 1 .. 200 ]
Default: 20

The top most relevant results to fetch at the retrieval step. The maximum number of results allowed is 200.

fields
Array of strings (Fields)
Default: []

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

Array of Filters (strings) or Array of Filters (objects) (Filters)
Default: []

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Array of Keyword filters (strings) or Array of Keyword filters (objects) (Keyword filters)
Default: []

List of keyword filter expressions to apply to the retrieval step. The text block search will only be performed on the documents that contain the specified keywords. The filters are case-insensitive, and only alphanumeric characters and spaces are allowed. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Vectorset (string) or Vectorset (null) (Vectorset)

Vectors index to perform the search in. If not provided, NucliaDB will use the default one

Minimum score (number) or MinScore (object) or Minimum score (null) (Minimum score)

Minimum score to filter search results. Results with a lower score will be ignored. Accepts either a float or a dictionary with the minimum scores for the bm25 and vector indexes. If a float is provided, it is interpreted as the minimum score for vector index search.

features
Array of strings (Chat features)
Default: ["semantic","keyword"]
Items Enum: "keyword" "relations" "semantic"

Features enabled for the chat endpoint. Semantic search is done if semantic is included. If keyword is included, the results will include matching paragraphs from the bm25 index. If relations is included, a graph of entities related to the answer is returned. paragraphs and vectors are deprecated, please use keyword and semantic instead

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

show
Array of strings (Show metadata)
Default: ["basic"]
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type_filter
Array of strings (Field type filter)
Default: ["text","file","link","conversation","generic"]
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Deprecated
Default: []
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

shards
Array of strings (Shards)
Default: []

The list of shard replicas to search in. If empty, random replicas will be selected.

Array of Chat history (objects) or Chat history (null) (Chat history)

Use to rephrase the new LLM query by taking into account the chat conversation history

Array of Extra query context (strings) or Extra query context (null) (Extra query context)

Additional context that is added to the retrieval context sent to the LLM. It allows extending the chat feature with content that may not be in the Knowledge Box.

autofilter
boolean (Automatic search filtering)
Default: false

If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

resource_filters
Array of strings (Resources filter)
Default: []

List of resource ids to filter search results for. Only paragraphs from the specified resources will be returned.

Prompts (string) or CustomPrompt (object) or Prompts (null) (Prompts)

Use to customize the prompts given to the generative model. Both system and user prompts can be customized. If a string is provided, it is interpreted as the user prompt.

reranker
string (Reranker)
Enum: "multi_match_booster" "predict" "noop"

Rerankers

  • Multi-match booster (default, deprecated): given a set of results from different sources, e.g., keyword and semantic search boost results appearing in both sets

  • Predict reranker: after retrieval, send the results to Predict API to rerank it. This method uses a reranker model, so one can expect better results at the expense of more latency.

    This will be the new default

  • No-operation (noop) reranker: maintain order and do not rerank the results after retrieval

citations
boolean (Citations)
Default: false

Whether to include the citations for the answer in the response

Citation Threshold (number) or Citation Threshold (null) (Citation Threshold)

If citations is True, this sets the similarity threshold (0 to 1) for paragraphs to be included as citations. Lower values result in more citations. If not provided, Nuclia's default threshold is used.

RequestSecurity (object) or Security (null) (Security)

Security metadata for the request. If not provided, the search request is done without the security lookup phase.

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

Array of any (RAG context building strategies)
Default: []

Options for tweaking how the context for the LLM model is crafted:

  • full_resource will add the full text of the matching resources to the context. This strategy cannot be combined with hierarchy, neighbouring_paragraphs, or field_extension.
  • field_extension will add the text of the matching resource's specified fields to the context.
  • hierarchy will add the title and summary text of the parent resource to the context for each matching paragraph.
  • neighbouring_paragraphs will add the sorrounding paragraphs to the context for each matching paragraph.
  • metadata_extension will add the metadata of the matching paragraphs or its resources to the context.
  • prequeries allows to run multiple retrieval queries before the main query and add the results to the context. The results of specific queries can be boosted by the specifying weights.

If empty, the default strategy is used, which simply adds the text of the matching paragraphs to the context.

Array of any (RAG image context building strategies)
Default: []

Options for tweaking how the image based context for the LLM model is crafted:

  • page_image will add the full page image of the matching resources to the context.
  • tables will send the table images for the paragraphs that contain tables and matched the retrieval query.
  • paragraph_image will add the images of the paragraphs that contain images (images for tables are not included). No image strategy is used by default. Note that this is only available for LLM models that support visual inputs. If the model does not support visual inputs, the image strategies will be ignored.
debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

Generative model (string) or Generative model (null) (Generative model)

The generative model to use for the chat endpoint. If not provided, the model configured for the Knowledge Box is used.

Maximum LLM tokens to use for the request (integer) or MaxTokens (object) or Maximum LLM tokens to use for the request (null) (Maximum LLM tokens to use for the request)

Use to limit the amount of tokens used in the LLM context and/or for generating the answer. If not provided, the default maximum tokens of the generative model will be used. If an integer is provided, it is interpreted as the maximum tokens for the answer.

rephrase
boolean (Rephrase)
Default: false

Rephrase the query for a more efficient retrieval. This will consume LLM tokens and make the request slower.

prefer_markdown
boolean (Prefer markdown)
Default: false

If set to true, the response will be in markdown format

Answer JSON schema (object) or Answer JSON schema (null) (Answer JSON schema)

Desired JSON schema for the LLM answer. This schema is passed to the LLM so that it answers in a scructured format following the schema. If not provided, textual response is returned. Note that when using this parameter, the answer in the generative response will not be returned in chunks, the whole response text will be returned instead. Using this feature also disables the citations parameter. For maximal accuracy, please include a description for each field of the schema.

Responses

Request samples

Content type
application/json
{
  • "audit_metadata": {
    },
  • "query": "string",
  • "top_k": 20,
  • "fields": [ ],
  • "filters": [ ],
  • "keyword_filters": [
    ],
  • "vectorset": "string",
  • "min_score": 0,
  • "features": [
    ],
  • "range_creation_start": "2019-08-24T14:15:22Z",
  • "range_creation_end": "2019-08-24T14:15:22Z",
  • "range_modification_start": "2019-08-24T14:15:22Z",
  • "range_modification_end": "2019-08-24T14:15:22Z",
  • "show": [
    ],
  • "field_type_filter": [
    ],
  • "extracted": [ ],
  • "shards": [ ],
  • "context": [
    ],
  • "extra_context": [
    ],
  • "autofilter": false,
  • "highlight": false,
  • "resource_filters": [ ],
  • "prompt": "string",
  • "reranker": "multi_match_booster",
  • "citations": false,
  • "citation_threshold": 1,
  • "security": {
    },
  • "show_hidden": false,
  • "rag_strategies": [
    ],
  • "rag_images_strategies": [ ],
  • "debug": false,
  • "generative_model": "string",
  • "max_tokens": 0,
  • "rephrase": false,
  • "prefer_markdown": false,
  • "answer_json_schema": {
    }
}

Response samples

Content type
application/json
{
  • "answer": "string",
  • "answer_json": { },
  • "status": "string",
  • "retrieval_results": {
    },
  • "retrieval_best_matches": [ ],
  • "prequeries": {
    },
  • "learning_id": "",
  • "relations": {
    },
  • "citations": { },
  • "prompt_context": [
    ],
  • "metadata": {
    },
  • "error_details": "string"
}

List resources of a Knowledge Box

List resources of a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
query Parameters
query
string (Query) <= 20000 characters
Default: ""

The query to search for

filters
Array of strings (Filters)
Default: ""

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

faceted
Array of strings (Faceted) <= 50 items
Default: ""

The list of facets to calculate. The facets follow the same syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

sort_field
string (SortField)
Enum: "score" "created" "modified" "title"

Field to sort results with (Score not supported in catalog)

Sort limit (integer) or Sort limit (null) (Sort limit)
sort_order
string (SortOrder)
Enum: "asc" "desc"

Order to sort results with

page_number
integer (Page number)
Default: 0

The page number of the results to return. ATENTION: pagination is deprecated and this parameter will be removed soon. Please, use top_k instead

page_size
integer (Page size) <= 200
Default: 20

The number of results to return per page. The maximum number of results per page allowed is 200. ATENTION: pagination is deprecated and will be removed soon, pleas use to top_k instead

shards
Array of strings (Shards)
Deprecated
Default: ""

The list of shard replicas to search in. If empty, random replicas will be selected.

ResourceProcessingStatus (string) or With processing status (null) (With processing status)
Deprecated

Filter results by resource processing status

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Filter resources by hidden (boolean) or Filter resources by hidden (null) (Filter resources by hidden)

Set to filter only hidden or only non-hidden resources. Default is to return everything

Responses

Response samples

Content type
application/json
{
  • "resources": { },
  • "sentences": {
    },
  • "paragraphs": {
    },
  • "fulltext": {
    },
  • "relations": {
    },
  • "nodes": [
    ],
  • "shards": [
    ],
  • "autofilters": [ ]
}

List resources of a Knowledge Box

List resources of a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
query
string (Query) <= 20000 characters
Default: ""

The query to search for

Array of Filters (strings) or Array of Filters (objects) (Filters)
Default: []

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

faceted
Array of strings (Faceted) <= 50 items
Default: []

The list of facets to calculate. The facets follow the same syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

SortOptions (object) or Sort options (null) (Sort options)

Options for results sorting

page_number
integer (Page number)
Default: 0

The page number of the results to return

page_size
integer (Page size) <= 200
Default: 20

The number of results to return per page. The maximum number of results per page allowed is 200.

shards
Array of strings (Shards)
Deprecated
Default: []

The list of shard replicas to search in. If empty, random replicas will be selected.

ResourceProcessingStatus (string) or With processing status (null) (With processing status)
Deprecated

Filter results by resource processing status

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Filter resources by hidden (boolean) or Filter resources by hidden (null) (Filter resources by hidden)

Set to filter only hidden or only non-hidden resources. Default is to return everything

Responses

Request samples

Content type
application/json
{
  • "query": "",
  • "filters": [ ],
  • "faceted": [ ],
  • "sort": {
    },
  • "page_number": 0,
  • "page_size": 20,
  • "shards": [ ],
  • "with_status": "PENDING",
  • "range_creation_start": "2019-08-24T14:15:22Z",
  • "range_creation_end": "2019-08-24T14:15:22Z",
  • "range_modification_start": "2019-08-24T14:15:22Z",
  • "range_modification_end": "2019-08-24T14:15:22Z",
  • "hidden": true
}

Response samples

Content type
application/json
{
  • "resources": { },
  • "sentences": {
    },
  • "paragraphs": {
    },
  • "fulltext": {
    },
  • "relations": {
    },
  • "nodes": [
    ],
  • "shards": [
    ],
  • "autofilters": [ ]
}

Send Feedback

Send feedback for a search operation in a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:
Request Body schema: application/json
required
ident
required
string (Request identifier)

Id of the request to provide feedback for. This id is returned in the response header Nuclia-Learning-Id of the chat endpoint.

good
required
boolean (Good)

Whether the result was good or not

task
required
string (FeedbackTasks)
Value: "CHAT"
Value: "CHAT"
Feedback (string) or Feedback (null) (Feedback)

Feedback text

Text block (string) or Text block (null) (Text block)

Text block id

Responses

Request samples

Content type
application/json
{
  • "ident": "string",
  • "good": true,
  • "task": "CHAT",
  • "feedback": "string",
  • "text_block_id": "string"
}

Response samples

Content type
application/json
null

Find Knowledge Box

Find on a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
query Parameters
query
string (Query) <= 20000 characters
Default: ""

The query to search for

fields
Array of strings (Fields)
Default: ""

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

filters
Array of strings (Filters)
Default: ""

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

page_number
integer (Page number)
Default: 0

The page number of the results to return. ATENTION: pagination is deprecated and this parameter will be removed soon. Please, use top_k instead

page_size
integer (Page size) <= 200
Default: 20

The number of results to return per page. The maximum number of results per page allowed is 200. ATENTION: pagination is deprecated and will be removed soon, pleas use to top_k instead

Top k (integer) or Top k (null) (Top k)

The number of results search should return. The maximum number of results allowed is 200.

Min Score (number) or Min Score (null) (Min Score)
Deprecated

Minimum similarity score to filter vector index results. If not specified, the default minimum score of the semantic model associated to the Knowledge Box will be used. Check out the documentation for more information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score

Min Score Semantic (number) or Min Score Semantic (null) (Min Score Semantic)

Minimum semantic similarity score to filter vector index results. If not specified, the default minimum score of the semantic model associated to the Knowledge Box will be used. Check out the documentation for more information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score

min_score_bm25
number (Min Score Bm25) >= 0
Default: 0

Minimum bm25 score to filter paragraph and document index results

Vectorset (string) or Vectorset (null) (Vectorset)

Vectors index to perform the search in. If not provided, NucliaDB will use the default one

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

features
Array of strings (Search features)
Default: "keyword&features=semantic"
Items Enum: "fulltext" "keyword" "relations" "semantic"

List of search features to use. Each value corresponds to a lookup into on of the different indexes

debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

show
Array of strings (Show metadata)
Default: "basic"
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type
Array of strings (Field type filter)
Default: "text&field_type=file&field_type=link&field_type=conversation&field_type=generic"
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Default: ""
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

with_duplicates
boolean (With duplicate paragraphs)
Default: false

Whether to return duplicate paragraphs on the same document

with_synonyms
boolean (With custom synonyms)
Default: false

Whether to return matches for custom knowledge box synonyms of the query terms. Note: only supported for keyword and fulltext search options.

autofilter
boolean (Automatic search filtering)
Default: false

If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query

security_groups
Array of strings (Security groups)
Default: ""

List of security groups to filter search results for. Only resources matching the query and containing the specified security groups will be returned. If empty, all resources will be considered for the search.

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

reranker
string (Reranker)
Enum: "multi_match_booster" "predict" "noop"

Reranker let you specify which method you want to use to rerank your results at the end of retrieval DEPRECATION! multi_match_booster will be deprecated and predict will be the new default

header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:
X-Nidx (string) or X-Nidx (null) (X-Nidx)

Responses

Response samples

Content type
application/json
{
  • "resources": {
    },
  • "relations": {
    },
  • "query": "string",
  • "total": 0,
  • "page_number": 0,
  • "page_size": 20,
  • "next_page": false,
  • "nodes": [
    ],
  • "shards": [
    ],
  • "autofilters": [ ],
  • "min_score": {
    },
  • "best_matches": [ ]
}

Find Knowledge Box

Find on a Knowledge Box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:
X-Nidx (string) or X-Nidx (null) (X-Nidx)
Request Body schema: application/json
required
Audit metadata (object) or Audit metadata (null) (Audit metadata)

A dictionary containing optional audit-specific metadata, such as user_id, environment, or other contextual information. This metadata can be leveraged for filtering and analyzing activity logs in future operations. Each key-value pair represents a piece of metadata relevant to the user's request.

query
string (Query) <= 20000 characters
Default: ""

The query to search for

fields
Array of strings (Fields)
Default: []

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

Array of Filters (strings) or Array of Filters (objects) (Filters)
Default: []

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

page_number
integer (Page number)
Deprecated
Default: 0

The page number of the results to return. ATENTION: pagination is deprecated and this parameter will be removed soon. Please, use top_k instead

page_size
integer (Page size) <= 200
Deprecated
Default: 20

The number of results to return per page. The maximum number of results per page allowed is 200. ATENTION: pagination is deprecated and will be removed soon, pleas use to top_k instead

Top k (integer) or Top k (null) (Top k)

The number of results search should return. The maximum number of results allowed is 200.

Minimum score (number) or MinScore (object) or Minimum score (null) (Minimum score)

Minimum score to filter search results. Results with a lower score will be ignored. Accepts either a float or a dictionary with the minimum scores for the bm25 and vector indexes. If a float is provided, it is interpreted as the minimum score for vector index search.

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

features
Array of strings (Search features)
Default: ["keyword","semantic"]
Items Enum: "fulltext" "keyword" "relations" "semantic"

List of search features to use. Each value corresponds to a lookup into on of the different indexes

debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

show
Array of strings (Show metadata)
Default: ["basic"]
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type_filter
Array of strings (Field type filter)
Default: ["text","file","link","conversation","generic"]
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Deprecated
Default: []
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

shards
Array of strings (Shards)
Default: []

The list of shard replicas to search in. If empty, random replicas will be selected.

Array of Search Vector (numbers) or Search Vector (null) (Search Vector)

The vector to perform the search with. If not provided, NucliaDB will use Nuclia Predict API to create the vector off from the query.

Vectorset (string) or Vectorset (null) (Vectorset)

Vectors index to perform the search in. If not provided, NucliaDB will use the default one

with_duplicates
boolean (With duplicate paragraphs)
Default: false

Whether to return duplicate paragraphs on the same document

with_synonyms
boolean (With custom synonyms)
Default: false

Whether to return matches for custom knowledge box synonyms of the query terms. Note: only supported for keyword and fulltext search options.

autofilter
boolean (Automatic search filtering)
Default: false

If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query

resource_filters
Array of strings (Resources filter)
Default: []

List of resource ids to filter search results for. Only paragraphs from the specified resources will be returned.

RequestSecurity (object) or Security (null) (Security)

Security metadata for the request. If not provided, the search request is done without the security lookup phase.

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

rephrase
boolean (Rephrase)
Default: false

Rephrase the query for a more efficient retrieval. This will consume LLM tokens and make the request slower.

Rephrase (string) or Rephrase (null) (Rephrase)

Rephrase prompt given to the generative model responsible for rephrasing the query for a more effective retrieval step. This is only used if the rephrase flag is set to true in the request. If not specified, Nuclia's default prompt is used. It must include the {question} placeholder. The placeholder will be replaced with the original question

reranker
string (Reranker)
Enum: "multi_match_booster" "predict" "noop"

Rerankers

  • Multi-match booster (default, deprecated): given a set of results from different sources, e.g., keyword and semantic search boost results appearing in both sets

  • Predict reranker: after retrieval, send the results to Predict API to rerank it. This method uses a reranker model, so one can expect better results at the expense of more latency.

    This will be the new default

  • No-operation (noop) reranker: maintain order and do not rerank the results after retrieval

Array of Keyword filters (strings) or Array of Keyword filters (objects) (Keyword filters)
Default: []

List of keyword filter expressions to apply to the retrieval step. The text block search will only be performed on the documents that contain the specified keywords. The filters are case-insensitive, and only alphanumeric characters and spaces are allowed. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Responses

Request samples

Content type
application/json

Perform a hybrid search that will return text and semantic results matching the query

{
  • "query": "How can I be an effective product manager?",
  • "features": [
    ]
}

Response samples

Content type
application/json
{
  • "resources": {
    },
  • "relations": {
    },
  • "query": "string",
  • "total": 0,
  • "page_number": 0,
  • "page_size": 20,
  • "next_page": false,
  • "nodes": [
    ],
  • "shards": [
    ],
  • "autofilters": [ ],
  • "min_score": {
    },
  • "best_matches": [ ]
}

Predict API Proxy

Convenience endpoint that proxies requests to the Predict API. It adds the Knowledge Box configuration settings as headers to the predict API request. Refer to the Predict API documentation for more details about the request and response models: https://docs.nuclia.dev/docs/nua-api#tag/Predict

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
endpoint
required
string (PredictProxiedEndpoints)
Enum: "tokens" "chat" "rephrase"

Enum for the different endpoints that are proxied to the Predict API

Responses

Response samples

Content type
application/json
null

Predict API Proxy

Convenience endpoint that proxies requests to the Predict API. It adds the Knowledge Box configuration settings as headers to the predict API request. Refer to the Predict API documentation for more details about the request and response models: https://docs.nuclia.dev/docs/nua-api#tag/Predict

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
endpoint
required
string (PredictProxiedEndpoints)
Enum: "tokens" "chat" "rephrase"

Enum for the different endpoints that are proxied to the Predict API

Responses

Response samples

Content type
application/json
null

Ask a resource (by id)

Ask questions to a resource

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:
x-synchronous
boolean (X-Synchronous)
Default: false

When set to true, outputs response as JSON in a non-streaming way. This is slower and requires waiting for entire answer to be ready.

Request Body schema: application/json
required
Audit metadata (object) or Audit metadata (null) (Audit metadata)

A dictionary containing optional audit-specific metadata, such as user_id, environment, or other contextual information. This metadata can be leveraged for filtering and analyzing activity logs in future operations. Each key-value pair represents a piece of metadata relevant to the user's request.

query
required
string (Query) <= 20000 characters

The query to get a generative answer for

top_k
integer (Top k) [ 1 .. 200 ]
Default: 20

The top most relevant results to fetch at the retrieval step. The maximum number of results allowed is 200.

fields
Array of strings (Fields)
Default: []

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

Array of Filters (strings) or Array of Filters (objects) (Filters)
Default: []

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Array of Keyword filters (strings) or Array of Keyword filters (objects) (Keyword filters)
Default: []

List of keyword filter expressions to apply to the retrieval step. The text block search will only be performed on the documents that contain the specified keywords. The filters are case-insensitive, and only alphanumeric characters and spaces are allowed. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Vectorset (string) or Vectorset (null) (Vectorset)

Vectors index to perform the search in. If not provided, NucliaDB will use the default one

Minimum score (number) or MinScore (object) or Minimum score (null) (Minimum score)

Minimum score to filter search results. Results with a lower score will be ignored. Accepts either a float or a dictionary with the minimum scores for the bm25 and vector indexes. If a float is provided, it is interpreted as the minimum score for vector index search.

features
Array of strings (Chat features)
Default: ["semantic","keyword"]
Items Enum: "keyword" "relations" "semantic"

Features enabled for the chat endpoint. Semantic search is done if semantic is included. If keyword is included, the results will include matching paragraphs from the bm25 index. If relations is included, a graph of entities related to the answer is returned. paragraphs and vectors are deprecated, please use keyword and semantic instead

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

show
Array of strings (Show metadata)
Default: ["basic"]
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type_filter
Array of strings (Field type filter)
Default: ["text","file","link","conversation","generic"]
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Deprecated
Default: []
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

shards
Array of strings (Shards)
Default: []

The list of shard replicas to search in. If empty, random replicas will be selected.

Array of Chat history (objects) or Chat history (null) (Chat history)

Use to rephrase the new LLM query by taking into account the chat conversation history

Array of Extra query context (strings) or Extra query context (null) (Extra query context)

Additional context that is added to the retrieval context sent to the LLM. It allows extending the chat feature with content that may not be in the Knowledge Box.

autofilter
boolean (Automatic search filtering)
Default: false

If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

resource_filters
Array of strings (Resources filter)
Default: []

List of resource ids to filter search results for. Only paragraphs from the specified resources will be returned.

Prompts (string) or CustomPrompt (object) or Prompts (null) (Prompts)

Use to customize the prompts given to the generative model. Both system and user prompts can be customized. If a string is provided, it is interpreted as the user prompt.

reranker
string (Reranker)
Enum: "multi_match_booster" "predict" "noop"

Rerankers

  • Multi-match booster (default, deprecated): given a set of results from different sources, e.g., keyword and semantic search boost results appearing in both sets

  • Predict reranker: after retrieval, send the results to Predict API to rerank it. This method uses a reranker model, so one can expect better results at the expense of more latency.

    This will be the new default

  • No-operation (noop) reranker: maintain order and do not rerank the results after retrieval

citations
boolean (Citations)
Default: false

Whether to include the citations for the answer in the response

Citation Threshold (number) or Citation Threshold (null) (Citation Threshold)

If citations is True, this sets the similarity threshold (0 to 1) for paragraphs to be included as citations. Lower values result in more citations. If not provided, Nuclia's default threshold is used.

RequestSecurity (object) or Security (null) (Security)

Security metadata for the request. If not provided, the search request is done without the security lookup phase.

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

Array of any (RAG context building strategies)
Default: []

Options for tweaking how the context for the LLM model is crafted:

  • full_resource will add the full text of the matching resources to the context. This strategy cannot be combined with hierarchy, neighbouring_paragraphs, or field_extension.
  • field_extension will add the text of the matching resource's specified fields to the context.
  • hierarchy will add the title and summary text of the parent resource to the context for each matching paragraph.
  • neighbouring_paragraphs will add the sorrounding paragraphs to the context for each matching paragraph.
  • metadata_extension will add the metadata of the matching paragraphs or its resources to the context.
  • prequeries allows to run multiple retrieval queries before the main query and add the results to the context. The results of specific queries can be boosted by the specifying weights.

If empty, the default strategy is used, which simply adds the text of the matching paragraphs to the context.

Array of any (RAG image context building strategies)
Default: []

Options for tweaking how the image based context for the LLM model is crafted:

  • page_image will add the full page image of the matching resources to the context.
  • tables will send the table images for the paragraphs that contain tables and matched the retrieval query.
  • paragraph_image will add the images of the paragraphs that contain images (images for tables are not included). No image strategy is used by default. Note that this is only available for LLM models that support visual inputs. If the model does not support visual inputs, the image strategies will be ignored.
debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

Generative model (string) or Generative model (null) (Generative model)

The generative model to use for the chat endpoint. If not provided, the model configured for the Knowledge Box is used.

Maximum LLM tokens to use for the request (integer) or MaxTokens (object) or Maximum LLM tokens to use for the request (null) (Maximum LLM tokens to use for the request)

Use to limit the amount of tokens used in the LLM context and/or for generating the answer. If not provided, the default maximum tokens of the generative model will be used. If an integer is provided, it is interpreted as the maximum tokens for the answer.

rephrase
boolean (Rephrase)
Default: false

Rephrase the query for a more efficient retrieval. This will consume LLM tokens and make the request slower.

prefer_markdown
boolean (Prefer markdown)
Default: false

If set to true, the response will be in markdown format

Answer JSON schema (object) or Answer JSON schema (null) (Answer JSON schema)

Desired JSON schema for the LLM answer. This schema is passed to the LLM so that it answers in a scructured format following the schema. If not provided, textual response is returned. Note that when using this parameter, the answer in the generative response will not be returned in chunks, the whole response text will be returned instead. Using this feature also disables the citations parameter. For maximal accuracy, please include a description for each field of the schema.

Responses

Request samples

Content type
application/json
{
  • "audit_metadata": {
    },
  • "query": "string",
  • "top_k": 20,
  • "fields": [ ],
  • "filters": [ ],
  • "keyword_filters": [
    ],
  • "vectorset": "string",
  • "min_score": 0,
  • "features": [
    ],
  • "range_creation_start": "2019-08-24T14:15:22Z",
  • "range_creation_end": "2019-08-24T14:15:22Z",
  • "range_modification_start": "2019-08-24T14:15:22Z",
  • "range_modification_end": "2019-08-24T14:15:22Z",
  • "show": [
    ],
  • "field_type_filter": [
    ],
  • "extracted": [ ],
  • "shards": [ ],
  • "context": [
    ],
  • "extra_context": [
    ],
  • "autofilter": false,
  • "highlight": false,
  • "resource_filters": [ ],
  • "prompt": "string",
  • "reranker": "multi_match_booster",
  • "citations": false,
  • "citation_threshold": 1,
  • "security": {
    },
  • "show_hidden": false,
  • "rag_strategies": [
    ],
  • "rag_images_strategies": [ ],
  • "debug": false,
  • "generative_model": "string",
  • "max_tokens": 0,
  • "rephrase": false,
  • "prefer_markdown": false,
  • "answer_json_schema": {
    }
}

Response samples

Content type
application/json
{
  • "answer": "string",
  • "answer_json": { },
  • "status": "string",
  • "retrieval_results": {
    },
  • "retrieval_best_matches": [ ],
  • "prequeries": {
    },
  • "learning_id": "",
  • "relations": {
    },
  • "citations": { },
  • "prompt_context": [
    ],
  • "metadata": {
    },
  • "error_details": "string"
}

Search on Resource

Search on a single resource

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
rid
required
string (Rid)
query Parameters
query
required
string (Query)
fields
Array of strings (Fields)
Default: ""

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

filters
Array of strings (Filters)
Default: ""

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

faceted
Array of strings (Faceted) <= 50 items
Default: ""

The list of facets to calculate. The facets follow the same syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

SortField (string) or Sort field (null) (Sort field)

Field to sort results with (Score not supported in catalog)

sort_order
string (SortOrder)
Enum: "asc" "desc"

Order to sort results with

page_number
integer (Page number)
Default: 0

The page number of the results to return. ATENTION: pagination is deprecated and this parameter will be removed soon. Please, use top_k instead

page_size
integer (Page size) <= 200
Default: 20

The number of results to return per page. The maximum number of results per page allowed is 200. ATENTION: pagination is deprecated and will be removed soon, pleas use to top_k instead

Top k (integer) or Top k (null) (Top k)

The number of results search should return. The maximum number of results allowed is 200.

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

show
Array of strings (Show metadata)
Default: "basic&show=origin&show=extra&show=relations&show=values&show=extracted&show=errors&show=security"
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type
Array of strings (Field type filter)
Default: "text&field_type=file&field_type=link&field_type=conversation&field_type=generic"
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Default: ""
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

shards
Array of strings (Shards)
Default: ""

The list of shard replicas to search in. If empty, random replicas will be selected.

header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"

Responses

Response samples

Content type
application/json
{
  • "sentences": {
    },
  • "paragraphs": {
    },
  • "relations": {
    },
  • "nodes": [
    ],
  • "shards": [
    ]
}

Search Knowledge Box

Search on a Knowledge Box and retrieve separate results for documents, paragraphs, and sentences. Usually, it is better to use find

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
query Parameters
query
string (Query) <= 20000 characters
Default: ""

The query to search for

fields
Array of strings (Fields)
Default: ""

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

filters
Array of strings (Filters)
Default: ""

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

faceted
Array of strings (Faceted) <= 50 items
Default: ""

The list of facets to calculate. The facets follow the same syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

sort_field
string (SortField)
Enum: "score" "created" "modified" "title"

Field to sort results with (Score not supported in catalog)

Sort limit (integer) or Sort limit (null) (Sort limit)
sort_order
string (SortOrder)
Enum: "asc" "desc"

Order to sort results with

page_number
integer (Page number)
Deprecated
Default: 0

The page number of the results to return. ATENTION: pagination is deprecated and this parameter will be removed soon. Please, use top_k instead

page_size
integer (Page size) <= 200
Deprecated
Default: 20

The number of results to return per page. The maximum number of results per page allowed is 200. ATENTION: pagination is deprecated and will be removed soon, pleas use to top_k instead

top_k
integer (Top k) <= 200

The number of results search should return. The maximum number of results allowed is 200.

Min Score (number) or Min Score (null) (Min Score)
Deprecated

Minimum similarity score to filter vector index results. If not specified, the default minimum score of the semantic model associated to the Knowledge Box will be used. Check out the documentation for more information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score

Min Score Semantic (number) or Min Score Semantic (null) (Min Score Semantic)

Minimum semantic similarity score to filter vector index results. If not specified, the default minimum score of the semantic model associated to the Knowledge Box will be used. Check out the documentation for more information on how to use this parameter: https://docs.nuclia.dev/docs/rag/advanced/search#minimum-score

min_score_bm25
number (Min Score Bm25) >= 0
Default: 0

Minimum bm25 score to filter paragraph and document index results

Vectorset (string) or Vectorset (null) (Vectorset)

Vectors index to perform the search in. If not provided, NucliaDB will use the default one

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

features
Array of strings (Search features)
Default: "keyword&features=fulltext&features=semantic"
Items Enum: "fulltext" "keyword" "relations" "semantic"

List of search features to use. Each value corresponds to a lookup into on of the different indexes

debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

show
Array of strings (Show metadata)
Default: "basic"
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type
Array of strings (Field type filter)
Default: "text&field_type=file&field_type=link&field_type=conversation&field_type=generic"
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Default: ""
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

shards
Array of strings (Shards)
Default: ""

The list of shard replicas to search in. If empty, random replicas will be selected.

with_duplicates
boolean (With duplicate paragraphs)
Default: false

Whether to return duplicate paragraphs on the same document

with_synonyms
boolean (With custom synonyms)
Default: false

Whether to return matches for custom knowledge box synonyms of the query terms. Note: only supported for keyword and fulltext search options.

autofilter
boolean (Automatic search filtering)
Default: false

If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query

security_groups
Array of strings (Security groups)
Default: ""

List of security groups to filter search results for. Only resources matching the query and containing the specified security groups will be returned. If empty, all resources will be considered for the search.

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:

Responses

Response samples

Content type
application/json
{
  • "resources": { },
  • "sentences": {
    },
  • "paragraphs": {
    },
  • "fulltext": {
    },
  • "relations": {
    },
  • "nodes": [
    ],
  • "shards": [
    ],
  • "autofilters": [ ]
}

Search Knowledge Box

Search on a Knowledge Box and retrieve separate results for documents, paragraphs, and sentences. Usually, it is better to use find

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:
Request Body schema: application/json
required
Audit metadata (object) or Audit metadata (null) (Audit metadata)

A dictionary containing optional audit-specific metadata, such as user_id, environment, or other contextual information. This metadata can be leveraged for filtering and analyzing activity logs in future operations. Each key-value pair represents a piece of metadata relevant to the user's request.

query
string (Query) <= 20000 characters
Default: ""

The query to search for

fields
Array of strings (Fields)
Default: []

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

Array of Filters (strings) or Array of Filters (objects) (Filters)
Default: []

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

page_number
integer (Page number)
Deprecated
Default: 0

The page number of the results to return. ATENTION: pagination is deprecated and this parameter will be removed soon. Please, use top_k instead

page_size
integer (Page size) <= 200
Deprecated
Default: 20

The number of results to return per page. The maximum number of results per page allowed is 200. ATENTION: pagination is deprecated and will be removed soon, pleas use to top_k instead

Top k (integer) or Top k (null) (Top k)

The number of results search should return. The maximum number of results allowed is 200.

Minimum score (number) or MinScore (object) or Minimum score (null) (Minimum score)

Minimum score to filter search results. Results with a lower score will be ignored. Accepts either a float or a dictionary with the minimum scores for the bm25 and vector indexes. If a float is provided, it is interpreted as the minimum score for vector index search.

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

features
Array of strings (Search features)
Default: ["keyword","fulltext","semantic"]
Items Enum: "fulltext" "keyword" "relations" "semantic"

List of search features to use. Each value corresponds to a lookup into on of the different indexes

debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

show
Array of strings (Show metadata)
Default: ["basic"]
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type_filter
Array of strings (Field type filter)
Default: ["text","file","link","conversation","generic"]
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Deprecated
Default: []
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

shards
Array of strings (Shards)
Default: []

The list of shard replicas to search in. If empty, random replicas will be selected.

Array of Search Vector (numbers) or Search Vector (null) (Search Vector)

The vector to perform the search with. If not provided, NucliaDB will use Nuclia Predict API to create the vector off from the query.

Vectorset (string) or Vectorset (null) (Vectorset)

Vectors index to perform the search in. If not provided, NucliaDB will use the default one

with_duplicates
boolean (With duplicate paragraphs)
Default: false

Whether to return duplicate paragraphs on the same document

with_synonyms
boolean (With custom synonyms)
Default: false

Whether to return matches for custom knowledge box synonyms of the query terms. Note: only supported for keyword and fulltext search options.

autofilter
boolean (Automatic search filtering)
Default: false

If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query

resource_filters
Array of strings (Resources filter)
Default: []

List of resource ids to filter search results for. Only paragraphs from the specified resources will be returned.

RequestSecurity (object) or Security (null) (Security)

Security metadata for the request. If not provided, the search request is done without the security lookup phase.

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

rephrase
boolean (Rephrase)
Default: false

Rephrase the query for a more efficient retrieval. This will consume LLM tokens and make the request slower.

Rephrase (string) or Rephrase (null) (Rephrase)

Rephrase prompt given to the generative model responsible for rephrasing the query for a more effective retrieval step. This is only used if the rephrase flag is set to true in the request. If not specified, Nuclia's default prompt is used. It must include the {question} placeholder. The placeholder will be replaced with the original question

faceted
Array of strings (Faceted) <= 50 items
Default: []

The list of facets to calculate. The facets follow the same syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

SortOptions (object) or Sort options (null) (Sort options)

Options for results sorting

Responses

Request samples

Content type
application/json
Example
{
  • "query": "Noam Chomsky",
  • "filters": [
    ],
  • "features": [
    ]
}

Response samples

Content type
application/json
{
  • "resources": { },
  • "sentences": {
    },
  • "paragraphs": {
    },
  • "fulltext": {
    },
  • "relations": {
    },
  • "nodes": [
    ],
  • "shards": [
    ],
  • "autofilters": [ ]
}

Ask a resource (by slug)

Ask questions to a resource

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
slug
required
string (Slug)
header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:
x-synchronous
boolean (X-Synchronous)
Default: false

When set to true, outputs response as JSON in a non-streaming way. This is slower and requires waiting for entire answer to be ready.

Request Body schema: application/json
required
Audit metadata (object) or Audit metadata (null) (Audit metadata)

A dictionary containing optional audit-specific metadata, such as user_id, environment, or other contextual information. This metadata can be leveraged for filtering and analyzing activity logs in future operations. Each key-value pair represents a piece of metadata relevant to the user's request.

query
required
string (Query) <= 20000 characters

The query to get a generative answer for

top_k
integer (Top k) [ 1 .. 200 ]
Default: 20

The top most relevant results to fetch at the retrieval step. The maximum number of results allowed is 200.

fields
Array of strings (Fields)
Default: []

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

Array of Filters (strings) or Array of Filters (objects) (Filters)
Default: []

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Array of Keyword filters (strings) or Array of Keyword filters (objects) (Keyword filters)
Default: []

List of keyword filter expressions to apply to the retrieval step. The text block search will only be performed on the documents that contain the specified keywords. The filters are case-insensitive, and only alphanumeric characters and spaces are allowed. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Vectorset (string) or Vectorset (null) (Vectorset)

Vectors index to perform the search in. If not provided, NucliaDB will use the default one

Minimum score (number) or MinScore (object) or Minimum score (null) (Minimum score)

Minimum score to filter search results. Results with a lower score will be ignored. Accepts either a float or a dictionary with the minimum scores for the bm25 and vector indexes. If a float is provided, it is interpreted as the minimum score for vector index search.

features
Array of strings (Chat features)
Default: ["semantic","keyword"]
Items Enum: "keyword" "relations" "semantic"

Features enabled for the chat endpoint. Semantic search is done if semantic is included. If keyword is included, the results will include matching paragraphs from the bm25 index. If relations is included, a graph of entities related to the answer is returned. paragraphs and vectors are deprecated, please use keyword and semantic instead

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

show
Array of strings (Show metadata)
Default: ["basic"]
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type_filter
Array of strings (Field type filter)
Default: ["text","file","link","conversation","generic"]
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

extracted
Array of strings (Extracted metadata)
Deprecated
Default: []
Items Enum: "text" "metadata" "shortened_metadata" "large_metadata" "vectors" "link" "file" "question_answers"

[Deprecated] Please use GET resource endpoint instead to get extracted metadata

shards
Array of strings (Shards)
Default: []

The list of shard replicas to search in. If empty, random replicas will be selected.

Array of Chat history (objects) or Chat history (null) (Chat history)

Use to rephrase the new LLM query by taking into account the chat conversation history

Array of Extra query context (strings) or Extra query context (null) (Extra query context)

Additional context that is added to the retrieval context sent to the LLM. It allows extending the chat feature with content that may not be in the Knowledge Box.

autofilter
boolean (Automatic search filtering)
Default: false

If set to true, the search will automatically add filters to the query. For example, it will filter results containing the entities detected in the query

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

resource_filters
Array of strings (Resources filter)
Default: []

List of resource ids to filter search results for. Only paragraphs from the specified resources will be returned.

Prompts (string) or CustomPrompt (object) or Prompts (null) (Prompts)

Use to customize the prompts given to the generative model. Both system and user prompts can be customized. If a string is provided, it is interpreted as the user prompt.

reranker
string (Reranker)
Enum: "multi_match_booster" "predict" "noop"

Rerankers

  • Multi-match booster (default, deprecated): given a set of results from different sources, e.g., keyword and semantic search boost results appearing in both sets

  • Predict reranker: after retrieval, send the results to Predict API to rerank it. This method uses a reranker model, so one can expect better results at the expense of more latency.

    This will be the new default

  • No-operation (noop) reranker: maintain order and do not rerank the results after retrieval

citations
boolean (Citations)
Default: false

Whether to include the citations for the answer in the response

Citation Threshold (number) or Citation Threshold (null) (Citation Threshold)

If citations is True, this sets the similarity threshold (0 to 1) for paragraphs to be included as citations. Lower values result in more citations. If not provided, Nuclia's default threshold is used.

RequestSecurity (object) or Security (null) (Security)

Security metadata for the request. If not provided, the search request is done without the security lookup phase.

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

Array of any (RAG context building strategies)
Default: []

Options for tweaking how the context for the LLM model is crafted:

  • full_resource will add the full text of the matching resources to the context. This strategy cannot be combined with hierarchy, neighbouring_paragraphs, or field_extension.
  • field_extension will add the text of the matching resource's specified fields to the context.
  • hierarchy will add the title and summary text of the parent resource to the context for each matching paragraph.
  • neighbouring_paragraphs will add the sorrounding paragraphs to the context for each matching paragraph.
  • metadata_extension will add the metadata of the matching paragraphs or its resources to the context.
  • prequeries allows to run multiple retrieval queries before the main query and add the results to the context. The results of specific queries can be boosted by the specifying weights.

If empty, the default strategy is used, which simply adds the text of the matching paragraphs to the context.

Array of any (RAG image context building strategies)
Default: []

Options for tweaking how the image based context for the LLM model is crafted:

  • page_image will add the full page image of the matching resources to the context.
  • tables will send the table images for the paragraphs that contain tables and matched the retrieval query.
  • paragraph_image will add the images of the paragraphs that contain images (images for tables are not included). No image strategy is used by default. Note that this is only available for LLM models that support visual inputs. If the model does not support visual inputs, the image strategies will be ignored.
debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

Generative model (string) or Generative model (null) (Generative model)

The generative model to use for the chat endpoint. If not provided, the model configured for the Knowledge Box is used.

Maximum LLM tokens to use for the request (integer) or MaxTokens (object) or Maximum LLM tokens to use for the request (null) (Maximum LLM tokens to use for the request)

Use to limit the amount of tokens used in the LLM context and/or for generating the answer. If not provided, the default maximum tokens of the generative model will be used. If an integer is provided, it is interpreted as the maximum tokens for the answer.

rephrase
boolean (Rephrase)
Default: false

Rephrase the query for a more efficient retrieval. This will consume LLM tokens and make the request slower.

prefer_markdown
boolean (Prefer markdown)
Default: false

If set to true, the response will be in markdown format

Answer JSON schema (object) or Answer JSON schema (null) (Answer JSON schema)

Desired JSON schema for the LLM answer. This schema is passed to the LLM so that it answers in a scructured format following the schema. If not provided, textual response is returned. Note that when using this parameter, the answer in the generative response will not be returned in chunks, the whole response text will be returned instead. Using this feature also disables the citations parameter. For maximal accuracy, please include a description for each field of the schema.

Responses

Request samples

Content type
application/json
{
  • "audit_metadata": {
    },
  • "query": "string",
  • "top_k": 20,
  • "fields": [ ],
  • "filters": [ ],
  • "keyword_filters": [
    ],
  • "vectorset": "string",
  • "min_score": 0,
  • "features": [
    ],
  • "range_creation_start": "2019-08-24T14:15:22Z",
  • "range_creation_end": "2019-08-24T14:15:22Z",
  • "range_modification_start": "2019-08-24T14:15:22Z",
  • "range_modification_end": "2019-08-24T14:15:22Z",
  • "show": [
    ],
  • "field_type_filter": [
    ],
  • "extracted": [ ],
  • "shards": [ ],
  • "context": [
    ],
  • "extra_context": [
    ],
  • "autofilter": false,
  • "highlight": false,
  • "resource_filters": [ ],
  • "prompt": "string",
  • "reranker": "multi_match_booster",
  • "citations": false,
  • "citation_threshold": 1,
  • "security": {
    },
  • "show_hidden": false,
  • "rag_strategies": [
    ],
  • "rag_images_strategies": [ ],
  • "debug": false,
  • "generative_model": "string",
  • "max_tokens": 0,
  • "rephrase": false,
  • "prefer_markdown": false,
  • "answer_json_schema": {
    }
}

Response samples

Content type
application/json
{
  • "answer": "string",
  • "answer_json": { },
  • "status": "string",
  • "retrieval_results": {
    },
  • "retrieval_best_matches": [ ],
  • "prequeries": {
    },
  • "learning_id": "",
  • "relations": {
    },
  • "citations": { },
  • "prompt_context": [
    ],
  • "metadata": {
    },
  • "error_details": "string"
}

Suggest on a knowledge box

Suggestions on a knowledge box

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
query Parameters
query
required
string (Query)

The query to get suggestions for

fields
Array of strings (Fields)
Default: ""

The list of fields to search in. For instance: a/title to search only on title field. For more details on filtering by field, see: https://docs.nuclia.dev/docs/rag/advanced/search/#search-in-a-specific-field.

filters
Array of strings (Filters)
Default: ""

The list of filters to apply. Filtering examples can be found here: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

faceted
Array of strings (Faceted) <= 50 items
Default: ""

The list of facets to calculate. The facets follow the same syntax as filters: https://docs.nuclia.dev/docs/rag/advanced/search/#filters

Resource creation range start (string) or Resource creation range start (null) (Resource creation range start)

Resources created before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource creation range end (string) or Resource creation range end (null) (Resource creation range end)

Resources created after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range start (string) or Resource modification range start (null) (Resource modification range start)

Resources modified before this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

Resource modification range end (string) or Resource modification range end (null) (Resource modification range end)

Resources modified after this date will be filtered out of search results. Datetime are represented as a str in ISO 8601 format, like: 2008-09-15T15:53:00+05:00.

features
Array of strings (Suggest features)
Default: "paragraph&features=entities"
Items Enum: "paragraph" "entities"

Features enabled for the suggest endpoint.

show
Array of strings (Show metadata)
Default: "basic"
Items Enum: "basic" "origin" "extra" "relations" "values" "extracted" "errors" "security"

Controls which types of metadata are serialized on resources of search results

field_type
Array of strings (Field type filter)
Default: "text&field_type=file&field_type=link&field_type=conversation&field_type=generic"
Items Enum: "text" "file" "link" "conversation" "generic"

Define which field types are serialized on resources of search results

debug
boolean (Debug mode)
Default: false

If set, the response will include some extra metadata for debugging purposes, like the list of queried nodes.

highlight
boolean (Highlight)
Default: false

If set to true, the query terms will be highlighted in the results between ... tags

show_hidden
boolean (Show hidden resources)
Default: false

If set to false (default), excludes hidden resources from search

header Parameters
x-ndb-client
string (NucliaDBClientType)
Enum: "api" "widget" "web" "dashboard" "desktop" "chrome_extension"
x-nucliadb-user
string (X-Nucliadb-User)
Default:
x-forwarded-for
string (X-Forwarded-For)
Default:

Responses

Response samples

Content type
application/json
{
  • "paragraphs": {
    },
  • "entities": {
    },
  • "shards": [
    ]
}

Summarize your documents

Summarize Your Documents

Authorization roles

Authenticated user needs to fulfill one of this roles, otherwise the request will be rejected with a 403 response.

  • READER
path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
Generative model (string) or Generative model (null) (Generative model)

The generative model to use for the summarization. If not provided, the model configured for the Knowledge Box is used.

User prompt (string) or User prompt (null) (User prompt)

Optional custom prompt input by the user

resources
required
Array of strings (Resources) [ 1 .. 100 ] items

Uids or slugs of the resources to summarize. If the resources are not found, they will be ignored.

summary_kind
string (SummaryKind)
Enum: "simple" "extended"

Responses

Request samples

Content type
application/json
{
  • "generative_model": "string",
  • "user_prompt": "string",
  • "resources": [
    ],
  • "summary_kind": "simple"
}

Response samples

Content type
application/json
{
  • "resources": { },
  • "summary": ""
}