Documentation
Search and read the Scrydon documentation that ships with your installation, through two read-only operations that work without internet access
API Platform ships the Scrydon documentation inside its image: these same pages, in English and French, as plain text. Two operations search and read it where your installation runs, so an air-gapped installation can answer questions about Scrydon from the pages for the release it runs, without reaching this site.
import { createHttpPlatformTransport, createScrydonSDK } from '@scrydon/sdk/platform'
const platform = createScrydonSDK(
createHttpPlatformTransport({
baseUrl: 'https://scrydon.com',
headers: () => ({ authorization: `Bearer ${accessToken}` }),
})
)
const { available, hits } = await platform.data.docs.search({ query: 'create an automation' })
if (available && hits[0]) {
const { found, page } = await platform.data.docs.read({ path: hits[0].path })
if (found && page) console.log(page.title, page.truncated ? '(cut)' : '', page.text)
}| Operation | HTTP | What it does |
|---|---|---|
data.docs.search | POST /api/platform/v1/data/docs/search | Finds the pages that best match a few words, with a snippet from each. |
data.docs.read | POST /api/platform/v1/data/docs/read | Returns one page as plain text, by the path a search hit gave. |
Both need tools:read. They are read-only and safe to retry. The documentation
is the same for every organization and holds no organization data. Nothing is
sent outside the platform.
In a workflow, select the Scrydon tools Search Scrydon docs and Read
Scrydon docs page in an Agent block's tools. Inside a Scrydon tool, the same
operations are ctx.data.docs.search and ctx.data.docs.read. Cortex uses
these tools in workspace rooms to answer how Scrydon works.
Search
| Field | Type | Meaning |
|---|---|---|
query | string, 1 to 200 characters, not blank | A few words to look up, such as connect a data source. |
locale | en or fr | Optional. The language to search first. Defaults to en. |
limit | integer, 1 to 10 | Optional. At most this many hits. Defaults to 5. |
The result is { available, hits }. Each hit has:
| Field | Meaning |
|---|---|
path | The page's path under the documentation root, such as cortex/create-automations. Pass it to data.docs.read. |
title | The page's title. |
description | The page's one-line summary, when it has one. |
snippet | About 200 characters of the page around the first matching word. |
locale | The language of the page the hit came from. |
Titles and headings weigh more than words in the body. A French search that
finds nothing searches English instead, so its hits then carry locale: 'en'.
A query that matches nothing returns available: true with no hits.
Read
| Field | Type | Meaning |
|---|---|---|
path | string, at most 300 characters | A search hit's path. A leading or trailing / and a .mdx ending are ignored. |
locale | en or fr | Optional. Defaults to en. |
The result is { available, found, page }. When found is true, page has
path, title, description (when the page has one), locale, text and
truncated.
- French falls back to English. Asking for a page in French that has no
French version returns the English page, with
locale: 'en'. - The text is capped at 24,000 bytes (UTF-8). A longer page is cut on a
character boundary and
truncatedistrue. The cut is never in the middle of a character. - The text is plain. Headings, prose, table cells and code blocks are kept. Markup, components and images are dropped, and a link keeps only its text.
A path that names no page returns available: true, found: false, with no
page.
@scrydon/sdk/platform exports the bounds (DOCS_SEARCH_QUERY_MAX_CHARS,
DOCS_SEARCH_LIMIT_MAX, DOCS_SEARCH_LIMIT_DEFAULT, DOCS_PAGE_PATH_MAX_CHARS,
DOCS_READ_TEXT_MAX_BYTES) and the locales (DOCS_LOCALES,
DOCS_DEFAULT_LOCALE). Unknown fields, including an organization or workspace
field, are refused.
When the documentation is not installed
An image built without the documentation answers available: false instead of
an error: a search returns no hits, and a read returns found: false. Say that
the documentation is not installed instead of failing.
Errors
INVALID_REQUEST means the input did not pass validation, for example a blank
query, a limit of 11, or an unknown locale. When a Scrydon tool calls
data.docs.search, your organization's data loss prevention policy applies to
the query.