Dapr

The Dapr Conversation building block routes model inference through a Dapr sidecar and exposes an IChatClient that can back an Agent Framework .NET agent. The model provider and credentials are configured in the Dapr Conversation component rather than directly in the agent process.

Warning

Treat model or embedding output, and model-generated tool calls when supported, as untrusted application input. Validate them before code performs side effects or renders content. If you configure a custom endpoint, verify that you trust its URL and operator.

Prerequisites

  • .NET 10 or later.
  • Docker and the Dapr CLI.
  • A configured Dapr Conversation component, such as an Ollama-backed component.

Install the packages

dotnet add package Dapr.AI.Microsoft.Extensions
dotnet add package Microsoft.Agents.AI --prerelease

Configuration

DAPR_GRPC_ENDPOINT="http://localhost:3501"

DAPR_GRPC_ENDPOINT is optional and defaults to http://localhost:3501. Set ConversationComponentName in application code to the name of the Dapr Conversation component, such as ollama.

Create a Dapr-backed agent

Configure the Dapr sidecar endpoint and Conversation component through dependency injection, resolve the IChatClient, and convert it to an agent.

Provider capabilities depend on the Dapr Conversation component and the model behind it.

Tools

Tool support is inherited from the configured Dapr Conversation component and model.

Tool Status Notes
Function Tools Varies Requires function-calling support from the configured component and model.
Tool Approval Varies Available when the model produces function-tool calls.
Provider-hosted tools ❌ Dapr doesn't add a separate Agent Framework hosted-tool surface.
Local MCP Tools ✅ Runs in the application process.

Next steps