Ask AI pipeline (internal)
Ask AI (header button and landing box) sends POST /api/v1/docs/ask with { question } and renders
{ answer, sources: [{ title, url }] }. vol-api answers it with a RAGFlow chat assistant bound to the
vol-docs dataset. If the API is unreachable the widget shows a friendly fallback pointing to search.
1. Export the docs
Section titled “1. Export the docs”bin/vol pnpm --filter @vol/docs export:ragflowapps/docs/scripts/export-for-ragflow.mjs reads every .md/.mdx page under src/content/docs/ and
writes one clean Markdown file per page to apps/docs/dist-ragflow/:
---title: Chat & streamingurl: /docs/guides/chat-streaming/---
# Chat & streaming
URL: /docs/guides/chat-streaming/
…page content without frontmatter, imports or MDX components…- Frontmatter,
importlines and MDX comments are removed. <Tabs>/<TabItem>become### <label>sections so every code sample is kept.<Aside>becomes a blockquote;<Steps>and<CardGrid>wrappers are dropped (content kept).- Internal pages (
internal/) are skipped. - A
manifest.jsonlists{ file, title, url }for every page.
File names are the URL slug with / → __ (e.g. guides__chat-streaming.md), so the RAGFlow document
name maps back to its URL.
2. Upload to RAGFlow
Section titled “2. Upload to RAGFlow”Done by the orchestrator (not part of the docs build):
- Create (once) the dataset
vol-docs— embeddingbge-m3, chunk method General/Markdown. - Delete the previous documents and upload every file in
dist-ragflow/. - Parse the documents and wait until all are
DONE. - Bind the dataset to the
vol-docschat assistant used byPOST /v1/docs/ask.
vol-api builds sources from the retrieved chunks’ document names using manifest.json (or the
url: header inside each file).
3. Configuration
Section titled “3. Configuration”PUBLIC_VOL_API_BASE(build-time, optional): API base used by the widget. Default/api, which works on the single Pages deployment. For local docs dev against a local API usePUBLIC_VOL_API_BASE=http://localhost:8010(vol-api must allow CORS from:4322).
4. Checks
Section titled “4. Checks”bin/vol pnpm --filter @vol/docs buildregenerates the API reference and builds the site.bin/vol pnpm --filter @vol/docs check:linksverifies that every internal link indist/starts with/docs/(or points to/app/,/api/) and resolves to a built page.