@vercel/geistdocs 1.25.2 → 1.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +8 -0
- package/dist/cli/index.js +6 -2
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/internal/chat-retrieval.d.ts +32 -0
- package/dist/internal/chat-retrieval.d.ts.map +1 -0
- package/dist/internal/chat-retrieval.js +91 -0
- package/dist/internal/mixedbread.d.ts +93 -0
- package/dist/internal/mixedbread.d.ts.map +1 -0
- package/dist/internal/mixedbread.js +286 -0
- package/dist/internal/page-actions-client.d.ts.map +1 -1
- package/dist/internal/page-actions-client.js +1 -19
- package/dist/internal/search-export.d.ts +18 -0
- package/dist/internal/search-export.d.ts.map +1 -0
- package/dist/internal/search-export.js +1 -0
- package/dist/internal/search-sync.d.ts +25 -0
- package/dist/internal/search-sync.d.ts.map +1 -0
- package/dist/internal/search-sync.js +312 -0
- package/dist/routes/chat.d.ts +8 -2
- package/dist/routes/chat.d.ts.map +1 -1
- package/dist/routes/chat.js +53 -15
- package/dist/routes/search-export.d.ts +12 -0
- package/dist/routes/search-export.d.ts.map +1 -0
- package/dist/routes/search-export.js +44 -0
- package/docs/agents.md +4 -3
- package/docs/llms.txt +384 -33
- package/docs/manifest.json +12 -3
- package/docs/pages/ask-ai.md +3 -0
- package/docs/pages/configuration.md +5 -2
- package/docs/pages/deployment.md +30 -5
- package/docs/pages/env.md +13 -3
- package/docs/pages/getting-started.md +29 -9
- package/docs/pages/index.md +3 -2
- package/docs/pages/md.md +1 -1
- package/docs/pages/migration.md +148 -8
- package/docs/pages/mixedbread-retrieval.md +144 -0
- package/docs/sitemap.md +3 -2
- package/package.json +10 -4
- package/template/.env.example +19 -0
- package/template/AGENTS.md +17 -3
- package/template/app/api/search/export/route.ts +8 -0
- package/template/content/docs/ask-ai.mdx +3 -0
- package/template/content/docs/configuration.mdx +5 -2
- package/template/content/docs/deployment.mdx +31 -6
- package/template/content/docs/env.mdx +14 -4
- package/template/content/docs/getting-started.mdx +30 -10
- package/template/content/docs/index.mdx +3 -2
- package/template/content/docs/md.mdx +1 -1
- package/template/content/docs/meta.json +1 -0
- package/template/content/docs/migration.mdx +150 -9
- package/template/content/docs/mixedbread-retrieval.mdx +142 -0
- package/template/geistdocs.tsx +12 -1
- package/template/lib/geistdocs/config.tsx +2 -5
- package/template/package.json +2 -2
|
@@ -14,8 +14,12 @@ related:
|
|
|
14
14
|
|
|
15
15
|
Migrate an existing Fumadocs or custom Geist documentation site to `@vercel/geistdocs` by moving shared behavior into package APIs and keeping site-specific adapters local. The safest migration keeps content, routing decisions, and product-specific UI in your app while replacing copied runtime code with thin package-backed adapters.
|
|
16
16
|
|
|
17
|
-
<
|
|
18
|
-
|
|
17
|
+
<Callout title="Geistcn is available on canary">
|
|
18
|
+
The current Geistcn migration is available from the `canary` dist-tag, not `latest`. The canary depends on restricted `@vercel/geistcn` packages and is intended for Vercel-internal projects while the migration is evaluated.
|
|
19
|
+
</Callout>
|
|
20
|
+
|
|
21
|
+
<CopyPrompt text="Help me migrate this existing docs site to package-backed Geistdocs. First determine whether I should use the stable release or the Geistcn canary. Inspect source.config.ts, lib/geistdocs/source.ts, app route files, proxy.ts or middleware.ts, public/llms.txt, Open Graph routes, Tailwind CSS setup, package.json AI SDK dependencies, and environment variables. For the Geistcn canary, also inspect package authentication, @vercel/geistdocs component and asset imports, root HTML classes, and Next.js configuration. Pin the selected version and use package APIs without copying package internals.">
|
|
22
|
+
Help me migrate this existing docs site to package-backed Geistdocs. First determine whether I should use the stable release or the Geistcn canary. Inspect `source.config.ts`, `lib/geistdocs/source.ts`, app route files, `proxy.ts` or `middleware.ts`, `public/llms.txt`, Open Graph routes, Tailwind CSS setup, `package.json` AI SDK dependencies, and environment variables. For the Geistcn canary, also inspect package authentication, `@vercel/geistdocs` component and asset imports, root HTML classes, and Next.js configuration. Pin the selected version and use package APIs without copying package internals.
|
|
19
23
|
</CopyPrompt>
|
|
20
24
|
|
|
21
25
|
## Before you migrate
|
|
@@ -28,6 +32,7 @@ Create a working branch and inventory the current site before replacing code:
|
|
|
28
32
|
- Static files that overlap package routes, such as `public/llms.txt`.
|
|
29
33
|
- Search, chat, `llms.txt`, page-level Markdown, `sitemap.md`, `agents.md`, `/.well-known/mcp.json`, RSS, and Open Graph routes.
|
|
30
34
|
- Tailwind CSS version and custom plugins.
|
|
35
|
+
- Imports from `@vercel/geistdocs/components/*` or `@vercel/geistdocs/assets/*` that the Geistcn canary removes.
|
|
31
36
|
- Direct app usage of `ai` or `@ai-sdk/react` outside Geistdocs.
|
|
32
37
|
- Environment variables required by the homepage, docs routes, or API routes.
|
|
33
38
|
|
|
@@ -42,20 +47,76 @@ Fix unrelated build failures first. A migration is safer when the starting point
|
|
|
42
47
|
|
|
43
48
|
## Install Geistdocs
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
For the current stable package-backed release, install `latest` and record the exact resolved version:
|
|
51
|
+
|
|
52
|
+
```bash title="Terminal"
|
|
53
|
+
pnpm add --save-exact @vercel/geistdocs@latest
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Geistdocs requires Node.js 20.9 or later and Next.js 16.3.3 or later within 16.x. Earlier 16.3 releases can retain an optional catch-all route's index content after a client navigation to a child page when Cache Components and Partial Prefetching are enabled.
|
|
57
|
+
|
|
58
|
+
If you are starting from a generated stable Geistdocs project and moving content into it, run the CLI from an empty parent folder:
|
|
59
|
+
|
|
60
|
+
```bash title="Terminal"
|
|
61
|
+
pnpm dlx @vercel/geistdocs@latest init --name my-docs
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Install the Geistcn canary
|
|
65
|
+
|
|
66
|
+
The Geistcn canary requires npm access to restricted `@vercel` packages. Configure your user-level npm authentication before installation:
|
|
67
|
+
|
|
68
|
+
```ini title="~/.npmrc"
|
|
69
|
+
@vercel:registry=https://registry.npmjs.org/
|
|
70
|
+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
|
|
71
|
+
always-auth=true
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Set `NPM_TOKEN` from an approved internal source and keep its value out of files and Git. Read [Deploy to Vercel](/docs/deployment#configure-private-package-access) for Vercel and GitHub Actions access.
|
|
75
|
+
|
|
76
|
+
For an existing standalone project, install the canary and the direct Geistcn dependencies used by application files. The current canary template uses `@vercel/geistcn` 1.0.3 and `@vercel/geistcn-assets` 2.0.1:
|
|
77
|
+
|
|
78
|
+
```bash title="Terminal"
|
|
79
|
+
pnpm add --save-exact \
|
|
80
|
+
@vercel/geistdocs@canary \
|
|
81
|
+
@vercel/geistcn@1.0.3 \
|
|
82
|
+
@vercel/geistcn-assets@2.0.1
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`--save-exact` records the canary resolved at install time instead of a range. Before upgrading later, check the next canary and test that exact version:
|
|
86
|
+
|
|
87
|
+
```bash title="Terminal"
|
|
88
|
+
npm view @vercel/geistdocs dist-tags.canary
|
|
89
|
+
```
|
|
46
90
|
|
|
47
|
-
|
|
91
|
+
In a monorepo that owns the Geistcn packages, such as `vercel/front`, keep their existing `workspace:*` dependency specifications and pin only `@vercel/geistdocs` to the tested canary.
|
|
92
|
+
|
|
93
|
+
If you are starting from a generated Geistdocs project and moving content into it, run the canary CLI from an empty parent folder:
|
|
48
94
|
|
|
49
95
|
```bash title="Terminal"
|
|
50
|
-
pnpm
|
|
96
|
+
pnpm dlx @vercel/geistdocs@canary init --name my-docs
|
|
51
97
|
```
|
|
52
98
|
|
|
53
|
-
|
|
99
|
+
## Replace imports for the Geistcn canary
|
|
100
|
+
|
|
101
|
+
The Geistcn canary removes generic design-system components and assets from the Geistdocs public API. Search for affected imports before upgrading:
|
|
54
102
|
|
|
55
103
|
```bash title="Terminal"
|
|
56
|
-
|
|
104
|
+
rg '@vercel/geistdocs/(components|assets)' .
|
|
57
105
|
```
|
|
58
106
|
|
|
107
|
+
Replace imports according to this table:
|
|
108
|
+
|
|
109
|
+
| Previous Geistdocs import | Replacement |
|
|
110
|
+
| --- | --- |
|
|
111
|
+
| `components/badge`, `components/button`, `components/dialog`, `components/drawer`, `components/input`, `components/kbd`, `components/separator`, `components/sheet`, `components/spinner`, `components/textarea`, `components/theme-switcher`, or `components/tooltip` | Import the matching component directly from `@vercel/geistcn/components/<name>`. |
|
|
112
|
+
| `components/switch` | Import toggle controls from `@vercel/geistcn/components/toggle`. |
|
|
113
|
+
| `components/sonner` | Use `Toasts` and `useToasts` from `@vercel/geistcn/components/toasts`. |
|
|
114
|
+
| `components/theme-aware-image` | Use `Image` from `@vercel/geistcn/components/image` with `srcLight` and `srcDark`. |
|
|
115
|
+
| `assets/icons`, `assets/icons/*`, `assets/logos`, or `assets/logos/*` | Import from `@vercel/geistcn-assets/icons`, `@vercel/geistcn-assets/icons/*`, `@vercel/geistcn-assets/logos`, or `@vercel/geistcn-assets/logos/*`. |
|
|
116
|
+
| `components/button-group`, `components/card`, or `components/input-group` | Use an appropriate Geistcn component or keep an application-owned composition. There is no direct Geistcn replacement with the same API. |
|
|
117
|
+
|
|
118
|
+
Keep documentation-specific composites such as `Callout`, `CodeBlock`, `CodeBlockTabs`, `CommandPrompt`, `CopyPrompt`, and `Mermaid` imported from `@vercel/geistdocs/components/*`.
|
|
119
|
+
|
|
59
120
|
## Configure Next.js
|
|
60
121
|
|
|
61
122
|
The Geistdocs Next.js integration composes Fumadocs MDX, enables automatic app-route discovery for agent-readable 404s, and preserves your Next.js configuration. Enable Cache Components in the same file:
|
|
@@ -74,6 +135,39 @@ const config: NextConfig = {
|
|
|
74
135
|
export default withGeistdocs(config);
|
|
75
136
|
```
|
|
76
137
|
|
|
138
|
+
### Configure Next.js for the Geistcn canary
|
|
139
|
+
|
|
140
|
+
Geistcn publishes TypeScript source from supporting packages. A project using the Geistcn canary also needs the matching transpilation and modular import settings:
|
|
141
|
+
|
|
142
|
+
```ts title="next.config.ts"
|
|
143
|
+
import { createGeistdocs } from "@vercel/geistdocs/next";
|
|
144
|
+
import type { NextConfig } from "next";
|
|
145
|
+
|
|
146
|
+
const withGeistdocs = createGeistdocs();
|
|
147
|
+
|
|
148
|
+
const config: NextConfig = {
|
|
149
|
+
modularizeImports: {
|
|
150
|
+
"@vercel/geistcn/components": {
|
|
151
|
+
skipDefaultConversion: true,
|
|
152
|
+
transform: "@vercel/geistcn/components/{{ kebabCase member }}",
|
|
153
|
+
},
|
|
154
|
+
"@vercel/geistcn/core": {
|
|
155
|
+
skipDefaultConversion: true,
|
|
156
|
+
transform: "@vercel/geistcn/core",
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
transpilePackages: [
|
|
160
|
+
"@vercel/geistcn",
|
|
161
|
+
"@vercel/geist-test-utils",
|
|
162
|
+
"@vercel/next-themes",
|
|
163
|
+
],
|
|
164
|
+
cacheComponents: true,
|
|
165
|
+
partialPrefetching: true,
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
export default withGeistdocs(config);
|
|
169
|
+
```
|
|
170
|
+
|
|
77
171
|
Restart `next dev` after adding, deleting, or renaming an App Router page or route. Production builds always regenerate the route manifest.
|
|
78
172
|
|
|
79
173
|
Every root dynamic parameter needs at least one value from `generateStaticParams`. For a site with a `[lang]` root segment, return every configured language from the root layout:
|
|
@@ -102,6 +196,33 @@ Keep `partialPrefetching` enabled so links reuse each route's static and cached
|
|
|
102
196
|
|
|
103
197
|
For unknown HTML pages, browsers can receive the docs loading shell with a `200` response before the page resolves to the not-found UI. Crawlers wait for the complete response and receive `404`. Machine-readable Markdown routes keep their configured status behavior.
|
|
104
198
|
|
|
199
|
+
## Configure the root layout for the Geistcn canary
|
|
200
|
+
|
|
201
|
+
Geistcn provides the fonts, theme classes, and Tailwind preflight used by the package UI. Apply them to the root `<html>` element:
|
|
202
|
+
|
|
203
|
+
```tsx title="app/[lang]/layout.tsx"
|
|
204
|
+
import { geistFontClasses } from "@vercel/geistcn/core";
|
|
205
|
+
import { cn } from "@vercel/geistcn/utils";
|
|
206
|
+
import type { ReactNode } from "react";
|
|
207
|
+
|
|
208
|
+
export default function RootLayout({ children }: { children: ReactNode }) {
|
|
209
|
+
return (
|
|
210
|
+
<html
|
|
211
|
+
className={cn(
|
|
212
|
+
geistFontClasses,
|
|
213
|
+
"tailwind tailwind-preflight antialiased"
|
|
214
|
+
)}
|
|
215
|
+
lang="en"
|
|
216
|
+
suppressHydrationWarning
|
|
217
|
+
>
|
|
218
|
+
<body>{children}</body>
|
|
219
|
+
</html>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Keep the site's existing providers and metadata inside this structure. If the route has a `[lang]` parameter, use the active language instead of the hardcoded `en` value.
|
|
225
|
+
|
|
105
226
|
## Align Ask AI dependencies
|
|
106
227
|
|
|
107
228
|
Geistdocs Ask AI uses AI SDK v6. Generated projects install `ai` v6 and `@ai-sdk/react` v3 so package-owned chat components and route helpers use the supported AI SDK APIs.
|
|
@@ -372,7 +493,7 @@ For a base-path application whose root page is documentation, add `"/"` to the s
|
|
|
372
493
|
|
|
373
494
|
## Configure Tailwind CSS
|
|
374
495
|
|
|
375
|
-
Tailwind CSS v4
|
|
496
|
+
Stable Geistdocs uses Tailwind CSS v4 with source entries for package components and related dependencies:
|
|
376
497
|
|
|
377
498
|
```css title="app/styles/geistdocs.css"
|
|
378
499
|
@import "tailwindcss";
|
|
@@ -386,6 +507,23 @@ Tailwind CSS v4 requires `@source` entries for package components and related de
|
|
|
386
507
|
|
|
387
508
|
Move Tailwind CSS v3 plugin utilities into CSS-first v4 utilities or theme variables. Keep custom token names stable while you migrate components.
|
|
388
509
|
|
|
510
|
+
### Configure Tailwind CSS for the Geistcn canary
|
|
511
|
+
|
|
512
|
+
For the Geistcn canary, use the import order and narrow Geistcn source scan from the canary template:
|
|
513
|
+
|
|
514
|
+
```css title="app/styles/geistdocs.css"
|
|
515
|
+
@import "@vercel/geistcn/tailwind.css";
|
|
516
|
+
@import "fumadocs-ui/css/shadcn.css";
|
|
517
|
+
@import "fumadocs-ui/css/preset.css";
|
|
518
|
+
@import "@vercel/geistdocs/theme.css";
|
|
519
|
+
@import "@vercel/geistcn/styles.css";
|
|
520
|
+
@import "@vercel/geistcn/marketing-typography.css";
|
|
521
|
+
|
|
522
|
+
@source "../../node_modules/@vercel/geistcn/src/components/**/*.{ts,tsx}";
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Geistcn owns the Geist tokens, theme, typography, preflight, and animation utilities. The Geistdocs theme entry point contains documentation and Fumadocs integration rules and sources the compiled Geistdocs runtime. Do not scan all of `@vercel/geistcn/src`; font internals in the published package can reference paths outside the application root and cause Turbopack to fail.
|
|
526
|
+
|
|
389
527
|
## Handle environment variables
|
|
390
528
|
|
|
391
529
|
Do not require production secrets for local migration builds. If a homepage or API route depends on a production-only secret, add a local fallback or disable that integration in development.
|
|
@@ -396,7 +534,7 @@ export const flagsSecret =
|
|
|
396
534
|
(process.env.NODE_ENV === "development" ? "local-development-secret" : undefined);
|
|
397
535
|
```
|
|
398
536
|
|
|
399
|
-
Keep real secrets in `.env.local` and out of Git.
|
|
537
|
+
Keep real application secrets in `.env.local` and out of Git. `NPM_TOKEN` is an install-time credential, not an application environment variable. Keep it in your shell, Vercel project settings, or GitHub Actions secrets, and never prefix it with `NEXT_PUBLIC_`.
|
|
400
538
|
|
|
401
539
|
## Verify the migration
|
|
402
540
|
|
|
@@ -404,10 +542,13 @@ Run the same checks after each routing or source change:
|
|
|
404
542
|
|
|
405
543
|
```bash title="Terminal"
|
|
406
544
|
pnpm postinstall
|
|
545
|
+
pnpm list @vercel/geistdocs
|
|
407
546
|
pnpm build
|
|
408
547
|
pnpm dev
|
|
409
548
|
```
|
|
410
549
|
|
|
550
|
+
For the Geistcn canary, also run `pnpm list @vercel/geistcn @vercel/geistcn-assets` and confirm the versions match the selected canary template.
|
|
551
|
+
|
|
411
552
|
Check these URLs locally:
|
|
412
553
|
|
|
413
554
|
- `/docs` or the migrated docs root.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Improve Ask AI answers with Mixedbread
|
|
3
|
+
description: Configure Mixedbread retrieval for a Geistdocs Ask AI chat and sync documentation to a site-specific Store
|
|
4
|
+
type: guide
|
|
5
|
+
summary: Provision a Mixedbread Store for one Geistdocs consumer site, enable semantic retrieval, and sync documentation during production builds.
|
|
6
|
+
prerequisites:
|
|
7
|
+
- /docs/ask-ai
|
|
8
|
+
- /docs/env
|
|
9
|
+
- /docs/deployment
|
|
10
|
+
related:
|
|
11
|
+
- /docs/configuration
|
|
12
|
+
- /docs/llms-txt
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
Mixedbread retrieval gives Ask AI the documentation passages that best match a user's question. The AI model stays the same, while semantic retrieval improves the evidence included with each question.
|
|
16
|
+
|
|
17
|
+
Geistdocs keeps the visible search dialog on its local Orama index. Mixedbread only changes the documentation retrieval used by Ask AI.
|
|
18
|
+
|
|
19
|
+
<CopyPrompt text="Help me enable Mixedbread retrieval for this Geistdocs consumer site. Confirm that I am in this site's own repository and linked to the correct Vercel project before provisioning a Store. Then verify siteId, ai.retrieval, the search export route, the build script, and the MXBAI environment variables.">
|
|
20
|
+
Help me enable Mixedbread retrieval for this Geistdocs consumer site. Confirm that I am in this site's own repository and linked to the correct Vercel project before provisioning a Store. Then verify `siteId`, `ai.retrieval`, the search export route, the build script, and the `MXBAI` environment variables.
|
|
21
|
+
</CopyPrompt>
|
|
22
|
+
|
|
23
|
+
## How Mixedbread retrieval works
|
|
24
|
+
|
|
25
|
+
Ask AI searches documentation before sending a question to the configured AI model. The default local retriever matches keywords with Orama. Mixedbread adds semantic matching and returns the relevant content chunk instead of the start of a matching page.
|
|
26
|
+
|
|
27
|
+
The production build performs an incremental sync:
|
|
28
|
+
|
|
29
|
+
1. Next.js statically generates `/api/search/export` from the site's configured content sources.
|
|
30
|
+
2. `geistdocs search sync` uploads new or changed Markdown documents to the site's Mixedbread Store.
|
|
31
|
+
3. Ask AI queries the Store by `siteId` and locale.
|
|
32
|
+
4. Geistdocs falls back to the local Orama retriever if Mixedbread is unavailable or its credentials are missing at runtime.
|
|
33
|
+
|
|
34
|
+
Pages with `internal: true` or `excludeFrom: [chat]` are omitted from the export and removed from the Store on the next successful sync.
|
|
35
|
+
|
|
36
|
+
## Prerequisites
|
|
37
|
+
|
|
38
|
+
Before enabling Mixedbread retrieval, confirm that:
|
|
39
|
+
|
|
40
|
+
- The Mixedbread Marketplace integration is installed on your Vercel team.
|
|
41
|
+
- The consumer site has its own Vercel project.
|
|
42
|
+
- The consumer repository uses a Geistdocs release that includes `geistdocs search sync` and `createSearchExportRoute`.
|
|
43
|
+
- `source.config.ts` enables `includeProcessedMarkdown`, as generated Geistdocs projects do by default.
|
|
44
|
+
- `next.config.ts` enables `cacheComponents`, as generated Geistdocs projects do by default. Next.js must statically prerender `/api/search/export` before the sync command runs.
|
|
45
|
+
|
|
46
|
+
Use one Store per consumer site. Separate Stores isolate deployments and cleanup while keeping the same configuration in every repository.
|
|
47
|
+
|
|
48
|
+
## Provision a Store from the consumer repository
|
|
49
|
+
|
|
50
|
+
Run the Vercel integration command from the root of the **consumer site's repository**. Do not run it from the `geistdocs` package repository or from another docs site's repository.
|
|
51
|
+
|
|
52
|
+
The current directory must be linked to the Vercel project that deploys this consumer site. Check `.vercel/project.json`, or run `vercel link` and select the correct project before provisioning the Store:
|
|
53
|
+
|
|
54
|
+
```bash title="Terminal"
|
|
55
|
+
cd path/to/consumer-site-repository
|
|
56
|
+
vercel link
|
|
57
|
+
vercel integration add mixedbread \
|
|
58
|
+
--name docs-my-product \
|
|
59
|
+
--environment production
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
If the repository is a monorepo, run the command from the directory where you link the target Vercel project. The Vercel project's configured Root Directory can still point to the Geistdocs application inside that repository.
|
|
63
|
+
|
|
64
|
+
The command provisions one Mixedbread Store, connects it to the currently linked Vercel project, and pulls these environment variables:
|
|
65
|
+
|
|
66
|
+
- `MXBAI_API_KEY`: Authenticates server-side Mixedbread API requests.
|
|
67
|
+
- `MXBAI_STORE_ID`: Identifies this consumer site's Store.
|
|
68
|
+
|
|
69
|
+
Vercel prints a resource link after provisioning. Confirm the connection with:
|
|
70
|
+
|
|
71
|
+
```bash title="Terminal"
|
|
72
|
+
vercel integration list --integration mixedbread
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Configure the consumer site
|
|
76
|
+
|
|
77
|
+
Set a unique `siteId` and enable Mixedbread in the consumer repository's root `geistdocs.tsx` file:
|
|
78
|
+
|
|
79
|
+
```tsx title="geistdocs.tsx"
|
|
80
|
+
import type {
|
|
81
|
+
GeistdocsAIConfig,
|
|
82
|
+
} from "@vercel/geistdocs/config";
|
|
83
|
+
|
|
84
|
+
export const siteId = "my-product-docs";
|
|
85
|
+
|
|
86
|
+
export const ai = {
|
|
87
|
+
retrieval: "mixedbread",
|
|
88
|
+
} satisfies GeistdocsAIConfig;
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The generated `lib/geistdocs/config.tsx` spreads `ai` into the package config. Keep `MXBAI_API_KEY` and `MXBAI_STORE_ID` out of `geistdocs.tsx` because that config is available to client components.
|
|
92
|
+
|
|
93
|
+
## Add the export route to an existing site
|
|
94
|
+
|
|
95
|
+
New Geistdocs projects include the export route. For an existing package-backed site, create this adapter:
|
|
96
|
+
|
|
97
|
+
```ts title="app/api/search/export/route.ts"
|
|
98
|
+
import { createSearchExportRoute } from "@vercel/geistdocs/routes/search-export";
|
|
99
|
+
import { config } from "@/lib/geistdocs/config";
|
|
100
|
+
import { geistdocsSource } from "@/lib/geistdocs/source";
|
|
101
|
+
|
|
102
|
+
export const { GET } = createSearchExportRoute({
|
|
103
|
+
config,
|
|
104
|
+
sources: [geistdocsSource],
|
|
105
|
+
});
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pass every configured source in `sources` when the site has multiple sections or documentation versions.
|
|
109
|
+
|
|
110
|
+
## Sync after each production build
|
|
111
|
+
|
|
112
|
+
New Geistdocs projects run the sync from their build script. For an existing site, update `package.json`:
|
|
113
|
+
|
|
114
|
+
```json title="package.json"
|
|
115
|
+
{
|
|
116
|
+
"scripts": {
|
|
117
|
+
"build": "next build && geistdocs search sync"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Deploy the site to production. The first production build uploads every chat-visible page. Later builds upload changed pages and remove stale pages while leaving unrelated Store files untouched.
|
|
123
|
+
|
|
124
|
+
Local and preview builds skip the remote sync. To test a sync outside a production Vercel build, build the site and run the sync with the linked project's production environment variables:
|
|
125
|
+
|
|
126
|
+
```bash title="Terminal"
|
|
127
|
+
pnpm build
|
|
128
|
+
vercel env run --environment production -- \
|
|
129
|
+
pnpm exec geistdocs search sync --allow-non-production
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
The sync command fails when Mixedbread retrieval is enabled for a production build but the Store environment variables are missing. The error prints the provisioning command and reminds you to run it from the correct consumer repository.
|
|
133
|
+
|
|
134
|
+
## Verify retrieval
|
|
135
|
+
|
|
136
|
+
Open the Mixedbread dashboard through Vercel and confirm that the Store contains one file per chat-visible documentation page:
|
|
137
|
+
|
|
138
|
+
```bash title="Terminal"
|
|
139
|
+
vercel integration open mixedbread
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Ask a question that uses different words from the page title. Ask AI should cite the relevant page and answer from the matching section. If Mixedbread returns an error or exceeds the request timeout, Geistdocs logs a warning and retries the question with local Orama retrieval.
|
package/template/geistdocs.tsx
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
GeistdocsAgentReadinessConfig,
|
|
3
|
+
GeistdocsAIConfig,
|
|
4
|
+
} from "@vercel/geistdocs/config";
|
|
2
5
|
|
|
3
6
|
export const Logo = () => (
|
|
4
7
|
<span className="font-semibold text-gray-1000 text-lg leading-none tracking-[-3%]">
|
|
@@ -36,6 +39,14 @@ export const title = "Geistdocs Documentation";
|
|
|
36
39
|
export const prompt =
|
|
37
40
|
"You are a helpful assistant specializing in answering questions about Geistdocs, a modern documentation template built with Next.js and Fumadocs.";
|
|
38
41
|
|
|
42
|
+
export const ai = {
|
|
43
|
+
footer: (
|
|
44
|
+
<div className="text-right">
|
|
45
|
+
<a href="https://example.com">Powered by your AI provider</a>
|
|
46
|
+
</div>
|
|
47
|
+
),
|
|
48
|
+
} satisfies GeistdocsAIConfig;
|
|
49
|
+
|
|
39
50
|
export const agent = {
|
|
40
51
|
product: {
|
|
41
52
|
name: "Geistdocs",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineConfig } from "@vercel/geistdocs/config";
|
|
2
2
|
import {
|
|
3
3
|
agent,
|
|
4
|
+
ai,
|
|
4
5
|
basePath,
|
|
5
6
|
github,
|
|
6
7
|
Logo,
|
|
@@ -28,10 +29,6 @@ export const config = defineConfig({
|
|
|
28
29
|
ai: {
|
|
29
30
|
prompt,
|
|
30
31
|
suggestions,
|
|
31
|
-
|
|
32
|
-
<div className="text-right">
|
|
33
|
-
<a href="https://example.com">Powered by your AI provider</a>
|
|
34
|
-
</div>
|
|
35
|
-
),
|
|
32
|
+
...ai,
|
|
36
33
|
},
|
|
37
34
|
});
|
package/template/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
6
|
"scripts": {
|
|
7
|
-
"build": "next build",
|
|
7
|
+
"build": "next build && geistdocs search sync",
|
|
8
8
|
"dev": "next dev",
|
|
9
9
|
"start": "next start",
|
|
10
10
|
"postinstall": "fumadocs-mdx",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@streamdown/code": "^1.0.1",
|
|
19
19
|
"@vercel/agent-readability": "^0.6.0",
|
|
20
20
|
"@vercel/analytics": "^1.6.1",
|
|
21
|
-
"@vercel/geistdocs": "1.
|
|
21
|
+
"@vercel/geistdocs": "1.26.0",
|
|
22
22
|
"@vercel/speed-insights": "^1.3.1",
|
|
23
23
|
"ai": "^6.0.132",
|
|
24
24
|
"class-variance-authority": "^0.7.1",
|