Edit

Share via


.NET + AI ecosystem tools and SDKs

The .NET ecosystem provides many powerful tools, libraries, and services to develop AI applications. .NET supports both cloud and local AI model connections, many different SDKs for various AI and vector database services, and other tools to help you build intelligent apps of varying scope and complexity.

Important

Not all of the SDKs and services presented in this article are maintained by Microsoft. When considering an SDK, make sure to evaluate its quality, licensing, support, and compatibility to ensure they meet your requirements.

Microsoft.Extensions.AI libraries

Microsoft.Extensions.AI is a set of core .NET libraries that provide a unified layer of C# abstractions for interacting with AI services, such as small and large language models (SLMs and LLMs), embeddings, and middleware. These APIs were created in collaboration with developers across the .NET ecosystem, including Semantic Kernel. The low-level APIs, such as IChatClient and IEmbeddingGenerator<TInput,TEmbedding>, were extracted from Semantic Kernel and moved into the Microsoft.Extensions.AI namespace.

Microsoft.Extensions.AI provides abstractions that can be implemented by various services, all adhering to the same core concepts. This library is not intended to provide APIs tailored to any specific provider's services. The goal of Microsoft.Extensions.AI is to act as a unifying layer within the .NET ecosystem, enabling developers to choose their preferred frameworks and libraries while ensuring seamless integration and collaboration across the ecosystem.

Microsoft Agent Framework

If you want to use low-level services, such as IChatClient and IEmbeddingGenerator<TInput,TEmbedding>, you can reference the Microsoft.Extensions.AI.Abstractions package directly from your app. However, if you want to build agentic AI applications with higher-level orchestration capabilities, you should use Microsoft Agent Framework. Agent Framework builds on the Microsoft.Extensions.AI.Abstractions package and provides concrete implementations of IChatClient for different services, including OpenAI, Azure OpenAI, Azure AI Foundry, and more.

This framework is the recommended approach for .NET apps that need to build agentic AI systems with advanced orchestration, multi-agent collaboration, and enterprise-grade security and observability.

Agent Framework is a production-ready, open-source framework that brings together the best capabilities of Semantic Kernel and Microsoft Research's AutoGen. Agent Framework provides:

  • Multi-agent orchestration: Support for sequential, concurrent, group chat, handoff, and magentic (where a lead agent directs other agents) orchestration patterns.
  • Cloud and provider flexibility: Cloud-agnostic (containers, on-premises, or multi-cloud) and provider-agnostic (for example, OpenAI or Azure AI Foundry) using plugin and connector models.
  • Enterprise-grade features: Built-in observability (OpenTelemetry), Microsoft Entra security integration, and responsible AI features including prompt injection protection and task adherence monitoring.
  • Standards-based interoperability: Integration with open standards like Agent-to-Agent (A2A) protocol and Model Context Protocol (MCP) for agent discovery and tool interaction.

For more information, see the Microsoft Agent Framework documentation.

Semantic Kernel for .NET

Semantic Kernel is an open-source library that enables AI integration and orchestration capabilities in your .NET apps. Semantic Kernel has a dependency on the Microsoft.Extensions.AI.Abstractions package and provides connectors with concrete implementations of IChatClient and IEmbeddingGenerator<TInput,TEmbedding> for different services, including OpenAI, Amazon Bedrock, and Google Gemini.

However, for new applications that require agentic capabilities, multi-agent orchestration, or enterprise-grade observability and security, the recommended framework is Microsoft Agent Framework.

.NET SDKs for building AI apps

Many different SDKs are available to build .NET apps with AI capabilities depending on the target platform or AI model. OpenAI models offer powerful generative AI capabilities, while other Azure AI Services provide intelligent solutions for a variety of specific scenarios.

.NET SDKs for OpenAI models

NuGet package Supported models Maintainer or vendor Documentation
Microsoft.Agents.AI.OpenAI OpenAI models
Azure OpenAI supported models
Microsoft Agent Framework (Microsoft) Agent Framework documentation
Microsoft.SemanticKernel OpenAI models
Azure OpenAI supported models
Semantic Kernel (Microsoft) Semantic Kernel documentation
Azure OpenAI SDK Azure OpenAI supported models Azure SDK for .NET (Microsoft) Azure OpenAI services documentation
OpenAI SDK OpenAI supported models OpenAI SDK for .NET (OpenAI) OpenAI services documentation

.NET SDKs for Azure AI Services

Azure offers many other AI services to build specific application capabilities and workflows. Most of these services provide a .NET SDK to integrate their functionality into custom apps. Some of the most commonly used services are shown in the following table. For a complete list of available services and learning resources, see the Azure AI Services documentation.

Service Description
Azure AI Search Bring AI-powered cloud search to your mobile and web apps.
Azure AI Content Safety Detect unwanted or offensive content.
Azure AI Document Intelligence Turn documents into intelligent data-driven solutions.
Azure AI Language Build apps with industry-leading natural language understanding capabilities.
Azure AI Speech Speech to text, text to speech, translation, and speaker recognition.
Azure AI Translator AI-powered translation technology with support for more than 100 languages and dialects.
Azure AI Vision Analyze content in images and videos.

Develop with local AI models

.NET apps can also connect to local AI models for many different development scenarios. Microsoft Agent Framework is the recommended tool to connect to local models using .NET. This framework can connect to many different models hosted across a variety of platforms and abstracts away lower-level implementation details.

For example, you can use Ollama to connect to local AI models with .NET, including several small language models (SLMs) developed by Microsoft:

Model Description
phi3 models A family of powerful SLMs with groundbreaking performance at low cost and low latency.
orca models Research models in tasks such as reasoning over user-provided data, reading comprehension, math problem solving, and text summarization.

Note

The preceding SLMs can also be hosted on other services, such as Azure.

Connect to vector databases and services

AI applications often use data vector databases and services to improve relevancy and provide customized functionality. Many of these services provide a native SDK for .NET, while others offer a REST service you can connect to through custom code. Semantic Kernel provides an extensible component model that enables you to use different vector stores without needing to learn each SDK.

Semantic Kernel provides connectors for the following vector databases and services:

Vector service Semantic Kernel connector .NET SDK
Azure AI Search Microsoft.SemanticKernel.Connectors.AzureAISearch Azure.Search.Documents
Azure Cosmos DB for NoSQL Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL Microsoft.Azure.Cosmos
Azure Cosmos DB for MongoDB Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB MongoDb.Driver
Azure PostgreSQL Server Microsoft.SemanticKernel.Connectors.Postgres Npgsql
Azure SQL Database Microsoft.SemanticKernel.Connectors.SqlServer Microsoft.Data.SqlClient
Chroma Microsoft.SemanticKernel.Connectors.Chroma ChromaDB.Client
DuckDB Microsoft.SemanticKernel.Connectors.DuckDB DuckDB.NET.Data.Full
Milvus Microsoft.SemanticKernel.Connectors.Milvus Milvus.Client
MongoDB Atlas Vector Search Microsoft.SemanticKernel.Connectors.MongoDB MongoDb.Driver
Pinecone Microsoft.SemanticKernel.Connectors.Pinecone REST API
Postgres Microsoft.SemanticKernel.Connectors.Postgres Npgsql
Qdrant Microsoft.SemanticKernel.Connectors.Qdrant Qdrant.Client
Redis Microsoft.SemanticKernel.Connectors.Redis StackExchange.Redis
Weaviate Microsoft.SemanticKernel.Connectors.Weaviate REST API

To discover .NET SDK and API support, visit the documentation for each respective service.

Next steps