Docs
⚙️ Configuration
Meilisearch

Setting up MeiliSearch for LibreChat

MeiliSearch is a powerful, open-source search engine that enhances LibreChat’s functionality by enabling full-text search, typo tolerance, and instant search results for past conversations.

Follow these steps to set up MeiliSearch for LibreChat:

1. Download MeiliSearch

  • Go to the MeiliSearch GitHub releases page: https://github.com/meilisearch/meilisearch/releases
  • Download the latest version of MeiliSearch for your operating system (e.g., meilisearch-linux-amd64.tar.gz for Linux, meilisearch-macos-amd64 for macOS, or meilisearch-windows-amd64.zip for Windows).

2. Extract/Install MeiliSearch

  • Linux/macOS: Extract the downloaded archive to a directory of your choice.
  • Windows: Extract the ZIP file to a directory of your choice.

3. Make the MeiliSearch Binary Executable (Linux/macOS)

  • Open a terminal and navigate to the directory where you extracted MeiliSearch.
  • Run the following command to make the binary executable:
    Make the MeiliSearch Binary Executable
    chmod +x meilisearch

4. Generate a Master Key

  • Open a terminal (or Command Prompt on Windows) and navigate to the MeiliSearch directory.
  • Run the following command to generate a Master Key:
    Generate a Master Key
    ./meilisearch --generate-master-key
  • Copy the generated Master Key as you’ll need it later.

5. Start MeiliSearch

  • In the same terminal, run the following command to start MeiliSearch, replacing <your_master_key> with the Master Key you generated in the previous step:
    Start MeiliSearch
    ./meilisearch --master-key=<your_master_key>
  • MeiliSearch will now start running on the default port (7700).

6. Update LibreChat’s Environment Variables

  • Open the .env file in the root directory of your LibreChat project.

  • Add or update the following lines with your MeiliSearch configuration:

    .env
    SEARCH=true
    MEILI_NO_ANALYTICS=true
    MEILI_HOST=http://localhost:7700
    MEILI_MASTER_KEY=<your_master_key>
  • Replace <your_master_key> with the Master Key you generated earlier.

7. Start/Restart LibreChat

  • Start or restart your LibreChat application.

That’s it! With MeiliSearch set up and configured, LibreChat should now have the Conversation search feature enabled, allowing users to perform full-text searches, benefit from typo tolerance, and experience instant search results for their past conversations.

Note: Make sure to keep the MeiliSearch process running in the background for the search functionality to work correctly. You may want to set up a script or service to keep MeiliSearch running persistently.

8. Optional: Disable Meilisearch/Database Sync in a Multi-node Setup

If you’re running LibreChat in a node cluster, or multi-node setup, and want to disable the MeiliSearch indexing sync, you can set the MEILI_NO_SYNC environment variable to true in your .env file. This will prevent your database documents from syncing redundantly across multiple LibreChat instances, which can also lead to unnecessary resource consumption, as only one instance should be responsible for indexing.

.env
MEILI_NO_SYNC=true