Skip to main content
POST
Add Knowledge Base V2

Authorizations

X-API-Key
string
header
required

Body

application/json
name
string
required
description
string
required
document_types
string[]
status
enum<string>
default:created
Available options:
created,
trained,
training,
error
kb_type
enum<string>
default:entity
Available options:
temporary,
entity
workflow_id
string<uuid> | null
node_id
string<uuid> | null
settings_
KBConfig · object | null
version
enum<string>
default:v3
Available options:
v2,
v3

Response

Successful Response

id
string<uuid>
required
group_id
string<uuid>
required
name
string
required
status
enum<string>
required
Available options:
created,
trained,
training,
error
description
string
required
document_types
string[]
required
kb_type
enum<string>
required
Available options:
temporary,
entity
size
number
required
num_docs
integer
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
error
Error · object | null
required
version
enum<string>
required
Available options:
v2,
v3
total_documents
integer
required
training_documents
integer
required
trained_documents
integer
required
error_documents
integer
required
uploaded_documents
integer
required
source_types
Source Types · object
required
training_source_types
string[]
required
meta
Meta · object | null
embedding_health
EmbeddingHealth · object | null
health
KBHealth · object | null

Structural health of a v3 knowledge base, computed at request time.

Returned on every GET /kbs/{id} so the FE can surface an inline banner + CTA when the KB needs repair. Four concrete issues can be detected by KBManagementService.compute_health:

  • vector_table_missing — pgvector table was never created or was dropped out from under us. Repair rebuilds the table at the declared dim and queues every document for re-ingestion.
  • index_struct_missing — the pgvector table is present but the kirby index_struct row is absent. Repair rebuilds the struct anchored to the existing column; no documents need reprocessing.
  • dim_drift — declared dim no longer matches the pgvector column width. Retrieval still works against the actual dim, but new INSERTs fail. Repair recreates the table at the declared dim and queues every document for re-ingestion.
  • resolver_error — the resolver itself failed (DB outage, unexpected column type). Not a repair-able state; the user is asked to retry later. HTTP stays 200 so the FE can render the apology inline instead of a blank error page.
settings_
KBConfig · object | null