Last week, Microsoft announced a new AI Chat Web App template, available in preview, designed to simplify AI development with .NET. This template is part of Microsoft’s ongoing efforts to make AI more accessible, offering scaffolding and guidance in Visual Studio, Visual Studio Code, and the .NET CLI.
As explained, the .NET AI Chat template helps developers quickly build AI-powered chat applications. It includes a Blazor-based web app and leverages Microsoft.Extensions.AI and Microsoft.Extensions.VectorData abstractions, following the Retrieval Augmented Generation (RAG) pattern commonly used in chat applications.
Key features include the ability to create a chat interface that interacts with custom data, such as sample PDFs or user data using the RAG pattern. The template supports both local and Azure integrations, including a local vector store for prototyping and Azure AI Search for more advanced setups. The generated code includes UI components for chat interactions, citation tracking, and follow-up suggestions, which as reported, can be customized or removed as needed.
(Source: Official Microsoft .NET DevBlogs)
To get started with the template, developers need to install it using the CLI command:
dotnet new install Microsoft.Extensions.AI.Templates
The template also simplifies data ingestion, with code for processing various data sources and formats. It includes sample PDFs and data ingestion code for developers to replace with their files. The application will automatically compare the contents of the folder and update the vector store accordingly.
However, as noted developers should be mindful of quota and rate limits with their AI model provider, as large data files may lead to errors or delays.
The product team highlights the following:
The code is built using Microsoft.Extensions.AI, which makes it very straightforward to plug in custom behaviors. You can give the chatbot access to call any C# function. This can extend its capabilities to include retrieving additional data or taking actions.
Looking ahead, the development team at Microsoft plans to expand the template offerings. Future updates will include an AI Console template, a Minimal API template, and support for .NET Aspire. Additionally, there are also plans to include these templates by default in the .NET SDK, and to explore support for Azure AI Foundry.
Lastly, Microsoft is working with the Semantic Kernel team to expand the template options for Semantic Kernel users.