Fumadocs

Mixedbread

Integrate Mixedbread Search with Fumadocs

Introduction

The Mixedbread Integration uses vector search to provide semantic search capabilities for your documentation. It indexes your documentation content into a vector store, enabling users to search using natural language queries and find relevant content based on meaning rather than just keyword matching.

Setup

Get your API Key

  1. Sign up at Mixedbread
  2. Navigate to API Keys
  3. Create a new API key and store it in your environment variables

Create a Vector Store

To sync your documentation, you'll need to create a vector store:

  1. Go to the Vector Stores in your Mixedbread dashboard
  2. Create a new vector store for your documentation
  3. Copy the vector store ID

Sync Documentation

Use the Mixedbread CLI to sync your documentation:

Install the CLI:

npm install @mixedbread/cli -D

Configure authentication and sync your documentation:

# Configure authentication
mxbai config keys add YOUR_API_KEY

# Sync your documentation
mxbai vs sync YOUR_VECTOR_STORE_ID "./content/docs"

The CLI will automatically detect changes in your documentation and update the vector store accordingly.

Workflow

You can automatically sync your documentation by adding a sync script to your package.json:

{
  "scripts": {
    "build": "next build && npm run sync-content",
    "sync-content": "mxbai vs sync YOUR_VECTOR_STORE_ID './content/docs' --ci"
  }
}

Options

Tag Filter

To filter search results by tags, add a tag field to your document metadata:

---
title: Mixedbread
description: Integrate Mixedbread Search with Fumadocs
url: /docs/headless/search/mixedbread
tag: docs
---
...

And update your search client:

  • Fumadocs UI: Enable Tag Filter on Search UI.

  • Search Client: You can add the tag filter like:

    import { useDocsSearch } from 'fumadocs-core/search/client';
    
    const { search, setSearch, query } = useDocsSearch({
      tag: '<your tag value>',
      // ...
    });

This allows you to scope searches to specific sections of your documentation.

How is this guide?

Last updated on