Knowledge base
Collections from outside sources, imports and connectors, tidying an import article by article, writing, linking and exporting, runbooks with stable step ids and runbooks inside runbooks, the public site, grants, and the /kb API.
A knowledge base article is never a document and never belongs to a company. Collections hold reference articles from outside sources: a vendor’s help center read by its own structure, a website crawled by sitemap or from a starting page, a wiki or another system’s export brought in as a zip or a folder, with their pictures and the PDFs and Word documents they link.
Bringing documentation in
Imports upsert on (collection, source key), so a newer export updates what changed and nothing else. Every converter and every stored body is held to one standard: an imported article must read as its source did.
- Numbered steps keep their numbers and keep counting. A picture, a note, or a caption between two steps belongs to the step above it. A list restarts only where the source restarts.
- A source site’s own navigation is never kept: breadcrumbs, “Contents” lists of anchor links, print and share buttons. Trove KB builds its own outline from the headings.
- A section title the source numbers is a heading, not an empty list item.
images/andfiles/folders in an archive are attachments; a crawled page’s pictures are kept by their address; the original document is kept and offered.- Categories come from the source’s structure, and a folder named on import overrides them.
- A folder or zip import takes Markdown, text, PDF, Word (
.docx), and HTML pages, each judged by its bytes rather than its name. Anything else in the folder is passed over, and a legacy.docis refused, as it is as an attachment. - A PDF is titled by the heading on its first page, then by its own Title property, and only then by its file name. Its text becomes Markdown: larger type becomes headings, gaps become paragraphs, bullets and numbered or indented lines become lists, and words hyphenated across a line are joined again. Running headers, footers, and page numbers are left out. A scan has no text layer to read: its article says No text could be read and links the source file.
A single document can come in without an import: the New article page has an Upload + button that takes one PDF, Word document, HTML page, Markdown, or text file instead of a typed body, with the same title, category, section, and runbook options. It is read and tidied the way an import reads it, and the file is kept with the article.
Check a new source by importing it and reading three articles with steps against their originals before importing the rest.
Admin → Knowledge base drives imports from the browser in pieces, resumable. An archive already on the server can be imported without the browser:
npx tsx --conditions react-server scripts/kb-import.ts "<collection>" <file.zip>
Run it where STORAGE_PATH is the deployment’s own uploads volume: the pictures in the archive are written there.
Tidying an import
A folder export is rarely clean: a PDF filed under the wrong heading, a draft nobody meant to share, a manual that belongs in another collection. An administrator tidies it up one article at a time under Manage on the article, whatever the article came from, a PDF out of a folder as much as one written here.
- Category and section. File the article where it belongs. Later imports still update its content but keep the place chosen here.
- Move to another collection. An administrator’s step, which asks for the second sign-in step if it isn’t fresh.
- File. Download the file the article came from, or upload a new version: PDF, Word (
.docx), HTML, Markdown, or text. Its text is read again; the title and category stay, and the old file stays in the history. An article from a Markdown or text file is edited with Edit at the top of the article instead. - Remove from the knowledge base. For a file that should not be here. Readers and search lose it. Removed articles are listed on the collection’s page under Admin → Knowledge base, where an administrator can restore them.
- History. Every change, including edits through the editor, the API, and MCP, keeps what the article was before, text and file included. Earlier files stay downloadable from the history.
The reason for all of this living on the article rather than in the source folder: a removed, moved, or edited file is held out of the next import of its old collection, so importing the same folder again neither brings it back nor overwrites the change. You can keep re-importing a vendor’s export without redoing the cleanup each time.
Writing, linking and exporting
Articles written here, and Markdown fields on documents, use the same editor: a toolbar with indent and outdent (Tab and Shift+Tab inside a list), a Preview tab that draws the text as the saved page will, and on a wide screen the preview beside the text as you type. Each person chooses how editors open, Visual, Markdown, or Markdown with live preview, from their account menu.
Type [[ to link another page: the list offers documents of your companies, your own company first, and articles in your collections, plus Create for a new page with that name in the same company or collection. Links are stored id-first, [[doc:<id>|Label]] or [[kb:<id>|Label]], so they survive renames and moves. Each reader sees them resolved for them: a page they can’t open is drawn as its label alone, never as a link and never with its current title, and on the public site documents are never links. You are warned when some readers of a page could not open one of its links.
An article lists the articles and documents that link to it under Linked from; a document lists the articles that link to it beside its document links. The list is rewritten from the text each time the linking page is saved.
Every article has an Export button, in the app and on the public site: a PDF, Markdown, or its own format first if it came from a file. Each PDF page has a footer, and each Markdown file a header, with the article’s address, category, and section. Lettered and roman sub-items (a. under a step, i. under those) show as nested lists numbered as written, on the page and in PDFs.
Runbooks
A runbook is an article whose lists are a procedure. Its steps are read from the body on every save: the items of every top-level list that is a procedure, in order across headings, each as { id, text, note?, canned? }.
The id is stable: write it yourself at the end of the item as {#my-id} ([a-z0-9-]{1,40}), or let Trove KB mint one on first save, after which it is in the stored body and kept across edits. A system that tracks progress through a runbook keys its state by id and keeps that state on its own side; Trove KB stores none. note is whatever was nested under the item; canned is the name in the first @canned:[Name] token of the step. Two steps with one id are refused.
A step that is only a [[kb:…]] link to another runbook opens into that runbook’s steps, numbered 2.1, 2.2 and so on, so one onboarding runbook can list the small runbooks it needs. Tick the steps one by one, or tick the linked step to tick all of them. A runbook that leads back into one it is already inside isn’t opened again, and runbooks nested too deep open on their own page instead. Over the API a runbook also carries expanded_steps: every step in reading order, each linked runbook’s steps after the step that links it, with id as the step’s path (step/step); a group step is done when every step under it is.
The public site
/pub/kb is for readers who have not signed in. It belongs on a hostname of its own, such as kb.yourdomain.com, behind a proxy that passes /pub/kb, /_next/static/, the logo, and the favicon, and refuses everything else. See Cloudflare for the nginx block.
- Each collection has Show on the public site, off by default. An article can be held back from its own page.
- Keyword rules (phrases or regular expressions, by title, category, or file type) and per-category switches keep the rest off, and apply to what arrives later.
- Under Admin → Settings → Public knowledge base, choose who is admitted: anyone who can reach it, or only visitors from listed addresses. Pair it with a Cloudflare Access Bypass policy for the same ranges.
- Behind Access, name the team and the application’s audience tag and readers keep favorites and votes: Trove KB checks the token Access adds to each request against the team’s published keys and knows the reader by a hash, with no account of its own.
- Customers. Give a company its sign-in email domains on its edit page. A visitor Access names from one of them is placed with that company and reads as its people would: the collections for every company, plus those kept to theirs, with the company’s logo in the corner. A visitor nobody named sees what is for everyone alone. Nothing of the visitor is stored; the address is read, matched, and dropped.
- Your name on it. Under Admin → Branding the public site’s credit can carry your own name: “Powered by Trove KB | Your MSP”. The product stays named and the license stays put.
- Admin → Portal is the setup page: what is set, whether the published address answers, whether an Access token has verified since the process started, which collections are on the site and to whom they are kept, which companies place their people, and the branding it carries, with the Cloudflare steps inline.
Grants
A person granted a collection reads it, and with can_write writes to it in the app, whatever companies it is kept to; administrators need no grant. An account can be made ahead of a person’s first sign-in so the grant is waiting for them. Under Admin → Knowledge base → API access, an administrator sets one key’s access to every collection at once: D (only what its companies allow), R, RW, and whether the key may keep reactions there.
API
GET /kb/collections?writable=true
GET /kb/collections/:id?kind=
GET /kb/search?q=&collection_id=&category=&kind=&limit=&cursor=
GET /kb/articles?collection_id=&category=&subcategory=&kind=&updated_since=&sort=&dir=&limit=&cursor=
GET /kb/articles/:id full body, kind, steps, external_id, source_url, public_url
GET /kb/articles/:id/original the file an imported article was made from; 404 if none
PUT /kb/collections/:id/articles/:external_id upsert (write scope + write grant)
DELETE /kb/collections/:id/articles/:external_id archive (write scope + write grant)
PUT /kb/collections/:id/grants/users/:userId { can_write? }
DELETE /kb/collections/:id/grants/users/:userId
PUT /kb/collections/:id/grants/api-keys/:keyId { can_write?, reactions? }
DELETE /kb/collections/:id/grants/api-keys/:keyId
Every article item carries kind, source_type (md, html, pdf, docx, txt), public, favorites, and helpfulness. In a full article, [[…]] links are written as Markdown links the key can open, or as their labels. audience=public narrows a read to what the public site shows. A PUT answers 201 when it created the article and 200 when it replaced it.
/original serves the document an imported article came from, a PDF inline and anything else as a file, with its own content type, ETag, and If-None-Match, under the same read rules as the article. When the public site sits behind Cloudflare Access, its copy of the PDF answers an API client with a login page; this route is how an integration reads the file server-side with its key instead.
Favorites and votes for a named reader
With the reactions scope and the header X-Trove-Reader: <email> (never stored; a key is derived from it, the same one the public site uses behind Access):
GET /kb/articles/:id/reactions -> { favorites, helpful_up, helpful_down, helpfulness, mine }
PUT /kb/articles/:id/favorite -> 204 DELETE -> 204
PUT /kb/articles/:id/vote { helpful: true|false } -> 204 DELETE -> 204
GET /kb/favorites?limit=&cursor=
Webhooks kb.article.upserted and kb.article.archived are sent for writes through the API, MCP, or the in-app editor.