1import { themes as prismThemes } from 'prism-react-renderer'
2import type { Config } from '@docusaurus/types'
3import type * as Preset from '@docusaurus/preset-classic'
4
5import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs'
6import type { Options as BlogOptions } from '@docusaurus/plugin-content-blog'
7import type { Options as PageOptions } from '@docusaurus/plugin-content-pages'
8
9import tailwindPlugin from './plugins/tailwind-config.cjs'
10import agentDiscoveryPlugin from './plugins/agent-discovery.cjs'
11import * as fs from 'fs'
12import * as path from 'path'
13
14// Load versions from versions.json if it exists (generated at build time)
15const versionsPath = path.join(__dirname, 'versions.json')
16const versions: string[] = fs.existsSync(versionsPath)
17 ? JSON.parse(fs.readFileSync(versionsPath, 'utf-8'))
18 : []
19
20// Build version configuration dynamically
21// Trunk docs (current) are "Next" at /docs/next
22// Highest version in versions.json (e.g., 1.11.x) is "Latest" at /docs (default)
23// Previous versions are at /docs/v1.10, etc.
24// Maintenance policy: latest + 1 previous minor versions are maintained
25const hasVersions = versions.length > 0
26
27// Extract major and minor version numbers from versions to determine ordering and maintenance status
28const getVersion = (v: string): { major: number; minor: number } => {
29 const match = v.match(/^(\d+)\.(\d+)/)
30 return match
31 ? { major: parseInt(match[1], 10), minor: parseInt(match[2], 10) }
32 : { major: 0, minor: 0 }
33}
34
35// Sort versions by semver (major desc, then minor desc)
36const sortedVersions = [...versions].sort((a, b) => {
37 const vA = getVersion(a)
38 const vB = getVersion(b)
39 if (vB.major !== vA.major) return vB.major - vA.major
40 return vB.minor - vA.minor
41})
42
43// Highest version is "latest", trunk (current) is "next"
44const latestVersion = sortedVersions[0] || null
45const latestVer = latestVersion ? getVersion(latestVersion) : { major: 0, minor: 0 }
46
47// Final release of the previous major stays maintained through the transition
48// (e.g. v1.11.x remains maintained after v2.0 ships as latest). sortedVersions is
49// major-desc, so the first entry below the latest major is that major's newest release.
50const prevMajorLatest = sortedVersions.find((v) => getVersion(v).major < latestVer.major) || null
51
52const docsVersionConfig = hasVersions
53 ? {
54 lastVersion: latestVersion!, // The stable release is the default
55 onlyIncludeVersions: [...versions, 'current'],
56 versions: {
57 current: {
58 label: 'Next',
59 path: 'next',
60 banner: 'unreleased' as const
61 },
62 ...Object.fromEntries(
63 versions.map((version) => {
64 const ver = getVersion(version)
65 const isLatest = version === latestVersion
66 // Maintained (no banner): the latest major's current + previous minor,
67 // plus the final release of the previous major (e.g. v1.11.x under v2.0).
68 const isMaintained =
69 ver.major > latestVer.major ||
70 (ver.major === latestVer.major && ver.minor >= latestVer.minor - 1) ||
71 version === prevMajorLatest
72
73 return [
74 version,
75 {
76 label: isLatest
77 ? `Latest (v${version.replace('.x', '')})`
78 : `v${version.replace('.x', '')}`,
79 path: isLatest ? '' : `v${version.replace('.x', '')}`,
80 banner: isMaintained ? ('none' as const) : ('unmaintained' as const)
81 }
82 ]
83 })
84 )
85 }
86 }
87 : {
88 // No versions generated - use current docs only (for local dev)
89 lastVersion: 'current',
90 versions: {
91 current: {
92 label: 'Latest',
93 path: '',
94 banner: 'none' as const
95 }
96 },
97 onlyIncludeVersions: ['current']
98 }
99
100const config: Config = {
101 title: 'Spice.ai OSS',
102 tagline:
103 'A portable SQL query and AI compute engine, written in Rust, for data-grounded apps and agents.',
104 favicon: 'img/favicon.ico',
105
106 // Set the production url of your site here
107 url: 'https://spiceai.org',
108 // Set the /<baseUrl>/ pathname under which your site is served
109 // For GitHub pages deployment, it is often '/<projectName>/'
110 baseUrl: '/',
111
112 trailingSlash: false,
113
114 // GitHub pages deployment config.
115 // If you aren't using GitHub pages, you don't need these.
116 organizationName: 'spiceai', // Usually your GitHub org/user name.
117 projectName: 'docs', // Usually your repo name.
118
119 onBrokenAnchors: 'throw',
120 onBrokenLinks: 'throw',
121
122 markdown: {
123 mermaid: true,
124 hooks: {
125 onBrokenMarkdownLinks: 'throw'
126 }
127 },
128
129 // Even if you don't use internationalization, you can use this field to set
130 // useful metadata like html lang. For example, if your site is Chinese, you
131 // may want to replace "en" with "zh-Hans".
132 i18n: {
133 defaultLocale: 'en',
134 locales: ['en']
135 },
136
137 future: {
138 v4: {
139 removeLegacyPostBuildHeadAttribute: true // required
140 },
141 faster: true
142 },
143
144 // Read by src/clientModules/webmcp.ts to search the latest docs version.
145 customFields: {
146 latestDocsVersion: latestVersion ?? 'current'
147 },
148
149 clientModules: ['./src/clientModules/webmcp.ts'],
150
151 presets: [
152 [
153 'classic',
154 {
155 docs: {
156 routeBasePath: '/docs',
157 path: 'docs',
158 sidebarPath: 'sidebars.ts',
159 onInlineTags: 'throw',
160 docItemComponent: '@theme/ApiItem',
161 editUrl: ({ versionDocsDirPath, docPath }) => {
162 return `https://github.com/spiceai/docs/edit/trunk/website/${versionDocsDirPath}/${docPath}`
163 },
164 ...docsVersionConfig
165 },
166 blog: {
167 path: 'blog',
168 showLastUpdateAuthor: true,
169 showLastUpdateTime: true,
170 onInlineTags: 'throw',
171 onUntruncatedBlogPosts: 'ignore',
172 editUrl: ({ locale, blogDirPath, blogPath }) => {
173 return `https://github.com/spiceai/docs/edit/trunk/website/${blogDirPath}/${blogPath}`
174 },
175 remarkPlugins: [],
176 postsPerPage: 5,
177 feedOptions: {
178 type: 'all',
179 description:
180 'Keep up to date with upcoming Spice.ai OSS releases and articles by following our feed!',
181 copyright: `Copyright © 2021-2026 Spice AI, Inc.`,
182 xslt: true
183 },
184 blogTitle: 'Spice.ai OSS blog',
185 blogDescription: 'Read blog posts about Spice.ai OSS from the team and community',
186 blogSidebarCount: 'ALL',
187 blogSidebarTitle: 'All Posts'
188 } satisfies BlogOptions,
189 pages: {
190 remarkPlugins: [],
191 showLastUpdateAuthor: true,
192 showLastUpdateTime: true
193 } satisfies PageOptions,
194 theme: {
195 customCss: ['./src/css/custom.css', './src/css/openapi.css', './src/css/preflight.css']
196 },
197 gtag: {
198 trackingID: 'G-SST0X6NS37',
199 anonymizeIP: true
200 },
201 sitemap: {
202 lastmod: 'date',
203 changefreq: 'weekly',
204 priority: 0.5,
205 ignorePatterns: ['/tags/**'],
206 filename: 'sitemap.xml'
207 }
208 } satisfies Preset.Options
209 ]
210 ],
211 themes: ['docusaurus-theme-openapi-docs', '@docusaurus/theme-mermaid'],
212 themeConfig: {
213 // SEO metadata configuration
214 metadata: [
215 {
216 name: 'keywords',
217 content:
218 'spice, spice.ai, sql query engine, ai compute engine, data federation, data acceleration, rag, retrieval augmented generation, arrow flight, datafusion, duckdb, rust, llm, openai compatible, mcp server'
219 },
220 { name: 'author', content: 'Spice AI, Inc.' },
221 { name: 'robots', content: 'index, follow' },
222 { property: 'og:type', content: 'website' },
223 { property: 'og:site_name', content: 'Spice.ai OSS' },
224 { property: 'og:image:width', content: '1200' },
225 { property: 'og:image:height', content: '630' },
226 { property: 'og:image:alt', content: 'Spice.ai - SQL Query and AI Compute Engine' },
227 { name: 'twitter:card', content: 'summary_large_image' },
228 { name: 'twitter:site', content: '@spice_ai' },
229 { name: 'twitter:creator', content: '@spice_ai' }
230 ],
231 announcementBar: {
232 content: '<a href="/releases/v2.4.1">Spice.ai OSS v2.4.1</a> is now available! 🎉',
233 backgroundColor: 'var(--announcement-bar-bg)',
234 textColor: 'var(--announcement-bar-text)',
235 isCloseable: true
236 },
237 navbar: {
238 title: 'Spice.ai OSS',
239 logo: {
240 alt: 'Spice.ai OSS logo',
241 src: 'img/logo.svg'
242 },
243 hideOnScroll: true,
244 items: [
245 {
246 type: 'doc',
247 position: 'left',
248 docId: 'index',
249 label: 'Docs'
250 },
251 {
252 type: 'docSidebar',
253 position: 'left',
254 sidebarId: 'api',
255 label: 'API'
256 },
257 { to: 'releases', label: 'Releases', position: 'left' },
258 { to: 'cookbook', label: 'Cookbook', position: 'left' },
259 { to: 'docs/reference/sql', label: 'SQL Reference', position: 'left' },
260 // Version dropdown is only shown when versions exist
261 ...(hasVersions
262 ? [
263 {
264 type: 'docsVersionDropdown' as const,
265 position: 'right' as const,
266 dropdownActiveClassDisabled: true
267 }
268 ]
269 : []),
270 {
271 label: 'Try Spice Cloud',
272 href: 'https://spice.ai/login',
273 position: 'right'
274 },
275 {
276 type: 'dropdown',
277 label: 'Community',
278 position: 'right',
279 items: [
280 { label: 'X', href: 'https://x.com/spice_ai' },
281 { label: 'Slack', href: 'https://spice.ai/slack' },
282 { label: 'YouTube', href: 'https://www.youtube.com/@spiceai' },
283 { label: 'Blog', href: 'https://spice.ai/blog' }
284 ]
285 },
286 {
287 href: 'https://github.com/spiceai/spiceai',
288 position: 'right',
289 className: 'header-github-link',
290 'aria-label': 'GitHub repository'
291 }
292 ]
293 },
294 footer: {
295 style: 'dark',
296 links: [
297 {
298 title: 'Docs',
299 items: [
300 {
301 label: 'Getting Started',
302 to: '/docs/getting-started'
303 },
304 {
305 label: 'API',
306 to: '/docs/api'
307 },
308 {
309 label: 'CLI',
310 to: '/docs/cli'
311 },
312 {
313 label: 'SDKs',
314 to: '/docs/sdks'
315 }
316 ]
317 },
318 {
319 title: 'Community',
320 items: [
321 {
322 label: 'Reddit',
323 href: 'https://reddit.com/r/spiceai'
324 },
325 {
326 label: 'Slack',
327 href: 'https://spice.ai/slack'
328 },
329 {
330 label: 'X',
331 href: 'https://x.com/spice_ai'
332 },
333 {
334 label: 'YouTube',
335 href: 'https://www.youtube.com/@spiceai'
336 }
337 ]
338 },
339 {
340 title: 'More',
341 items: [
342 {
343 label: 'Blog',
344 href: 'https://spice.ai/blog'
345 },
346 {
347 label: 'GitHub',
348 href: 'https://github.com/spiceai/spiceai'
349 }
350 ]
351 }
352 ],
353 copyright: `Copyright © 2025 Spice AI, Inc.`
354 },
355 languageTabs: [
356 {
357 highlight: 'bash',
358 language: 'curl',
359 logoClass: 'curl'
360 }
361 ],
362 prism: {
363 theme: prismThemes.oneLight,
364 darkTheme: prismThemes.gruvboxMaterialDark,
365 additionalLanguages: ['bash', 'json', 'csharp']
366 },
367 algolia: {
368 appId: '0SP8I8JTL8',
369 apiKey: '72f66fe334ccd3c7db696a123d68735c',
370 indexName: 'spiceai',
371 contextualSearch: true
372 }
373 } satisfies Preset.ThemeConfig,
374
375 headTags: [
376 // Structured data for SEO (JSON-LD)
377 {
378 tagName: 'script',
379 attributes: {
380 type: 'application/ld+json'
381 },
382 innerHTML: JSON.stringify({
383 '@context': 'https://schema.org',
384 '@type': 'SoftwareApplication',
385 name: 'Spice.ai OSS',
386 applicationCategory: 'DeveloperApplication',
387 operatingSystem: 'Linux, macOS, Windows',
388 description:
389 'A portable SQL query and AI compute engine, written in Rust, for data-grounded apps and agents.',
390 url: 'https://spiceai.org',
391 downloadUrl: 'https://github.com/spiceai/spiceai/releases',
392 softwareVersion: '1.10.0',
393 author: {
394 '@type': 'Organization',
395 name: 'Spice AI, Inc.',
396 url: 'https://spice.ai'
397 },
398 license: 'https://github.com/spiceai/spiceai/blob/trunk/LICENSE',
399 programmingLanguage: 'Rust',
400 offers: {
401 '@type': 'Offer',
402 price: '0',
403 priceCurrency: 'USD'
404 }
405 })
406 },
407 {
408 tagName: 'script',
409 attributes: {
410 type: 'application/ld+json'
411 },
412 innerHTML: JSON.stringify({
413 '@context': 'https://schema.org',
414 '@type': 'Organization',
415 name: 'Spice AI, Inc.',
416 url: 'https://spice.ai',
417 logo: 'https://spiceai.org/img/logo.svg',
418 sameAs: [
419 'https://github.com/spiceai',
420 'https://x.com/spice_ai',
421 'https://www.youtube.com/@spiceai',
422 'https://www.linkedin.com/company/spiceai'
423 ]
424 })
425 },
426 {
427 tagName: 'link',
428 attributes: {
429 rel: 'preconnect',
430 href: 'https://fonts.googleapis.com'
431 }
432 },
433 {
434 tagName: 'link',
435 attributes: {
436 rel: 'preconnect',
437 href: 'https://fonts.gstatic.com',
438 crossorigin: 'true'
439 }
440 },
441 {
442 tagName: 'link',
443 attributes: {
444 href: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap',
445 rel: 'stylesheet'
446 }
447 },
448 {
449 tagName: 'link',
450 attributes: {
451 rel: 'icon',
452 type: 'image/png',
453 sizes: '32x32',
454 href: '/favicon-32x32.png'
455 }
456 },
457 {
458 tagName: 'link',
459 attributes: {
460 rel: 'icon',
461 type: 'image/png',
462 sizes: '16x16',
463 href: '/favicon-16x16.png'
464 }
465 },
466 {
467 tagName: 'script',
468 attributes: {
469 type: 'text/javascript',
470 id: 'hs-script-loader',
471 async: 'true',
472 defer: 'true',
473 src: '//js.hs-scripts.com/46107967.js'
474 }
475 },
476 // SEO: hreflang for language targeting
477 {
478 tagName: 'link',
479 attributes: {
480 rel: 'alternate',
481 hreflang: 'en',
482 href: 'https://spiceai.org'
483 }
484 },
485 {
486 tagName: 'link',
487 attributes: {
488 rel: 'alternate',
489 hreflang: 'x-default',
490 href: 'https://spiceai.org'
491 }
492 }
493 ],
494
495 plugins: [
496 tailwindPlugin,
497 [
498 '@docusaurus/plugin-content-blog',
499 {
500 id: 'releases',
501 path: 'releases',
502 routeBasePath: 'releases',
503 showLastUpdateAuthor: true,
504 showLastUpdateTime: true,
505 onInlineTags: 'throw',
506 onUntruncatedBlogPosts: 'ignore',
507 editUrl: ({ locale, blogDirPath, blogPath }) => {
508 return `https://github.com/spiceai/docs/edit/trunk/website/${blogDirPath}/${blogPath}`
509 },
510 remarkPlugins: [],
511 postsPerPage: 10,
512 feedOptions: {
513 type: 'all',
514 description: 'Keep up to date with Spice.ai OSS releases by following our feed!',
515 copyright: `Copyright © 2025-2026 Spice AI, Inc.`,
516 xslt: true
517 },
518 blogTitle: 'Spice.ai OSS Releases',
519 blogDescription: 'Spice.ai OSS release notes and announcements',
520 blogSidebarCount: 'ALL',
521 blogSidebarTitle: 'All Releases'
522 } satisfies BlogOptions
523 ],
524 [
525 'docusaurus-plugin-openapi-docs',
526 {
527 id: 'api',
528 docsPluginId: 'classic',
529 config: {
530 spice: {
531 proxy: 'http://localhost:8090',
532
533 specPath: 'public/openapi.json',
534 outputDir: 'docs/api/HTTP',
535 sidebarOptions: {
536 groupPathsBy: 'tag'
537 }
538 } satisfies OpenApiPlugin.Options
539 }
540 }
541 ],
542 [
543 '@docusaurus/plugin-client-redirects',
544 {
545 redirects: [
546 {
547 from: '/blog',
548 to: 'https://spice.ai/blog'
549 },
550 {
551 from: '/blog/announcing-1.0-stable',
552 to: 'https://spice.ai/blog/announcing-spice-ai-open-source-1-0-stable'
553 },
554 {
555 from: '/blog/amazon-s3-vectors-with-spice',
556 to: 'https://spice.ai/blog/getting-started-with-amazon-s3-vectors-and-spice'
557 },
558 {
559 from: '/blog/releases/v1.10-0',
560 to: '/releases/v1.10.0'
561 },
562 {
563 from: '/query-federation',
564 to: '/docs/features/query-federation'
565 },
566 {
567 from: '/docs/next/features/large-language-models/evaluate',
568 to: '/docs/next/features/large-language-models/decisions'
569 },
570 // The duckdb acceleration engine is removed in v2.5 (spiceai/spiceai#16124).
571 {
572 from: '/docs/next/components/data-accelerators/duckdb/deployment',
573 to: '/docs/next/components/data-accelerators/duckdb'
574 },
575 // Linked from the runtime's Bedrock reasoning_effort messages (spiceai/spiceai#15422).
576 // The reasoning guidance is on the vNext page until a release ships it.
577 {
578 from: '/docs/components/models/aws-bedrock',
579 to: '/docs/next/components/models/bedrock'
580 },
581 // 2021 blog posts
582 {
583 from: '/blog/a-new-class-of-applications-that-learn-and-adapt',
584 to: 'https://spice.ai/blog/a-new-class-of-applications-that-learn-and-adapt'
585 },
586 {
587 from: '/blog/2021/a-new-class-of-applications-that-learn-and-adapt',
588 to: 'https://spice.ai/blog/a-new-class-of-applications-that-learn-and-adapt'
589 },
590 {
591 from: '/blog/ai-needs-ai-ready-data',
592 to: 'https://spice.ai/blog/ai-needs-ai-ready-data'
593 },
594 {
595 from: '/blog/2021/ai-needs-ai-ready-data',
596 to: 'https://spice.ai/blog/ai-needs-ai-ready-data'
597 },
598 {
599 from: '/blog/making-apps-that-learn-and-adapt',
600 to: 'https://spice.ai/blog/making-apps-that-learn-and-adapt'
601 },
602 {
603 from: '/blog/2021/making-apps-that-learn-and-adapt',
604 to: 'https://spice.ai/blog/making-apps-that-learn-and-adapt'
605 },
606 {
607 from: '/blog/q-learning-reward-is-all-you-need',
608 to: 'https://spice.ai/blog/q-learning-reward-is-all-you-need'
609 },
610 {
611 from: '/blog/spiceais-approach-to-time-series-ai',
612 to: 'https://spice.ai/blog/spiceais-approach-to-time-series-ai'
613 },
614 {
615 from: '/blog/2021/spiceais-approach-to-time-series-ai',
616 to: 'https://spice.ai/blog/spiceais-approach-to-time-series-ai'
617 },
618 {
619 from: '/blog/spicepods-from-zero-to-hero',
620 to: 'https://spice.ai/blog/spicepods-from-zero-to-hero'
621 },
622 {
623 from: '/blog/2021/spicepods-from-zero-to-hero',
624 to: 'https://spice.ai/blog/spicepods-from-zero-to-hero'
625 },
626 {
627 from: '/blog/teaching-apps-how-to-learn-with-spicepods',
628 to: 'https://spice.ai/blog/teaching-apps-how-to-learn-with-spicepods'
629 },
630 // 2022 blog posts
631 {
632 from: '/blog/adding-soft-actor-critic',
633 to: 'https://spice.ai/blog/adding-soft-actor-critic'
634 },
635 {
636 from: '/blog/building-on-apache-arrow-and-flight',
637 to: 'https://spice.ai/blog/building-on-apache-arrow-and-flight'
638 },
639 {
640 from: '/blog/what-data-informs-ai-driven-decision-making',
641 to: 'https://spice.ai/blog/what-data-informs-ai-driven-decision-making'
642 },
643 {
644 from: '/blog/2022/what-data-informs-ai-driven-decision-making',
645 to: 'https://spice.ai/blog/what-data-informs-ai-driven-decision-making'
646 },
647 // 2024 blog posts
648 {
649 from: '/blog/adding-spice',
650 to: 'https://spice.ai/blog/adding-spice-the-next-generation-of-spice-ai-oss'
651 },
652 {
653 from: '/blog/2024/adding-spice',
654 to: 'https://spice.ai/blog/adding-spice--the-next-generation-of-spice-ai-oss'
655 },
656 {
657 from: '/federated-queries',
658 to: '/docs/features/query-federation'
659 },
660 {
661 from: '/data-ingestion',
662 to: '/docs/features/data-ingestion'
663 },
664 {
665 from: '/data-acceleration',
666 to: '/docs/features/data-acceleration'
667 },
668 {
669 from: '/monitoring',
670 to: '/docs/features/observability'
671 }
672 ]
673 }
674 ],
675 [
676 '@signalwire/docusaurus-plugin-llms-txt',
677 {
678 siteTitle: 'Spice.ai OSS',
679 siteDescription:
680 'A portable SQL query and AI compute engine, written in Rust, for data-grounded apps and agents.',
681 depth: 2,
682 logLevel: 1,
683 content: {
684 includeBlog: false,
685 includePages: true,
686 includeDocs: true,
687 includeVersionedDocs: false,
688 enableLlmsFullTxt: true,
689 // Served to agents that request text/markdown (functions/_middleware.js).
690 enableMarkdownFiles: true,
691 excludeRoutes: ['/tags/**', '/search', '/api/HTTP/**'],
692 // The plugin's default selectors, then .main-wrapper for the homepage, which has no <main>
693 // element. Without it, the homepage Markdown includes the navbar.
694 contentSelectors: [
695 '.theme-doc-markdown',
696 'main .container .col',
697 'main .theme-doc-wrapper',
698 'article',
699 'main .container',
700 'main',
701 '.main-wrapper'
702 ]
703 },
704 optionalLinks: [
705 {
706 title: 'GitHub Repository',
707 url: 'https://github.com/spiceai/spiceai',
708 description: 'Spice.ai OSS source code and issue tracker'
709 },
710 {
711 title: 'Cookbook',
712 url: 'https://github.com/spiceai/cookbook',
713 description: 'Ready-to-use recipes and examples for Spice.ai'
714 },
715 {
716 title: 'Spice Cloud Platform',
717 url: 'https://spice.ai',
718 description: 'Managed cloud platform for Spice.ai'
719 }
720 ]
721 }
722 ],
723 [
724 agentDiscoveryPlugin,
725 {
726 openApiSpec: 'public/openapi.json',
727 skillsRepository: 'spiceai/skills',
728 // The commit of the spiceai/skills v2.3.2 release. A commit, unlike a tag, cannot be moved to
729 // different content. Update it when a new skills release ships.
730 skillsCommit: 'b9bab4ec4d6d4d046d550c9866a784c0e952c0e0'
731 }
732 ]
733 ]
734}
735
736export default config
737
1import { themes as prismThemes } from 'prism-react-renderer'
2import type { Config } from '@docusaurus/types'
3import type * as Preset from '@docusaurus/preset-classic'
4
5import type * as OpenApiPlugin from 'docusaurus-plugin-openapi-docs'
6import type { Options as BlogOptions } from '@docusaurus/plugin-content-blog'
7import type { Options as PageOptions } from '@docusaurus/plugin-content-pages'
8
9import tailwindPlugin from './plugins/tailwind-config.cjs'
10import agentDiscoveryPlugin from './plugins/agent-discovery.cjs'
11import * as fs from 'fs'
12import * as path from 'path'
13
14// Load versions from versions.json if it exists (generated at build time)
15const versionsPath = path.join(__dirname, 'versions.json')
16const versions: string[] = fs.existsSync(versionsPath)
17 ? JSON.parse(fs.readFileSync(versionsPath, 'utf-8'))
18 : []
19
20// Build version configuration dynamically
21// Trunk docs (current) are "Next" at /docs/next
22// Highest version in versions.json (e.g., 1.11.x) is "Latest" at /docs (default)
23// Previous versions are at /docs/v1.10, etc.
24// Maintenance policy: latest + 1 previous minor versions are maintained
25const hasVersions = versions.length > 0
26
27// Extract major and minor version numbers from versions to determine ordering and maintenance status
28const getVersion = (v: string): { major: number; minor: number } => {
29 const match = v.match(/^(\d+)\.(\d+)/)
30 return match
31 ? { major: parseInt(match[1], 10), minor: parseInt(match[2], 10) }
32 : { major: 0, minor: 0 }
33}
34
35// Sort versions by semver (major desc, then minor desc)
36const sortedVersions = [...versions].sort((a, b) => {
37 const vA = getVersion(a)
38 const vB = getVersion(b)
39 if (vB.major !== vA.major) return vB.major - vA.major
40 return vB.minor - vA.minor
41})
42
43// Highest version is "latest", trunk (current) is "next"
44const latestVersion = sortedVersions[0] || null
45const latestVer = latestVersion ? getVersion(latestVersion) : { major: 0, minor: 0 }
46
47// Final release of the previous major stays maintained through the transition
48// (e.g. v1.11.x remains maintained after v2.0 ships as latest). sortedVersions is
49// major-desc, so the first entry below the latest major is that major's newest release.
50const prevMajorLatest = sortedVersions.find((v) => getVersion(v).major < latestVer.major) || null
51
52const docsVersionConfig = hasVersions
53 ? {
54 lastVersion: latestVersion!, // The stable release is the default
55 onlyIncludeVersions: [...versions, 'current'],
56 versions: {
57 current: {
58 label: 'Next',
59 path: 'next',
60 banner: 'unreleased' as const
61 },
62 ...Object.fromEntries(
63 versions.map((version) => {
64 const ver = getVersion(version)
65 const isLatest = version === latestVersion
66 // Maintained (no banner): the latest major's current + previous minor,
67 // plus the final release of the previous major (e.g. v1.11.x under v2.0).
68 const isMaintained =
69 ver.major > latestVer.major ||
70 (ver.major === latestVer.major && ver.minor >= latestVer.minor - 1) ||
71 version === prevMajorLatest
72
73 return [
74 version,
75 {
76 label: isLatest
77 ? `Latest (v${version.replace('.x', '')})`
78 : `v${version.replace('.x', '')}`,
79 path: isLatest ? '' : `v${version.replace('.x', '')}`,
80 banner: isMaintained ? ('none' as const) : ('unmaintained' as const)
81 }
82 ]
83 })
84 )
85 }
86 }
87 : {
88 // No versions generated - use current docs only (for local dev)
89 lastVersion: 'current',
90 versions: {
91 current: {
92 label: 'Latest',
93 path: '',
94 banner: 'none' as const
95 }
96 },
97 onlyIncludeVersions: ['current']
98 }
99
100const config: Config = {
101 title: 'Spice.ai OSS',
102 tagline:
103 'A portable SQL query and AI compute engine, written in Rust, for data-grounded apps and agents.',
104 favicon: 'img/favicon.ico',
105
106 // Set the production url of your site here
107 url: 'https://spiceai.org',
108 // Set the /<baseUrl>/ pathname under which your site is served
109 // For GitHub pages deployment, it is often '/<projectName>/'
110 baseUrl: '/',
111
112 trailingSlash: false,
113
114 // GitHub pages deployment config.
115 // If you aren't using GitHub pages, you don't need these.
116 organizationName: 'spiceai', // Usually your GitHub org/user name.
117 projectName: 'docs', // Usually your repo name.
118
119 onBrokenAnchors: 'throw',
120 onBrokenLinks: 'throw',
121
122 markdown: {
123 mermaid: true,
124 hooks: {
125 onBrokenMarkdownLinks: 'throw'
126 }
127 },
128
129 // Even if you don't use internationalization, you can use this field to set
130 // useful metadata like html lang. For example, if your site is Chinese, you
131 // may want to replace "en" with "zh-Hans".
132 i18n: {
133 defaultLocale: 'en',
134 locales: ['en']
135 },
136
137 future: {
138 v4: {
139 removeLegacyPostBuildHeadAttribute: true // required
140 },
141 faster: true
142 },
143
144 // Read by src/clientModules/webmcp.ts to search the latest docs version.
145 customFields: {
146 latestDocsVersion: latestVersion ?? 'current'
147 },
148
149 clientModules: ['./src/clientModules/webmcp.ts'],
150
151 presets: [
152 [
153 'classic',
154 {
155 docs: {
156 routeBasePath: '/docs',
157 path: 'docs',
158 sidebarPath: 'sidebars.ts',
159 onInlineTags: 'throw',
160 docItemComponent: '@theme/ApiItem',
161 editUrl: ({ versionDocsDirPath, docPath }) => {
162 return `https://github.com/spiceai/docs/edit/trunk/website/${versionDocsDirPath}/${docPath}`
163 },
164 ...docsVersionConfig
165 },
166 blog: {
167 path: 'blog',
168 showLastUpdateAuthor: true,
169 showLastUpdateTime: true,
170 onInlineTags: 'throw',
171 onUntruncatedBlogPosts: 'ignore',
172 editUrl: ({ locale, blogDirPath, blogPath }) => {
173 return `https://github.com/spiceai/docs/edit/trunk/website/${blogDirPath}/${blogPath}`
174 },
175 remarkPlugins: [],
176 postsPerPage: 5,
177 feedOptions: {
178 type: 'all',
179 description:
180 'Keep up to date with upcoming Spice.ai OSS releases and articles by following our feed!',
181 copyright: `Copyright © 2021-2026 Spice AI, Inc.`,
182 xslt: true
183 },
184 blogTitle: 'Spice.ai OSS blog',
185 blogDescription: 'Read blog posts about Spice.ai OSS from the team and community',
186 blogSidebarCount: 'ALL',
187 blogSidebarTitle: 'All Posts'
188 } satisfies BlogOptions,
189 pages: {
190 remarkPlugins: [],
191 showLastUpdateAuthor: true,
192 showLastUpdateTime: true
193 } satisfies PageOptions,
194 theme: {
195 customCss: ['./src/css/custom.css', './src/css/openapi.css', './src/css/preflight.css']
196 },
197 gtag: {
198 trackingID: 'G-SST0X6NS37',
199 anonymizeIP: true
200 },
201 sitemap: {
202 lastmod: 'date',
203 changefreq: 'weekly',
204 priority: 0.5,
205 ignorePatterns: ['/tags/**'],
206 filename: 'sitemap.xml'
207 }
208 } satisfies Preset.Options
209 ]
210 ],
211 themes: ['docusaurus-theme-openapi-docs', '@docusaurus/theme-mermaid'],
212 themeConfig: {
213 // SEO metadata configuration
214 metadata: [
215 {
216 name: 'keywords',
217 content:
218 'spice, spice.ai, sql query engine, ai compute engine, data federation, data acceleration, rag, retrieval augmented generation, arrow flight, datafusion, duckdb, rust, llm, openai compatible, mcp server'
219 },
220 { name: 'author', content: 'Spice AI, Inc.' },
221 { name: 'robots', content: 'index, follow' },
222 { property: 'og:type', content: 'website' },
223 { property: 'og:site_name', content: 'Spice.ai OSS' },
224 { property: 'og:image:width', content: '1200' },
225 { property: 'og:image:height', content: '630' },
226 { property: 'og:image:alt', content: 'Spice.ai - SQL Query and AI Compute Engine' },
227 { name: 'twitter:card', content: 'summary_large_image' },
228 { name: 'twitter:site', content: '@spice_ai' },
229 { name: 'twitter:creator', content: '@spice_ai' }
230 ],
231 announcementBar: {
232 content: '<a href="/releases/v2.4.1">Spice.ai OSS v2.4.1</a> is now available! 🎉',
233 backgroundColor: 'var(--announcement-bar-bg)',
234 textColor: 'var(--announcement-bar-text)',
235 isCloseable: true
236 },
237 navbar: {
238 title: 'Spice.ai OSS',
239 logo: {
240 alt: 'Spice.ai OSS logo',
241 src: 'img/logo.svg'
242 },
243 hideOnScroll: true,
244 items: [
245 {
246 type: 'doc',
247 position: 'left',
248 docId: 'index',
249 label: 'Docs'
250 },
251 {
252 type: 'docSidebar',
253 position: 'left',
254 sidebarId: 'api',
255 label: 'API'
256 },
257 { to: 'releases', label: 'Releases', position: 'left' },
258 { to: 'cookbook', label: 'Cookbook', position: 'left' },
259 { to: 'docs/reference/sql', label: 'SQL Reference', position: 'left' },
260 // Version dropdown is only shown when versions exist
261 ...(hasVersions
262 ? [
263 {
264 type: 'docsVersionDropdown' as const,
265 position: 'right' as const,
266 dropdownActiveClassDisabled: true
267 }
268 ]
269 : []),
270 {
271 label: 'Try Spice Cloud',
272 href: 'https://spice.ai/login',
273 position: 'right'
274 },
275 {
276 type: 'dropdown',
277 label: 'Community',
278 position: 'right',
279 items: [
280 { label: 'X', href: 'https://x.com/spice_ai' },
281 { label: 'Slack', href: 'https://spice.ai/slack' },
282 { label: 'YouTube', href: 'https://www.youtube.com/@spiceai' },
283 { label: 'Blog', href: 'https://spice.ai/blog' }
284 ]
285 },
286 {
287 href: 'https://github.com/spiceai/spiceai',
288 position: 'right',
289 className: 'header-github-link',
290 'aria-label': 'GitHub repository'
291 }
292 ]
293 },
294 footer: {
295 style: 'dark',
296 links: [
297 {
298 title: 'Docs',
299 items: [
300 {
301 label: 'Getting Started',
302 to: '/docs/getting-started'
303 },
304 {
305 label: 'API',
306 to: '/docs/api'
307 },
308 {
309 label: 'CLI',
310 to: '/docs/cli'
311 },
312 {
313 label: 'SDKs',
314 to: '/docs/sdks'
315 }
316 ]
317 },
318 {
319 title: 'Community',
320 items: [
321 {
322 label: 'Reddit',
323 href: 'https://reddit.com/r/spiceai'
324 },
325 {
326 label: 'Slack',
327 href: 'https://spice.ai/slack'
328 },
329 {
330 label: 'X',
331 href: 'https://x.com/spice_ai'
332 },
333 {
334 label: 'YouTube',
335 href: 'https://www.youtube.com/@spiceai'
336 }
337 ]
338 },
339 {
340 title: 'More',
341 items: [
342 {
343 label: 'Blog',
344 href: 'https://spice.ai/blog'
345 },
346 {
347 label: 'GitHub',
348 href: 'https://github.com/spiceai/spiceai'
349 }
350 ]
351 }
352 ],
353 copyright: `Copyright © 2025 Spice AI, Inc.`
354 },
355 languageTabs: [
356 {
357 highlight: 'bash',
358 language: 'curl',
359 logoClass: 'curl'
360 }
361 ],
362 prism: {
363 theme: prismThemes.oneLight,
364 darkTheme: prismThemes.gruvboxMaterialDark,
365 additionalLanguages: ['bash', 'json', 'csharp']
366 },
367 algolia: {
368 appId: '0SP8I8JTL8',
369 apiKey: '72f66fe334ccd3c7db696a123d68735c',
370 indexName: 'spiceai',
371 contextualSearch: true
372 }
373 } satisfies Preset.ThemeConfig,
374
375 headTags: [
376 // Structured data for SEO (JSON-LD)
377 {
378 tagName: 'script',
379 attributes: {
380 type: 'application/ld+json'
381 },
382 innerHTML: JSON.stringify({
383 '@context': 'https://schema.org',
384 '@type': 'SoftwareApplication',
385 name: 'Spice.ai OSS',
386 applicationCategory: 'DeveloperApplication',
387 operatingSystem: 'Linux, macOS, Windows',
388 description:
389 'A portable SQL query and AI compute engine, written in Rust, for data-grounded apps and agents.',
390 url: 'https://spiceai.org',
391 downloadUrl: 'https://github.com/spiceai/spiceai/releases',
392 softwareVersion: '1.10.0',
393 author: {
394 '@type': 'Organization',
395 name: 'Spice AI, Inc.',
396 url: 'https://spice.ai'
397 },
398 license: 'https://github.com/spiceai/spiceai/blob/trunk/LICENSE',
399 programmingLanguage: 'Rust',
400 offers: {
401 '@type': 'Offer',
402 price: '0',
403 priceCurrency: 'USD'
404 }
405 })
406 },
407 {
408 tagName: 'script',
409 attributes: {
410 type: 'application/ld+json'
411 },
412 innerHTML: JSON.stringify({
413 '@context': 'https://schema.org',
414 '@type': 'Organization',
415 name: 'Spice AI, Inc.',
416 url: 'https://spice.ai',
417 logo: 'https://spiceai.org/img/logo.svg',
418 sameAs: [
419 'https://github.com/spiceai',
420 'https://x.com/spice_ai',
421 'https://www.youtube.com/@spiceai',
422 'https://www.linkedin.com/company/spiceai'
423 ]
424 })
425 },
426 {
427 tagName: 'link',
428 attributes: {
429 rel: 'preconnect',
430 href: 'https://fonts.googleapis.com'
431 }
432 },
433 {
434 tagName: 'link',
435 attributes: {
436 rel: 'preconnect',
437 href: 'https://fonts.gstatic.com',
438 crossorigin: 'true'
439 }
440 },
441 {
442 tagName: 'link',
443 attributes: {
444 href: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;700&family=Roboto+Mono:ital,wght@0,100..700;1,100..700&display=swap',
445 rel: 'stylesheet'
446 }
447 },
448 {
449 tagName: 'link',
450 attributes: {
451 rel: 'icon',
452 type: 'image/png',
453 sizes: '32x32',
454 href: '/favicon-32x32.png'
455 }
456 },
457 {
458 tagName: 'link',
459 attributes: {
460 rel: 'icon',
461 type: 'image/png',
462 sizes: '16x16',
463 href: '/favicon-16x16.png'
464 }
465 },
466 {
467 tagName: 'script',
468 attributes: {
469 type: 'text/javascript',
470 id: 'hs-script-loader',
471 async: 'true',
472 defer: 'true',
473 src: '//js.hs-scripts.com/46107967.js'
474 }
475 },
476 // SEO: hreflang for language targeting
477 {
478 tagName: 'link',
479 attributes: {
480 rel: 'alternate',
481 hreflang: 'en',
482 href: 'https://spiceai.org'
483 }
484 },
485 {
486 tagName: 'link',
487 attributes: {
488 rel: 'alternate',
489 hreflang: 'x-default',
490 href: 'https://spiceai.org'
491 }
492 }
493 ],
494
495 plugins: [
496 tailwindPlugin,
497 [
498 '@docusaurus/plugin-content-blog',
499 {
500 id: 'releases',
501 path: 'releases',
502 routeBasePath: 'releases',
503 showLastUpdateAuthor: true,
504 showLastUpdateTime: true,
505 onInlineTags: 'throw',
506 onUntruncatedBlogPosts: 'ignore',
507 editUrl: ({ locale, blogDirPath, blogPath }) => {
508 return `https://github.com/spiceai/docs/edit/trunk/website/${blogDirPath}/${blogPath}`
509 },
510 remarkPlugins: [],
511 postsPerPage: 10,
512 feedOptions: {
513 type: 'all',
514 description: 'Keep up to date with Spice.ai OSS releases by following our feed!',
515 copyright: `Copyright © 2025-2026 Spice AI, Inc.`,
516 xslt: true
517 },
518 blogTitle: 'Spice.ai OSS Releases',
519 blogDescription: 'Spice.ai OSS release notes and announcements',
520 blogSidebarCount: 'ALL',
521 blogSidebarTitle: 'All Releases'
522 } satisfies BlogOptions
523 ],
524 [
525 'docusaurus-plugin-openapi-docs',
526 {
527 id: 'api',
528 docsPluginId: 'classic',
529 config: {
530 spice: {
531 proxy: 'http://localhost:8090',
532
533 specPath: 'public/openapi.json',
534 outputDir: 'docs/api/HTTP',
535 sidebarOptions: {
536 groupPathsBy: 'tag'
537 }
538 } satisfies OpenApiPlugin.Options
539 }
540 }
541 ],
542 [
543 '@docusaurus/plugin-client-redirects',
544 {
545 redirects: [
546 {
547 from: '/blog',
548 to: 'https://spice.ai/blog'
549 },
550 {
551 from: '/blog/announcing-1.0-stable',
552 to: 'https://spice.ai/blog/announcing-spice-ai-open-source-1-0-stable'
553 },
554 {
555 from: '/blog/amazon-s3-vectors-with-spice',
556 to: 'https://spice.ai/blog/getting-started-with-amazon-s3-vectors-and-spice'
557 },
558 {
559 from: '/blog/releases/v1.10-0',
560 to: '/releases/v1.10.0'
561 },
562 {
563 from: '/query-federation',
564 to: '/docs/features/query-federation'
565 },
566 {
567 from: '/docs/next/features/large-language-models/evaluate',
568 to: '/docs/next/features/large-language-models/decisions'
569 },
570 // The duckdb acceleration engine is removed in v2.5 (spiceai/spiceai#16124).
571 {
572 from: '/docs/next/components/data-accelerators/duckdb/deployment',
573 to: '/docs/next/components/data-accelerators/duckdb'
574 },
575 // Linked from the runtime's Bedrock reasoning_effort messages (spiceai/spiceai#15422).
576 // The reasoning guidance is on the vNext page until a release ships it.
577 {
578 from: '/docs/components/models/aws-bedrock',
579 to: '/docs/next/components/models/bedrock'
580 },
581 // 2021 blog posts
582 {
583 from: '/blog/a-new-class-of-applications-that-learn-and-adapt',
584 to: 'https://spice.ai/blog/a-new-class-of-applications-that-learn-and-adapt'
585 },
586 {
587 from: '/blog/2021/a-new-class-of-applications-that-learn-and-adapt',
588 to: 'https://spice.ai/blog/a-new-class-of-applications-that-learn-and-adapt'
589 },
590 {
591 from: '/blog/ai-needs-ai-ready-data',
592 to: 'https://spice.ai/blog/ai-needs-ai-ready-data'
593 },
594 {
595 from: '/blog/2021/ai-needs-ai-ready-data',
596 to: 'https://spice.ai/blog/ai-needs-ai-ready-data'
597 },
598 {
599 from: '/blog/making-apps-that-learn-and-adapt',
600 to: 'https://spice.ai/blog/making-apps-that-learn-and-adapt'
601 },
602 {
603 from: '/blog/2021/making-apps-that-learn-and-adapt',
604 to: 'https://spice.ai/blog/making-apps-that-learn-and-adapt'
605 },
606 {
607 from: '/blog/q-learning-reward-is-all-you-need',
608 to: 'https://spice.ai/blog/q-learning-reward-is-all-you-need'
609 },
610 {
611 from: '/blog/spiceais-approach-to-time-series-ai',
612 to: 'https://spice.ai/blog/spiceais-approach-to-time-series-ai'
613 },
614 {
615 from: '/blog/2021/spiceais-approach-to-time-series-ai',
616 to: 'https://spice.ai/blog/spiceais-approach-to-time-series-ai'
617 },
618 {
619 from: '/blog/spicepods-from-zero-to-hero',
620 to: 'https://spice.ai/blog/spicepods-from-zero-to-hero'
621 },
622 {
623 from: '/blog/2021/spicepods-from-zero-to-hero',
624 to: 'https://spice.ai/blog/spicepods-from-zero-to-hero'
625 },
626 {
627 from: '/blog/teaching-apps-how-to-learn-with-spicepods',
628 to: 'https://spice.ai/blog/teaching-apps-how-to-learn-with-spicepods'
629 },
630 // 2022 blog posts
631 {
632 from: '/blog/adding-soft-actor-critic',
633 to: 'https://spice.ai/blog/adding-soft-actor-critic'
634 },
635 {
636 from: '/blog/building-on-apache-arrow-and-flight',
637 to: 'https://spice.ai/blog/building-on-apache-arrow-and-flight'
638 },
639 {
640 from: '/blog/what-data-informs-ai-driven-decision-making',
641 to: 'https://spice.ai/blog/what-data-informs-ai-driven-decision-making'
642 },
643 {
644 from: '/blog/2022/what-data-informs-ai-driven-decision-making',
645 to: 'https://spice.ai/blog/what-data-informs-ai-driven-decision-making'
646 },
647 // 2024 blog posts
648 {
649 from: '/blog/adding-spice',
650 to: 'https://spice.ai/blog/adding-spice-the-next-generation-of-spice-ai-oss'
651 },
652 {
653 from: '/blog/2024/adding-spice',
654 to: 'https://spice.ai/blog/adding-spice--the-next-generation-of-spice-ai-oss'
655 },
656 {
657 from: '/federated-queries',
658 to: '/docs/features/query-federation'
659 },
660 {
661 from: '/data-ingestion',
662 to: '/docs/features/data-ingestion'
663 },
664 {
665 from: '/data-acceleration',
666 to: '/docs/features/data-acceleration'
667 },
668 {
669 from: '/monitoring',
670 to: '/docs/features/observability'
671 }
672 ]
673 }
674 ],
675 [
676 '@signalwire/docusaurus-plugin-llms-txt',
677 {
678 siteTitle: 'Spice.ai OSS',
679 siteDescription:
680 'A portable SQL query and AI compute engine, written in Rust, for data-grounded apps and agents.',
681 depth: 2,
682 logLevel: 1,
683 content: {
684 includeBlog: false,
685 includePages: true,
686 includeDocs: true,
687 includeVersionedDocs: false,
688 enableLlmsFullTxt: true,
689 // Served to agents that request text/markdown (functions/_middleware.js).
690 enableMarkdownFiles: true,
691 excludeRoutes: ['/tags/**', '/search', '/api/HTTP/**'],
692 // The plugin's default selectors, then .main-wrapper for the homepage, which has no <main>
693 // element. Without it, the homepage Markdown includes the navbar.
694 contentSelectors: [
695 '.theme-doc-markdown',
696 'main .container .col',
697 'main .theme-doc-wrapper',
698 'article',
699 'main .container',
700 'main',
701 '.main-wrapper'
702 ]
703 },
704 optionalLinks: [
705 {
706 title: 'GitHub Repository',
707 url: 'https://github.com/spiceai/spiceai',
708 description: 'Spice.ai OSS source code and issue tracker'
709 },
710 {
711 title: 'Cookbook',
712 url: 'https://github.com/spiceai/cookbook',
713 description: 'Ready-to-use recipes and examples for Spice.ai'
714 },
715 {
716 title: 'Spice Cloud Platform',
717 url: 'https://spice.ai',
718 description: 'Managed cloud platform for Spice.ai'
719 }
720 ]
721 }
722 ],
723 [
724 agentDiscoveryPlugin,
725 {
726 openApiSpec: 'public/openapi.json',
727 skillsRepository: 'spiceai/skills',
728 // The commit of the spiceai/skills v2.3.2 release. A commit, unlike a tag, cannot be moved to
729 // different content. Update it when a new skills release ships.
730 skillsCommit: 'b9bab4ec4d6d4d046d550c9866a784c0e952c0e0'
731 }
732 ]
733 ]
734}
735
736export default config
737
