Last week, Microsoft announced a new AI chat web application template, currently in preview, designed to simplify AI application development in .NET. This template represents another significant step in Microsoft's push to democratize AI technology, providing scaffolding and guidance for use in Visual Studio, Visual Studio Code, and the .NET CLI.
Image Source Note: Image generated by AI, licensed through Midjourney.
According to Microsoft, this .NET AI chat template helps developers quickly build intelligent chat applications. The template is based on the Blazor framework, utilizes Microsoft.Extensions.AI and Microsoft.Extensions.VectorData abstractions, and follows the Retrieval-Augmented Generation (RAG) pattern commonly used in chat applications.
Its key feature is the ability to create chat interfaces that interact with custom data (such as sample PDF files or user data). Developers can choose to integrate locally or with Azure; the template supports local vector storage for easy prototyping and Azure AI Search for more advanced setups. The generated code includes UI components for chat interaction, citation tracking, and follow-up suggestions, which developers can customize or remove as needed.
To start using the template, developers simply need to install it using the following command in the command line:
dotnet new install Microsoft.Extensions.AI.Templates
Furthermore, the template simplifies the data ingestion process, including code to handle various data sources and formats. It provides example PDF files and their processing code, which developers can replace with their own files. The application will automatically compare folder contents and update the vector store accordingly. However, it's important to note that developers should exercise caution when using AI model providers to avoid errors or delays caused by large data files.
Microsoft's product team emphasizes that the code is built on Microsoft.Extensions.AI, making it very easy to customize plugin behavior. Developers can grant the chatbot access to any C# function, allowing for extended functionality, access to additional data, or execution of actions.
Looking ahead, the Microsoft development team plans to expand template options. Future updates will include AI console templates, minimal API templates, and support for .NET Aspire. Additionally, these templates are planned to be included by default in the .NET SDK, and support for Azure AI Foundry will be explored. Microsoft is also collaborating with the Semantic Kernel team to expand template options for Semantic Kernel users.