Skip to content

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.

Terminal window
bin/vol pnpm --filter @vol/docs export:ragflow

apps/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 & streaming
url: /docs/guides/chat-streaming/
---
# Chat & streaming
URL: /docs/guides/chat-streaming/
…page content without frontmatter, imports or MDX components…
  • Frontmatter, import lines 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.json lists { 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.

Done by the orchestrator (not part of the docs build):

  1. Create (once) the dataset vol-docs — embedding bge-m3, chunk method General/Markdown.
  2. Delete the previous documents and upload every file in dist-ragflow/.
  3. Parse the documents and wait until all are DONE.
  4. Bind the dataset to the vol-docs chat assistant used by POST /v1/docs/ask.

vol-api builds sources from the retrieved chunks’ document names using manifest.json (or the url: header inside each file).

  • 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 use PUBLIC_VOL_API_BASE=http://localhost:8010 (vol-api must allow CORS from :4322).
  • bin/vol pnpm --filter @vol/docs build regenerates the API reference and builds the site.
  • bin/vol pnpm --filter @vol/docs check:links verifies that every internal link in dist/ starts with /docs/ (or points to /app/, /api/) and resolves to a built page.