Docs Platform
Moss + VitePress: Instant Semantic Search for Documentation
The vitepress-plugin-moss package adds real-time semantic search to any VitePress documentation site. It auto-indexes your Markdown content at build time, provides a search UI activated by Ctrl+K / Cmd+K, and uses a two-phase search strategy: cloud-based search on first query while the WASM runtime downloads, then fully local sub-10ms search once loaded.
Benefits
Why Use Moss with VitePress
Drop-in Vite plugin - add mossIndexerPlugin() to your VitePress config and search is live
Auto-indexes all Markdown content at build time with no manual document management
Two-phase search: cloud hot-path on first query, then fully local WASM once downloaded
Built-in search UI with Ctrl+K / Cmd+K keyboard shortcut - no custom components needed
Sub-10ms local search after WASM initialization for instant results as users type
Integration
Quick Start
// .vitepress/config.ts
import { defineConfig } from 'vitepress'
import { mossIndexerPlugin } from 'vitepress-plugin-moss'
export default defineConfig({
vite: {
plugins: [
mossIndexerPlugin({
projectId: process.env.MOSS_PROJECT_ID!,
projectKey: process.env.MOSS_PROJECT_KEY!,
indexName: 'docs',
modelId: 'moss-minilm', // fast model for docs
}),
],
},
})
// That's it. Search UI is built in.
// Ctrl+K / Cmd+K to open search
// Auto-indexes all Markdown at build time
// Two-phase search: cloud first, then local WASMSetup
Get Started in 3 Steps
Install the plugin
Run npm install vitepress-plugin-moss to add the search plugin to your VitePress project.
Add to VitePress config
Import mossIndexerPlugin and add it to the vite.plugins array in .vitepress/config.ts. Pass your project credentials and index name.
Build and search
Run vitepress build. The plugin auto-indexes your Markdown content. Users can press Ctrl+K to search instantly.
FAQ
Frequently asked questions
Explore