AI Samples for .NET: Integrating AI into Your .NET Applications
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
The AI Samples for .NET repository provides a comprehensive collection of samples demonstrating how to integrate artificial intelligence into .NET applications. It features examples using Microsoft.Extensions.AI for unified API access to AI services and Microsoft.Extensions.AI.Evaluation for assessing LLM response quality. This resource is ideal for .NET developers looking to leverage AI, including large language models, in their projects.
Repository Information
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
The dotnet/ai-samples repository is the official home for .NET samples that showcase how to effectively use AI in your .NET applications. Whether you are new to AI or looking to deepen your understanding, this repository offers a structured path to learning, starting from foundational concepts and progressing to more advanced topics. It primarily focuses on Microsoft.Extensions.AI and Microsoft.Extensions.AI.Evaluation, providing practical examples for various AI scenarios.
Microsoft.Extensions.AI
Microsoft.Extensions.AI is a set of core .NET libraries developed in collaboration with the .NET ecosystem, including Semantic Kernel. These libraries offer a unified layer of C# abstractions for interacting with diverse AI services, such as small and large language models (SLMs and LLMs) and embeddings. Key benefits include a consistent API, flexibility to use any AI provider, ease of use for developers, and improved componentization.
Microsoft.Extensions.AI.Evaluation
Microsoft.Extensions.AI.Evaluation provides .NET libraries with tools to evaluate the quality and efficacy of LLM responses in intelligent applications. Built upon the core AI abstractions from Microsoft.Extensions.AI, these libraries help ensure the reliability and performance of your AI-powered features.
Getting Started
To begin exploring the AI samples, you should clone the repository to your local machine. Each sample typically includes its own README.md file with specific instructions for setup and execution.
git clone https://github.com/dotnet/ai-samples.git
cd ai-samples
Ensure you have the necessary .NET SDK installed. Individual samples may require API keys for services like OpenAI or Azure OpenAI, which you will need to configure according to their respective documentation.
Examples and Quickstarts
The repository is rich with practical examples, categorized for easy navigation. Each link points directly to the relevant README.md within the GitHub repository for detailed instructions.
Microsoft.Extensions.AI Implementations
- Abstraction implementations: GitHub Link
- Azure OpenAI: GitHub Link
- OpenAI: GitHub Link
- Azure AI Inference: GitHub Link
- Ollama: GitHub Link
Microsoft.Extensions.AI.Evaluation Examples
- API Usage Examples: GitHub Link
Quickstarts using OpenAI
- Text Summary: Hike Benefits Summary Project
- Chat App: Hiker AI Project
- Function Calling: Hiker AI Pro
Quickstarts using the Azure OpenAI SDK
- Text Summary: Hike Benefits Summary Project
- Chat App: Hiker AI Project
- Function Calling: Hiker AI Pro
Chat Samples
- Customer Support: Customer Support Project
Build 2024 Tutorial
Follow along with the "Infusing your .NET Apps with AI: Practical Tools and Techniques" session from Build 2024. This tutorial covers integrating LLMs and other AI capabilities into .NET applications.
- YouTube Video: Infusing your .NET Apps with AI: Practical Tools and Techniques
- Tutorial steps, with links to both YouTube and GitHub:
- Hello Semantic Kernel: YouTube (3m 0s), GitHub
- Add Chat History: YouTube (5m 40s), GitHub
- Add Plugin - Function Call: YouTube (7m 10s), GitHub
- Add Logging: YouTube (9m 24s), GitHub
- Add Plugin - Bing Search: YouTube (11m 15s), GitHub
- Modify Kernel Behavior with Dependency Injection: YouTube (12m 37s), GitHub
- Using Semantic Kernel in a Web App: YouTube (15m 57s), GitHub
Why Use AI Samples for .NET?
This repository is an invaluable resource for .NET developers for several reasons:
- Practical Learning: Provides hands-on examples to understand and implement AI concepts in C#.
- Unified Abstractions: Showcases
Microsoft.Extensions.AI, which offers a consistent and standard set of APIs for integrating various AI services, reducing complexity. - Flexibility: Demonstrates how to build AI applications that are provider-agnostic, allowing easy switching between different AI services like OpenAI, Azure OpenAI, and Ollama.
- Evaluation Tools: Introduces
Microsoft.Extensions.AI.Evaluationfor robust testing and quality assurance of AI application responses. - Community and Best Practices: Aligns with the .NET ecosystem and promotes best practices for AI integration.
Useful Links
- GitHub Repository: dotnet/ai-samples
- Introducing Microsoft.Extensions.AI Preview blog post: Read the blog post
- Evaluate the quality of your AI applications with ease blog post: Read the blog post
- Build 2024 YouTube Video: Infusing your .NET Apps with AI: Practical Tools and Techniques
- Code of Conduct: The .NET Foundation Code of Conduct
Related repositories
Similar repositories that may be relevant next.

dotnet/skills: Curated .NET Agent Skills for AI Coding Agents
May 24, 2026
The dotnet/skills repository provides a curated collection of core skills and custom agents designed to assist AI coding agents with .NET and C# development. It offers a comprehensive set of plugins covering various aspects of the .NET ecosystem, from data access and diagnostics to AI integration and project upgrades. This resource empowers developers to enhance their AI-driven coding workflows with specialized .NET capabilities.
Radarr: Your Ultimate Movie Organizer for Usenet and Torrent Users
May 1, 2026
Radarr is a powerful movie collection manager designed for Usenet and BitTorrent users. It automates the process of monitoring, grabbing, sorting, and renaming movies, ensuring your library is always organized and up-to-date. With support for various download clients and media servers, Radarr streamlines your movie management workflow.

KurrentDB: An Event-Native Database for Modern Event-Driven Architectures
April 19, 2026
KurrentDB is an innovative database designed for modern software and event-driven architectures. Its event-native approach simplifies data modeling and ensures data integrity, while an integrated streaming engine addresses distributed messaging and data consistency challenges. This powerful platform, formerly known as EventStoreDB, provides a robust solution for complex data management.
Harden-Windows-Security: Enhance Your Windows System Security with Official Methods
December 2, 2025
The Harden-Windows-Security repository by HotCakeX provides robust tools and guides to secure Windows using official Microsoft methods. It offers two key applications, Harden System Security and AppControl Manager, available on the Microsoft Store, catering to personal, enterprise, and military security needs. The project emphasizes defense-in-depth and adheres to SLSA Level 3 compliance for secure development.
Source repository
Open the original repository on GitHub.
8 counted GitHub visits