创建知识库
创建新的知识库
Request body
Chunk count (not stored in database, calculated on query)
Creation time of the knowledge base
CreatorID records the user ID of whoever originally created the KB. Used by the workspace-level RBAC middleware to let Contributors edit their own KBs without granting them access to everyone else's. Nullable for backward compatibility with rows created before the RBAC migration backfilled the column to the workspace Owner.
CreatorName 是 CreatorID 对应用户的展示名(username / email 等), 仅在列表场景由 handler 批量回填,不落库;为空表示创建者无法解析(用户已删除、 CreatorID 为空的老数据等)。前端用它在卡片来源徽章上做 mine vs workspace 的二分。
Description of the knowledge base
ID of the embedding model
Unique identifier of the knowledge base
IsPinned and PinnedAt are computed per-caller from user_kb_pins (see migration 000050). They used to be stored on the row itself, which made pinning a workspace-wide ordering decision gated behind the kb-edit RBAC guard. The columns are still present in legacy schemas for rollback safety but are no longer read or written by the application — both fields are tagged gorm:"-" so GORM ignores them on every CRUD call and the list handler stamps them after enriching with the caller's pin set.
IsProcessing indicates if there is a processing import task (for FAQ type knowledge bases)
Whether this knowledge base is temporary (ephemeral) and should be hidden from UI
Knowledge count (not stored in database, calculated on query)
Name of the knowledge base
PinnedAt records when the current caller pinned this knowledge base; nil when they have not.
ProcessingCount indicates the number of knowledge items being processed (for document type knowledge bases)
ShareCount indicates the number of organizations this knowledge base is shared with (not stored in database)
StorageBackendID binds this KB to one concrete storage instance. The legacy provider field remains readable during migration only.
Summary model ID
Workspace ID
Type of the knowledge base (document, faq, etc.)
Last updated time of the knowledge base
VectorStoreID references the VectorStore this knowledge base is bound to. When nil, the KB falls back to the workspace's effective engines derived from the RETRIEVE_DRIVER environment variable (env store flow). This field is set once at creation time and must not be modified afterwards; enforcement lives at the GORM layer (<-:create) plus the service-layer KB update path, which omits this field from its update DTO.
Response
创建的知识库