Skip to main content
Solved

How-To Do Fuzzy Search and Similar Suggestions in Agent Studio

  • September 30, 2025
  • 6 replies
  • 90 views

hundleymf
Forum|alt.badge.img+4

How can I update a use case in the new Agent Studio to handle fuzzy searching?

Right now, it works fine if everything is spelled correctly, but if someone makes a typo, it doesn’t work.

For example, I my bot, asked "Who is the PLM for XMD NAFTA" and got this back from the bot “I understand you are looking for the PLM contact for XMD NAFTA. I searched the PLM contact directory and relevant knowledge sources, but I was unable to retrieve the contact information for the XMD NAFTA PLM. Based on info you provided, I am unsure of how to help. Please click on Get Help below to review the supported help options.”

However, there is no XMD NAFTA in the SharePoint list—it only has options like XD NAFTA, XMD EMEA, XM NAFTA, CLS NAFTA, FOX NAFTA, FOC NAFTA, DC NAFTA, PNP NAFTA, CAB NAFTA, FOD NAFTA, FOE NAFTA, and an LT NAFTA.

I was expecting the bot to tell me "XMD NAFTA isn’t found" but also show a list of the closest matches so I can pick one.

How do I set up the use case so it can identify that there isn’t an exact match but still suggest similar options?

Best answer by Kevin Mok

Hey ​@hundleymf - Those steps wouldn’t really help, and it would make the plugin quite complicated. I still believe SDA is the way here. Have you nominated yourself to the LP?

 

EDIT:

A way without SDA that we can try is the following:

  1. Duplicate your lookup action and Remove the $filter query parameter from the new one.
  2. In your conversation process create a slot called product_team_name (you can also do this in the current slot you already have)
    1. Add dynamic resolver
    2. Set the new lookup action as the method for this resolver
    3. set the output mapper to response.value
  3. In your action you will have to modify the input mapper a bit:
    1. product_team: data.product_team_name.Product

6 replies

Kevin Mok
Forum|alt.badge.img+1
  • Community Manager
  • September 30, 2025

Hey ​@hundleymf - How is the use case built? Can you explain how the SharePoint List is retrieved? And how are the lists presented?

Are you using slots? Dynamic resolvers? etc?


hundleymf
Forum|alt.badge.img+4
  • Author
  • Inspiring
  • October 1, 2025

HTTP Details:

 

    •   To get the data from SharePoint, we send an HTTP GET request to: https://graph.microsoft.com/v1.0

 

   •   The specific endpoint we use is /sites/{SiteID}/lists/{ListID}/items. We replaced {SiteID} and {ListID} with the actual IDs of the SharePoint site and list.

 

   •   We included $filter and $expand query parameters to specify:

 $filter=FieldName eq ‘Value’

$expand=fields 

When filtering, we use the internal names of the SharePoint fields—not the names users see.

 

   •   The header is set to: Prefer = HonorNonIndexedQueriesWarningMayFailRandomly.

 

Slot Details:

  • There is a slot named project_team_name.
  • Its data type is string.
  • It doesn't have a resolver strategy.
  • No slot validation policy is set.
  • The slot inference policy is to infer the slot value if it is available

 

In the Conversation Flow:

  • The input mapper:project_team: data.project_team_name

 

     •   The output mapper takes the data from the HTTP response schema and maps it like this:

MAP():      converter:     ContactDetails: item.fields.ContactDetails       MainContact: item.fields.Name[0].LookupValue       TeamMembers:             MAP():                converter:                      MemberName: item.LookupValue               items: item.fields.PURPLE       Project: item.fields.Project      items: response.value

 

    •    Output key: project_team


Kevin Mok
Forum|alt.badge.img+1
  • Community Manager
  • October 2, 2025

Thanks for the detailed response ​@hundleymf. The main issue is that when the agent collects the slot, the AI is unable to infer that the project_team_name is incorrect, since it has no context of what projects there are available. It passes the information the user provides to the HTTP Action direc.

When the HTTP action runs, it uses that slot and returns an empty response due to the filter in the HTTP Action. It’s a limitation on the Sharepoint API for not having a flexible filter. I am not familiar with SharePoint, but do they have a filter that allows an operator such as “LIKE” that allows fuzzy search?

 

If that is not possible, the next step here is to use SDA. If you are already in the limited preview, then making an API call without the filter clause and having it return the complete list of projects would allow SDA to kick in and do fuzzy searching for you.


hundleymf
Forum|alt.badge.img+4
  • Author
  • Inspiring
  • October 6, 2025

I got this response from a ticket I opened and I’m wondering ​@Kevin Mok if you can help me. As it’s still isn’t working.

 

This is an excellent use case for combining a Custom Data Type with a multi-step Resolver Strategy. This approach allows the AI agent to first try finding an exact match and, if that fails, automatically perform a fuzzy search to offer the most relevant suggestions to the user.

 

Here’s a step-by-step guide to set this up in the new Agent Studio:

 

Step 1: Create a Custom Data Type for Your Product Lines

First, we need to define what a "Product Line" is for the AI agent. A Custom Data Type gives the agent a structured understanding of the items in your SharePoint list.

  1. Navigate to Data Types in Agent Studio and click Create.
  2. Name it something descriptive, like u_coc_product_line
  3. Define its schema. A simple schema would include a unique ID and a name. For example: { "id": "string", "name": "string" }
  4. Click Publish.

 

Step 2: Create an Action to Find Closest Matches

Next, you'll create a Compound Action that orchestrates the fuzzy search. This action will take the user's raw text, fetch all available options from SharePoint, and use an LLM to identify the closest matches.

  1. Navigate to Actions > Compound Actions and click Create.
  2. Name it find_closest_product_lines_ca
  3. Define one input argument named query of type `string`.
  4. Construct the action with the following steps in the YAML editor:

Action Logic:

  1. Step 1: Fetch all product lines from your SharePoint list using your existing HTTP Action.
  2. Step 2: Use the built-in mw.generate_structured_value_action to compare the user's query against the list and find the best matches.
  3. Step 3: Return the list of matches.

 

Step 3: Configure the Resolver Strategy

Now, let's teach the agent how to use your new fuzzy-matching action to find a product line.

  1. Go back to your u_coc_product_line
  2.  Data Type and click the Resolver Strategy tab.
  3. Click Add Method and configure a new Dynamic method.
  4. Action: Select the find_closest_product_lines_ca Compound Action you just created.
  5. Input Mapping: Map the user's input to the action's query argument: query: data.user_provided_value
  6. Output Cardinality: Set this to Interpret output as a list of candidate values. This tells the agent to prompt the user to choose from the list of matches if more than one is found.
  7. Publish your Data Type.

 

For more details, you can refer to the Resolver Strategies documentation.

 

Step 4: Use the New Data Type in Your Conversational Process

Finally, update your main Conversational Process to use the new slot.

  1. Open your `COC_PLM_LOOKUP` process.
  2. Define a Slot named something like `product_line_to_lookup`.
  3. Set its **Data Type** to your custom `u_coc_product_line` type.

 

With this setup, when a user asks, "Who is the PLM for XMD NAFTA?", the agent will automatically use your fuzzy-search resolver to fill the `product_line_to_lookup` slot. It will see that 'XMD NAFTA' isn't an exact match, run your compound action, and then ask the user to clarify from a list of suggestions like 'XD NAFTA' and 'XMD EMEA'.

 

I get this: The bot responds with: "I am working to identify the PLM (Product Lifecycle Manager) for XMD NAFTA. To proceed, I need to confirm the specific product team or any additional details you can provide about "XMD NAFTA" to ensure I select the correct option. 👉 Could you clarify if "XMD NAFTA" is the exact product team name, or provide any additional context or related product information?"

Do I need to have five different steps for this to work? Meaning, do I need an HTTP Action, a Compound Action, Data Type/Resolver, Conversational Process, and the Plugin? Or am I doing too many steps?

I’ve also noticed in the logs that during the "conversational_process.step.execute" it says the output is NULL, and I get this error message: "This activity is still missing the following required inputs: query." I do have query in my input arguments in a couple places, so I’m confused.


Kevin Mok
Forum|alt.badge.img+1
  • Community Manager
  • Answer
  • October 8, 2025

Hey ​@hundleymf - Those steps wouldn’t really help, and it would make the plugin quite complicated. I still believe SDA is the way here. Have you nominated yourself to the LP?

 

EDIT:

A way without SDA that we can try is the following:

  1. Duplicate your lookup action and Remove the $filter query parameter from the new one.
  2. In your conversation process create a slot called product_team_name (you can also do this in the current slot you already have)
    1. Add dynamic resolver
    2. Set the new lookup action as the method for this resolver
    3. set the output mapper to response.value
  3. In your action you will have to modify the input mapper a bit:
    1. product_team: data.product_team_name.Product

hundleymf
Forum|alt.badge.img+4
  • Author
  • Inspiring
  • October 9, 2025

I haven’t nominated myself for the SDA LP yet, but I’ll look into that thank you!! You instructions helped quite a bit. I had to do a bit of updating, but I used what you gave me and used the Agent Architect and it was what I needed. Thanks a bunch!