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 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 Store

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

  1. Go to the Stores in your Mixedbread dashboard
  2. Create a new store for your documentation
  3. Copy the 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_STORE_ID "./content/docs"

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

Workflow

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

{
  "scripts": {
    "build": "... && mxbai vs sync YOUR_STORE_ID './content/docs' --ci"
  }
}

Search Client

  • Fumadocs UI: see Search UI for details.

  • Search Client:

    import { useDocsSearch } from 'fumadocs-core/search/client';
    
    const mxbai = new Mixedbread({
      apiKey: 'YOUR_API_KEY',
    });
    
    const client = useDocsSearch({
      type: 'mixedbread',
      client: mxbai,
    });

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

On this page