Knowledge base authoring
Knowledge base authoring is the agent workflow for creating, editing, organizing, and publishing help articles. The desk groups articles by category, while shared resources and article APIs keep content, access, search, and publication state aligned with the customer knowledge base. See Knowledge base and article publishing for the wider system and Customer knowledge base access for the reader experience.
Authoring workspace
The agent workspace is the main place to manage articles and categories. The /kb page shows articles grouped by category and gives agents actions for creation, selection, movement, deletion, access changes, ordering, sharing, and category management (desk/…/KnowledgeBaseAgent.vue• L23-85, desk/…/KnowledgeBaseAgent.vue• L173-320).
The workspace treats categories as working groups. Agents can add an article to a category, create a category with its first article, create a subcategory, or open an article from the grouped list. Bulk actions apply access, weight, movement, or deletion changes to selected articles (desk/…/KnowledgeBaseAgent.vue• L203-248, desk/…/KnowledgeBaseAgent.vue• L405-504).
Article lifecycle
An article moves through Draft, Published, and Archived states. Agents write the title and rich content, choose who can read the article, and publish it when the content is ready. The article record also carries its category, author, publication time, view count, display weight, and optional home-page pin (helpdesk/…/hd_article.json• L9-24, helpdesk/…/hd_article.json• L26-136).
Draft creation and editing
The new-article page starts a draft with a title, rich content, and category. After creation, the desk opens the article page so the agent can continue editing, move the article, or publish it (desk/…/NewArticle.vue• L9-73, desk/…/NewArticle.vue• L111-145). The article editor supports the rich text needed for support content, including links, media, lists, tables, and headings (desk/…/Article.vue• L168-195, desk/…/config.ts• L36-57).
The article page keeps edits separate until the agent saves them. It requires a non-empty title and body before saving, then refreshes the article after the server accepts the change (desk/…/Article.vue• L595-659). The server derives a short excerpt from the content for article discovery and records the current user as the author when the article is created (helpdesk/…/hd_article.py• L72-83, helpdesk/…/hd_article.py• L96-102, helpdesk/…/hd_article.py• L197-201).
References: desk/…/NewArticle.vue• L9-73 desk/…/Article.vue• L595-659 helpdesk/…/hd_article.py• L68-102
Publication and visibility
Publication is an explicit agent action. A draft becomes Published only after the agent selects an access level. The available levels are Public for all readers, Customers for signed-in customers and agents, and Private for agents only (desk/…/Article.vue• L496-523, desk/…/Article.vue• L507-516, helpdesk/…/hd_article.json• L82-95).
Agents can change access for a published article or apply one access level to selected articles or a whole category. A private category makes a new customer-visible article private, and private or unpublished articles do not enter customer discovery (desk/…/KnowledgeBaseAgent.vue• L289-367, helpdesk/…/hd_article.py• L96-102, helpdesk/…/hd_article.py• L212-224). Unpublishing returns an article to Draft and clears its publication time (desk/…/Article.vue• L499-545, helpdesk/…/hd_article.py• L76-83).
Published articles can be pinned to the knowledge base home page and weighted within their category. The server allows at most five pins and removes pin state when an article is not published or is private (desk/…/Article.vue• L86-99, desk/…/Article.vue• L876-905, helpdesk/…/hd_article.py• L38-60).
References: desk/…/Article.vue• L496-545 desk/…/Article.vue• L876-905 desk/…/KnowledgeBaseAgent.vue• L289-468 helpdesk/…/hd_article.py• L29-102 helpdesk/…/hd_article.json• L82-136
Archive and deletion
Archiving removes an article from its category and from reader access without removing its record. Agents can restore an archived article as a draft and choose a category for it (desk/…/Article.vue• L244-255, desk/…/Article.vue• L564-587, desk/…/Article.vue• L735-765, helpdesk/…/hd_article.py• L29-36).
Deletion considers links from support tickets. The desk offers archiving to keep a linked article available to those tickets, or deletion when the agent accepts that the links will be removed. The same choice applies to category and bulk deletion (desk/…/Article.vue• L661-732, desk/…/KnowledgeBaseAgent.vue• L538-687).
References: desk/…/Article.vue• L661-765 desk/…/KnowledgeBaseAgent.vue• L538-687 helpdesk/…/hd_article.py• L29-36 helpdesk/…/test_hd_article.py• L150-160
Category organization
Categories give articles a customer-visible grouping and an agent-facing unit for bulk work. The desk can create a category, rename it, move selected articles to another category, merge one category into another, or delete a category. The category dialogs collect the target or new name, and the page refreshes its grouped article view after a successful change (desk/…/CategoryModal.vue• L1-85, desk/…/MoveToCategoryModal.vue• L1-58, desk/…/MergeCategoryModal.vue• L1-48, desk/…/KnowledgeBaseAgent.vue• L223-384).
The General category is the protected default. It cannot be renamed, deleted, or used as a newly chosen category name. A category must keep at least one article, so moving or deleting its last article is rejected. Deleting another category moves its articles to General, while merging moves all source articles to the target and then removes the source category (helpdesk/…/hd_article_category.py• L9-57, helpdesk/…/knowledge_base.py• L52-64, helpdesk/…/knowledge_base.py• L68-86, helpdesk/…/knowledge_base.py• L121-139).
Desk resources and article APIs
The desk/…/knowledgeBase.ts resource layer is the boundary between desk actions and server calls. It provides resources for article insert, update, delete, bulk delete, category create, category rename, article movement, category merge, category lookup, feedback, and view counting. Components submit these resources and then reload the affected list or article (desk/…/knowledgeBase.ts• L1-123).
The article APIs apply the rules that need to span more than one record. They create an initial article with a new category, return categories with counts of published articles, return only published articles for a category, prevent invalid category changes, and expose article details to the desk and portal. The detail API permits agents to read any article but requires non-agents to read published content (helpdesk/…/knowledge_base.py• L10-41, helpdesk/…/knowledge_base.py• L46-117).
This sequence shows how an agent action becomes an article or category change and then returns to the desk view.
sequenceDiagram
participant Agent
participant Desk as Agent desk page
participant Store as Knowledge base resources
participant API as Article APIs
participant DB as Article and category records
Agent->>Desk: Create or edit content
Desk->>Store: Submit article or category action
Store->>API: Call insert, update, move, merge, or delete
API->>DB: Validate and save the change
DB-->>API: Return result
API-->>Store: Return success or error
Store-->>Desk: Refresh list or article
Desk-->>Agent: Show current state
Article search and signals
Article search helps readers find published content and helps the desk show article signals. The article API filters search results against current article visibility because the search index can contain stale records (helpdesk/…/article.py• L32-57).
Search first uses the reader query, then tries useful noun phrases or nouns when the first search does not return enough results. It returns highlighted matches, while related-article lookup returns a small set of readable articles. Queries made only from stopwords use title matching instead (helpdesk/…/article.py• L101-124, helpdesk/…/article.py• L128-189).
Article statistics expose views, likes, and dislikes only after the caller passes article read permission. The desk uses these values for the article view, while feedback remains tied to the article and to the reader or visitor identity (helpdesk/…/article.py• L68-97, desk/…/Article.vue• L485-494, helpdesk/…/test_hd_article.py• L37-147).
References: helpdesk/…/article.py• L32-57 helpdesk/…/article.py• L68-189 desk/…/Article.vue• L485-494 helpdesk/…/test_hd_article.py• L37-147
Article sharing and visibility
Agents can copy a public category or article link from the desk. A copied link opens the customer knowledge base, but the customer view can discover and open only articles that are published and readable for that customer (desk/…/KnowledgeBaseAgent.vue• L252-262, desk/…/Article.vue• L831-849, helpdesk/…/knowledge_base.py• L90-117).
The access level therefore controls both direct reading and discovery. Public content is available to visitors, customer content is limited to signed-in customers and agents, and private content remains agent-only. See Customer knowledge base access for the reader flow.
References: desk/…/KnowledgeBaseAgent.vue• L252-262 desk/…/Article.vue• L831-849 helpdesk/…/hd_article.py• L204-247 helpdesk/…/knowledge_base.py• L90-117
Change checklist
When these files or sections are changed, remember to consider these:
- Keep article status, access, pin, and category rules aligned between the DocType, server validation, desk actions, and reader filters.
- Keep category safeguards aligned across article movement, archiving, deletion, category deletion, and category merge so the required category content remains valid.
- Keep resource parameters aligned with API names and with the article and category identifiers used by desk routes.
- Keep the article search visibility filter aligned with article permission rules so stale index entries cannot expose unreadable content.
- Keep publication, access changes, pin limits, and weight changes consistent for single-article and bulk actions.
- Keep ticket-link handling aligned between article deletion dialogs and bulk or category deletion APIs.
- Keep rich-text editor changes compatible with both new-article creation and article editing, including uploaded files and heading links.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| An agent publishes or saves an article without content | The save is rejected and the article remains unpublished or unchanged | The desk checks title and body content, and the server requires content for Published records (desk/…/Article.vue• L617-629, helpdesk/…/hd_article.py• L68-70) |
| An agent moves, archives, or deletes the last article in a category | The category would lose its required content, so the operation fails | Article category validation checks the article left behind (helpdesk/…/hd_article.py• L62-66, helpdesk/…/test_hd_article.py• L150-160) |
An agent tries to rename or delete General | The protected default category operation is rejected | Category rules protect the default category (helpdesk/…/hd_article_category.py• L9-57) |
| An agent pins a private or unpublished article, or exceeds the pin limit | The article is unpinned or the save is rejected | Article validation permits pins only for published readable articles and caps the home page at five (helpdesk/…/hd_article.py• L38-60) |
| A customer searches for an article whose index entry is stale | An unreadable, draft, archived, or private article could appear in search | Search results are checked against current article visibility before return (helpdesk/…/article.py• L45-57) |
| An agent deletes an article linked to tickets | The article is removed from those ticket links | The desk offers archive-linked or delete choices before bulk deletion (desk/…/Article.vue• L661-719, desk/…/KnowledgeBaseAgent.vue• L659-687) |
Key files
| File | Why to read it |
|---|---|
| desk/…/KnowledgeBaseAgent.vue | Shows the grouped agent workspace and article and category actions. |
| desk/…/NewArticle.vue | Shows the new article flow and its title, content, and category inputs. |
| desk/…/Article.vue | Shows article editing, publication, access, ordering, archiving, sharing, and deletion. |
| desk/…/knowledgeBase.ts | Defines the desk resource boundary for article and category actions. |
| helpdesk/…/knowledge_base.py | Defines cross-record article and category operations and reader filtering. |
| helpdesk/…/article.py | Defines readable article search, related articles, and article statistics. |
| helpdesk/…/hd_article.py | Defines article validation, access, publication dates, category protection, pins, and excerpts. |
| helpdesk/…/hd_article.json | Defines article fields, statuses, access levels, ordering fields, and role permissions. |
| helpdesk/…/test_hd_article.py | Shows the guarantees for article feedback and protection of the last article in a category. |
| helpdesk/…/hd_article_category.py | Defines default-category rules and category deletion behavior. |