Ask the local Docs AI
Lets you ask a question from the public Docs wiki and receive an answer generated in the browser with local AI. The assistant uses public articles as context, requires no sign-in and does not save the conversation on the backend.
In this article
Use this flow when you are consulting the public documentation and want a quick answer based on the available Docs articles. The panel lives inside the public wiki and appears from the floating `Ask in Docs` button.
The answer depends on `globalThis.LanguageModel` in the browser. If the browser or device does not support local AI, the wiki keeps working with normal navigation, search and article reading.
Before you start
- Open a public Docs route, such as `/docs`, `/docs/:sectionSlug/:articleSlug`, `/manual` or `/wiki`.
- The screen must have loaded articles from `GET /api/public/docs`; if the index is empty, the assistant does not appear.
- The browser must expose `globalThis.LanguageModel` and be in a usable state for asking.
- The question must have real text after trimming leading and trailing whitespace.
- The public Docs API must be able to return the index and the details of the articles used as context.
Instructions
- 1.
Open the public Docs wiki
Enter `/docs` or a specific article, for example `/docs/access/en-auth-native-login?lang=en`. You need no Antylogic session or `Harbor Demo Group` permissions; this surface uses the public Docs contract.
- 2.
Open the Ask in Docs panel
Press the floating `Ask in Docs` button. The panel shows the browser's local AI state and the question field. If the browser does not support `globalThis.LanguageModel` or the device does not meet the requirements, the field is disabled.
- 3.
Write an operational question
Write a specific question, such as `How do I sign in to the native app?`, and press `Ask`. The assistant blocks empty questions, prevents double submissions while responding and cancels a previous request if you start another.
- 4.
Wait for the local answer
The assistant prioritises the open article as context and completes up to four articles based on matches in title, keyword and summary. It then loads the public details with `GET /api/public/docs/{sectionSlug}/{articleSlug}` and generates the answer in the browser.
- 5.
Review sources and limits
When it finishes, the panel shows `Local answer` and `Articles used`. The source links point to canonical `/docs/{section_slug}/{slug}` routes, even if you entered from `/manual` or `/wiki`.
- 6.
Clear or close the panel
Use `Clear` to cancel an active request and remove the question, answer, errors, sources and download progress. When the screen is reloaded or unmounted, the local state is lost.
Validations and limits
- There is no `POST` endpoint for asking; generation happens in the browser with `globalThis.LanguageModel`.
- The question, answer, sources, error and progress live only in React state; they are not saved in a database or in an API.
- The maximum context is four articles and the text sent to the model is trimmed to 12000 characters.
- The answer is not validated by the backend against the sources; the product limits the scope through the prompt and by showing the articles used.
- If `LanguageModel.availability`, `create` or `prompt` fail because of an unsupported signature, the code retries with simpler options.
- If the answer is empty or loading the details fails, the panel shows a localised message and persists nothing.
- This functionality is limited to the public landing; the authenticated `DocumentationPage` of the native app does not mount `DocsLocalAIAssistant`.
Expected result
The visitor gets a local answer based on Docs articles and can open the sources used. If local AI is not available, the wiki keeps normal navigation and search without simulating an answer.