kb_archive_article
ChatGPTMove an article (by UUID or slug) to ARCHIVED status — hides it from default reader views but preserves history. published_at is preserved. Idempotent. Requires kb:write.
kb_create_article
ChatGPTCreate a new article from Markdown. Body is converted to TipTap-compatible HTML server-side; raw HTML in the input is escaped (no <script>, <iframe>, etc). Defaults: status=DRAFT, no category; department-scoped users default to their assigned departments, while admins/service tokens default to no restriction. Pass status="PUBLISHED" to publish immediately. category_slug = the CONTENT rubric (a topic folder, see kb_list_categories). department_ids = the ACCESS AUDIENCE — which departments may see it (see kb_list_departments). These are different: if the user says "put this in <name>" and <name> is a department, pass its id in department_ids — do NOT create a category named after a department. An article belongs to exactly ONE department: if several ids are passed, only the first is kept (duplicate the article for a second department). Assigning a department that differs from the article's category detaches it from that category — the category owns the department. Requires scope kb:write.
kb_create_category
ChatGPTCreate a new KB section (CATEGORY = a content rubric / topic folder). The slug is derived from the name (transliterated) and de-duplicated within the org. Pass parent_slug to nest it under another section — a nested section inherits its parent's department. position defaults to the end of the sibling list. NOTE: a category is NOT a department. A DEPARTMENT is an access audience (kb_list_departments); to restrict an article to a department, pass its id in department_ids on the article — do not create a category named after it. If the requested name matches an existing department, this tool refuses unless confirm=true. Requires scope kb:write.
kb_delete_category
ChatGPTDelete a KB section (by UUID or slug). Articles in it are NOT deleted — their category link is cleared (they become uncategorised). Direct child sections are re-parented to root. Irreversible. Requires scope kb:write.
kb_get_article
ChatGPTFetch a single article by UUID or slug. Returns the full HTML content (TipTap-compatible) plus metadata. Set include_content=false to skip the body when only the summary is needed.
kb_get_related
ChatGPTReturn related articles for a given article (by UUID or slug). Returns the union of manual cross-links and embedding-nearest neighbours, capped at `limit`. Manual links come first.
kb_list_articles
ChatGPTList articles ordered by recency. Supports filtering by category slug and status. Pagination via offset/limit.
kb_list_categories
ChatGPTReturn the full category tree as a flat list. Each item carries `parent_slug` so clients can rebuild hierarchy. Ordered by (parent, position).
kb_list_departments
ChatGPTList the organization's departments (access audiences). A DEPARTMENT controls WHO can see an article — it is NOT a content rubric (that is a category, see kb_list_categories). Returns id, name, type (BRANCH/DEPARTMENT) and parent. To restrict an article to one or more departments, pass their ids in `department_ids` on kb_create_article / kb_update_article. Call this to look up a department's id by name before assigning it.
kb_publish_article
ChatGPTMove an article (by UUID or slug) to PUBLISHED status. Stamps published_at when transitioning from draft. Idempotent — already-published articles return unchanged. Requires kb:write.
kb_search
ChatGPTSearch knowledge-base articles by natural-language query. Hybrid retrieval: semantic vector similarity (e5 embeddings, cosine distance) plus keyword fallback on title/content for any remaining slots. Russian queries work out of the box. Returns lightweight summaries — use kb_get_article for full content.
kb_update_article
ChatGPTUpdate an existing article (by UUID or slug). Any subset of the fields can be passed. When title or content_markdown changes, we bump article.version and write a snapshot row to kb_article_versions for audit. content_markdown is converted to HTML server-side (raw HTML in input is escaped). Setting status to PUBLISHED stamps published_at; ARCHIVED leaves it alone (history is preserved). An article belongs to exactly ONE department: if several ids are passed in department_ids, only the first is kept. Assigning a department that differs from the article's category detaches it from that category — the category owns the department. Requires scope kb:write.
kb_update_category
ChatGPTUpdate a KB section (by UUID or slug). Any subset of fields can be passed. Renaming regenerates the slug (de-duplicated); articles stay linked because they reference the category by id, not slug. Moving (parent_slug) or setting department_id re-applies the department to the whole subtree and its articles. Pass parent_slug="" to detach the section back to root. Requires scope kb:write.
kb_whoami
ChatGPTReturn which Sensei knowledge base (organization) THIS connection is bound to, the access level, and a plain-language summary. Call this whenever the user asks which knowledge base / organization is connected, what you can access, or HOW to switch to a different organization — then relay the returned 'summary' and 'how_to_switch' to the user in their language. A Sensei connection is scoped to exactly ONE organization.