---
schema_version: "1"
id: e0e1ad4f1f696855a01b4e63d9d53773d989a0ef06e205abb359559357cde710
title: Configuring Semantic Routing Services
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/general/model-proxy-semantic-service.md
canonical_url: https://docs.mulesoft.com/general/model-proxy-semantic-service
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 74050a9c36cc7e17a6ae092a9f8088ab3384aefd7cacf67177ea85f7c7f54620
description: MuleSoft Documentation Site
latest: true
---
---
product: Getting Started
---

# Configuring Semantic Routing Services

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Semantic routing services compare incoming requests to defined prompt topics to route traffic to the
best-matching model path or block requests that match denylist topics. Model Proxy supports Basic
Scale semantic routing services for simple routing and Advanced Scale semantic routing services for
complex routing backed by an external vector database. Configure a semantic routing service before
creating a model proxy that uses semantic routing.

Model Proxy supports two types of semantic routing services:

- [Advanced Scale](#configure-an-advanced-scale-semantic-service):

  For complex semantic routing. Advanced scale semantic routing services use a vector database to
  store and compare prompt topic utterances. Advanced scale semantic routing services support
  unlimited prompt topics and 2000 utterances per prompt topic.

- [Basic Scale](#configure-a-basic-scale-semantic-service):

  For simple semantic routing and blocking. Basic scale semantic routing services support up to 6
  prompt topics and 10 utterances per prompt topic.

## Before You Begin

Before getting started, make sure you have:

- An Anypoint Platform account.

- One of these permissions:

  - Exchange: Exchange Contributor

  - Exchange: Exchange Administrator

  - Exchange: Exchange Creator

  For more information, see [Enhanced Experience Permissions](https://docs.mulesoft.com/general/exp-home-start#permissions).

## Configure an Advanced Scale Semantic Routing Service

1.  In the navigation pane, select **Model Proxies** > **Semantic Services**.

2.  Click **Add Semantic Service** > **Semantic Routing Service**.

3.  Select **Advanced Scale**.

    Advanced scale supports large utterance sets per topic and requires a dedicated external vector
    database connection.

4.  Configure the embedding connection parameters:

    - **Environment**: The environment to use for the semantic service.

    - **Embedding service provider**: The provider of the embedding model. Select from these
      options:

      - **OpenAI**

      - **Hugging Face**

      - **Azure OpenAI**.

    - **Service label**: Label to identify the new service. Shown as the label in the Semantic
      Services catalog.

    - **URL**: The URL of the embedding service.

    - **Model**: The embedding model to use.

    - **Auth key**: The API authentication key for the embedding service.

5.  Configure the vector connection parameters:

    - **Environment**: The environment to use for the vector database.

    - **Vector Database provider**: The provider of the vector database. Select from these options:

      - **Qdrant**

      - **Pinecone**

      - **Azure AI Search**

    - **Host**: The host URL of your vector database.

    - **API Key**: The API authentication key for the vector database.

    - **Collection**: The collection name in your vector database.

6.  Define prompt topics:

    Supports up to 2000 utterances per topic.

    1.  Click **Create Prompt Topic**.

    2.  Define a **Prompt topic name**.

    3.  Define prompt utterances or click **Upload utterances** to upload a plain text file
        containing your prompt utterances.

    4.  Create as many prompt topics as necessary. You can also create new prompt topics later by
        editing the semantic service.

        > [!NOTE] To deny users from asking about certain subjects, create prompt topics for the
        > subjects and apply them as deny list topics when configuring your Model Proxy.

7.  Click **Save & Download Script**.

8.  Open the downloaded `.sh` script file in your database to populate it with your scaled vectors.

## Configure a Basic Scale Semantic Routing Service

1.  In the navigation pane, click the **Model Proxies** dropdown arrow.

2.  Select **Semantic Services**.

3.  Click **Add Semantic Service** > **Semantic Routing Service**.

4.  Select **Basic Scale**.

    Basic scale supports up to six topics and 10 utterances per topic. Managed via internal Model
    Proxy configuration.

5.  Configure the embedding connection parameters:

    - **Environment**: The environment to use for the semantic service.

    - **Embedding service provider**: The provider of the embedding model: **OpenAI**, **Hugging
      Face**, or **Azure OpenAI**.

    - **Service label**: Label to identify the new service. Shown as the label in the Semantic
      Services catalog.

    - **URL**: The URL of the embedding service.

    - **Model**: The embedding model to use.

    - **Auth key**: The API authentication key for the embedding service.

6.  Click **Save**.

## Edit a Semantic Routing Service

To edit a semantic routing service:

1.  From **Semantic Service Setup**, click the three-dots menu
    (![3%](/mulesoft/current/en-us/gateway/latest/_images/three-dots-menu.png)) of the semantic routing service you want
    to edit.

2.  Make the necessary edits.

3.  Click either **Save** or **Save & Download Script** depending on your semantic routing service.

    If creating new prompt topics for an advanced scale semantic service, you must download and run
    the vector script in your database again.
