This is a demo to showcase how to use the Semantic Kernel Agent Framework with .NET Aspire.
This sample simulates an agent that bases its answer on a knowledge base stored in Azure AI Search and uses Azure OpenAI to generate the answer. The knowledge base is populated via static data and is not retrieved from Azure AI Search. Nonetheless, it is easy to adapt the code to retrieve the data from Azure AI Search.
- Configure the OpenAI integration for .NET Aspire according to the documentation. You can also configure the Azure AI Search integration by following the documentation.
This template uses .NET Aspire Azure integrations.
You need to configure your Azure environment in AppHost appsettings.json
file.
"Azure": {
"SubscriptionId": "<YOUR_SUBSCRIPTION_ID>",
"AllowResourceGroupCreation": true,
"ResourceGroup": "<YOUR_RESOURCE_GROUP_NAME>",
"Location": "<YOUR_LOCATION>",
"CredentialSource": "<YOUR_CREDENTIAL_SOURCE>" // Options: "AzureCli", "AzurePowerShell", "VisualStudio", "AzureDeveloperCli", "InteractiveBrowser"
},
"Parameters": {
"existingOpenAIName": "<EXISTING_AZ_OAI_NAME>",
"existingOpenAIResourceGroup": "<EXISTING_RESOURCE_GROUP_NAME>"
}
- Run the sample
You can use dotnet to start the application:
cd src/Aspire.SK.RAG.AppHost
dotnet run
Or you can use the Aspire CLI to run the application:
aspire run