Skip to content

.Net: Added example of Azure AI Search as Plugin with custom schema and configurable search fields#5093

Merged
dmytrostruk merged 4 commits intomicrosoft:mainfrom
dmytrostruk:azure-ai-search-example
Feb 21, 2024
Merged

.Net: Added example of Azure AI Search as Plugin with custom schema and configurable search fields#5093
dmytrostruk merged 4 commits intomicrosoft:mainfrom
dmytrostruk:azure-ai-search-example

Conversation

@dmytrostruk
Copy link
Member

Motivation and Context

Today, Azure AI Search connector has two limitations:

  1. It's working only with predefined schema, which is not preferred approach, because index in Azure AI Search is customizable and may use different schema from the one that exists in SK today.
  2. Search operation uses only Embedding index field to perform search, while it's possible to specify multiple vector fields with different names.

In order to resolve these limitations, major refactoring on abstraction level is required, which will impact not only Azure AI Search connector, but all other memory connectors as well, and it will take some time.

This PR contains example that shows how to register Azure AI Search functionality in Kernel as Plugin and use it to perform search operations and communicate with AI based on your data. In this example, index schema is custom and can be changed when needed, as well as searchFields parameter is configurable via KernelArguments. The usage of Azure AI Search plugin is very similar to already existing approach with AzureAISearchMemoryStore connector.

Contribution Checklist

@dmytrostruk dmytrostruk self-assigned this Feb 20, 2024
@dmytrostruk dmytrostruk requested a review from a team as a code owner February 20, 2024 18:12
@markwallace-microsoft markwallace-microsoft added the .NET Issue or Pull requests regarding .NET code label Feb 20, 2024
Copy link
Member

@markwallace-microsoft markwallace-microsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the getting started story to run this sample?

One suggestion (and this would be a new task)

There is this sample https://github.com/Azure/azure-search-vector-samples which allows you to set up AI Search and vectorize some data e.g. you could use https://github.com/Azure-Samples/azure-search-sample-data

It would be great if there is a readme which suggests a path for someone to go from zero to having this sample up and running. This could be a Blog article or a page in our developer documentation.

@dmytrostruk
Copy link
Member Author

What is the getting started story to run this sample?

One suggestion (and this would be a new task)

There is this sample https://github.com/Azure/azure-search-vector-samples which allows you to set up AI Search and vectorize some data e.g. you could use https://github.com/Azure-Samples/azure-search-sample-data

It would be great if there is a readme which suggests a path for someone to go from zero to having this sample up and running. This could be a Blog article or a page in our developer documentation.

@markwallace-microsoft Great suggestion, thanks! I will think about ways how to provide all required information to run this sample as part of separate task.

@dmytrostruk dmytrostruk added this pull request to the merge queue Feb 21, 2024
Merged via the queue into microsoft:main with commit 6954e97 Feb 21, 2024
@dmytrostruk dmytrostruk deleted the azure-ai-search-example branch February 21, 2024 13:34
@dmytrostruk dmytrostruk linked an issue Feb 21, 2024 that may be closed by this pull request
LudoCorporateShark pushed a commit to LudoCorporateShark/semantic-kernel that referenced this pull request Aug 25, 2024
…nd configurable search fields (microsoft#5093)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

Today, Azure AI Search connector has two limitations:
1. It's working only with predefined schema, which is not preferred
approach, because index in Azure AI Search is customizable and may use
different schema from the one that exists in SK today.
2. Search operation uses only `Embedding` index field to perform search,
while it's possible to specify multiple vector fields with different
names.

In order to resolve these limitations, major refactoring on abstraction
level is required, which will impact not only Azure AI Search connector,
but all other memory connectors as well, and it will take some time.

This PR contains example that shows how to register Azure AI Search
functionality in Kernel as Plugin and use it to perform search
operations and communicate with AI based on your data. In this example,
index schema is custom and can be changed when needed, as well as
`searchFields` parameter is configurable via `KernelArguments`. The
usage of Azure AI Search plugin is very similar to already existing
approach with `AzureAISearchMemoryStore` connector.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
Bryan-Roe pushed a commit to Bryan-Roe-ai/semantic-kernel that referenced this pull request Oct 6, 2024
…nd configurable search fields (microsoft#5093)

### Motivation and Context

<!-- Thank you for your contribution to the semantic-kernel repo!
Please help reviewers and future users, providing the following
information:
  1. Why is this change required?
  2. What problem does it solve?
  3. What scenario does it contribute to?
  4. If it fixes an open issue, please link to the issue here.
-->

Today, Azure AI Search connector has two limitations:
1. It's working only with predefined schema, which is not preferred
approach, because index in Azure AI Search is customizable and may use
different schema from the one that exists in SK today.
2. Search operation uses only `Embedding` index field to perform search,
while it's possible to specify multiple vector fields with different
names.

In order to resolve these limitations, major refactoring on abstraction
level is required, which will impact not only Azure AI Search connector,
but all other memory connectors as well, and it will take some time.

This PR contains example that shows how to register Azure AI Search
functionality in Kernel as Plugin and use it to perform search
operations and communicate with AI based on your data. In this example,
index schema is custom and can be changed when needed, as well as
`searchFields` parameter is configurable via `KernelArguments`. The
usage of Azure AI Search plugin is very similar to already existing
approach with `AzureAISearchMemoryStore` connector.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NET Issue or Pull requests regarding .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.Net: Sample search plugins that uses Azure AI Search

3 participants