AI Samples for .NET

July 23, 2025 · View on GitHub

Welcome to the official home for .NET samples demonstrating how to use AI in your .NET applications. If you're new to AI, start at the top and work your way down. Otherwise, jump in wherever suits your interests.

Microsoft.Extensions.AI (preview)

Microsoft.Extensions.AI is a set of core .NET libraries developed in collaboration with the .NET ecosystem, including Semantic Kernel. These libraries provide a unified layer of C# abstractions for interacting with AI services, such as small and large language models (SLMs and LLMs) and embeddings.

Core benefits:

  • Unified API: Offers a consistent and standard set of APIs and conventions for integrating AI services into .NET applications.
  • Flexibility: Allows .NET library authors to use AI services without forcing a specific AI provider, making it parameterizable with any provider.
  • Ease of Use: Enables .NET application developers to experiment with different packages using the same underlying abstractions and to utilize a single API throughout their application.
  • Componentization: Facilitates the addition of new capabilities and simplifies the componentization and testing of applications.

For more details, see the Introducing Microsoft.Extensions.AI Preview blog post.

TopicGitHub Link
Abstraction implementationsGitHub Link
Azure OpenAIGitHub Link
OpenAIGitHub Link
Azure AI InferenceGitHub Link
OllamaGitHub Link

Microsoft.Extensions.AI.Evaluation (preview)

Microsoft.Extensions.AI.Evaluation is a set of .NET libraries that provide the tooling necessary to evaluate the quality and efficacy of LLM responses in your intelligent applications.

The Microsoft.Extensions.AI.Evaluation libraries are built on top of core AI abstractions defined in the Microsoft.Extensions.AI libraries above. For more details, see the following blog post: Evaluate the quality of your AI applications with ease

TopicGitHub Link
Microsoft.Extensions.AI.EvaluationAPI Usage Examples

Quickstarts using OpenAI

#TopicGitHub Link
1Text SummaryHike Benefits Summary Project
2Chat AppHiker AI Project
4Function CallingHiker AI Pro

Quickstarts using the Azure OpenAI SDK

#TopicGitHub Link
1Text SummaryHike Benefits Summary Project
2Chat AppHiker AI Project
4Function CallingHiker AI Pro

Chat samples

#TopicGitHub Link
1Customer SupportCustomer Support Project

Build 2024 - Infusing your .NET Apps with AI: Practical Tools and Techniques

Discover how to bring AI into your .NET application! This session covers the tools, libraries, and best practices for incorporating LLMs or other AI capabilities to create an "intelligent app". We'll explore practical examples, including how to leverage Azure AI services and the .NET AI ecosystem, to enhance your apps with AI.

Youtube: Infusing your .NET Apps with AI: Practical Tools and Techniques

Tutorial: Infusing your .NET Apps with AI: Practical Tools and Techniques

#TopicYouTube Link and TimeGitHub Link
1Hello Semantic Kernel3m 0sHello Semantic Kernel
2Add Chat History5m 40sAdd Chat History
3Add Plugin - Function Call7m 10sAdd Plugin - Function Call
4Add Logging9m 24sAdd Logging
5Add Plugin - Bing Search11m 15sAdd Plugin - Bing Search
6Modify Kernel Behavior with Dependency Injection12m 37sModifying Kernel Behavior with Dependency Injection
7Using Semantic Kernel in a Web App15m 57sUsing Semantic Kernel in a Web App

.NET Foundation

There are many .NET related projects on GitHub.

  • .NET home repo - links to 100s of .NET projects, from Microsoft and the community.
  • ASP.NET Core home - the best place to start learning about ASP.NET Core.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

License

.NET (including the csharp-notebooks repo) is licensed under the MIT license.