Dapr recently introduced Dapr Agents, a framework for building scalable, resilient AI agents using Large Language Models (LLMs). It enables structured workflows, multi-agent coordination, and event-driven execution, leveraging Dapr’s security, observability, and cloud-neutral architecture. Designed for enterprise use, it supports thousands of agents, integrates with databases, and ensures reliability through robust orchestration and messaging.
Based on Dapr, Dapr Agents provides a framework for developing AI agents that can reason, act, and collaborate using LLMs. It offers reliability, scalability, and observability, supporting thousands of agents on a single core and running natively on Kubernetes. The authors, Mark Fussel, Yaron Schneider and Roberto Rodriguez, describe how Dapr Agents is unique from other frameworks:
Dapr Agents is built on top of Dapr’s full-featured workflow engine. Many other agent and LLM frameworks use homegrown workflow systems that aren’t reliable for production use cases. Dapr Agents uses Dapr’s proven workflow system, which is designed to handle failures, retries, and scaling.
import logging
import asyncio
import requests
from dotenv import load_dotenv
from dapr_agents.llm.dapr import DaprChatClient
from dapr_agents import AssistantAgent, tool
# Load environment variables
load_dotenv()
logging.basicConfig(level=logging.INFO)
@tool
def get_pr_code(repository: str, pr: str) -> str:
"""Get the code for a given PR"""
response = requests.get(f"https://api.github.com/repos/{repository}/pulls/{pr}/files")
files = response.json()
code = {file["filename"]: requests.get(file["raw_url"]).text for file in files}
return code
@tool
def perform_review(code: str) -> str:
"""Review code"""
response = DaprChatClient().generate(f"Review the following code: {code}")
return response.get_content()
# Define Code Review Agent
code_review_agent = AssistantAgent(
name="CodeReviewAgent",
role="Review PRs",
instructions=["Review code in a pull request, then return comments and/or suggestions"],
tools=[get_pr_code, perform_review],
message_bus_name="messagepubsub",
state_store_name="workflowstatestore",
agents_registry_store_name="agentstatestore",
service_port=8001,
)
# Start Agent Workflow Service
await code_review_agent.start()
An example of building a Code Review Agent with Dapr Agent (Source)
Distributed Application Runtime (Dapr) is an open-source framework designed to simplify the development of cloud-native applications by providing building blocks for service invocation, state management, pub/sub messaging, and observability. It abstracts infrastructure complexities, allowing developers to focus on business logic while seamlessly integrating with Kubernetes and other environments.
Agentic AI refers to AI-driven systems that can autonomously process information, make decisions, and execute tasks. Various solutions exist in this space, including frameworks like LangChain, AutoGen, and CrewAI, which enable developers to build agent-based applications.
Dapr Agents use LLMs as their reasoning engine and integrate with external tools for enhanced functionality. Developers can create agents with predefined roles, goals, and instructions, equipping them with reasoning capabilities and tool-based actions. They can also define structured, deterministic workflows using functions that incorporate LLM reasoning. These workflows ensure the controlled execution of tasks in a predefined order while maintaining flexibility with tool integration.
An example Agent workflow (Source)
Dapr Agents supports multi-agent workflows, allowing agents to collaborate using Dapr’s pub/sub messaging. Coordination models include LLM-based decision-making, random selection, and round-robin task distribution, enabling adaptive, self-reasoning workflows. The authors elaborate on this matter:
Agents need to operate as autonomous entities that respond to events dynamically, enabling real-time interactions and collaboration coordinated with workflows. These event-driven agentic workflows take advantage of Dapr’s pub/sub messaging system. This allows agents to communicate, share tasks, and reason through events triggered by their environment.
Agents can communicate with other agents via a message broker (Source)
The design abstracts integrations with databases and message brokers, allowing developers to switch between infrastructure providers without significant code changes. It integrates seamlessly with monitoring tools like Prometheus and OpenTelemetry for observability. As a CNCF project, it avoids vendor lock-in while ensuring secure communication and fault tolerance.
Developers can explore Dapr Agents’ capabilities via the GitHub repository and join the Discord community for discussions and support.
InfoQ spoke with Yaron Schneider, CTO at Diagrid and Dapr Maintainer, about Dapr Agents, their implementation and future plans.
InfoQ: You mentioned that Dapr Agents is designed to run thousands of agents on a single core. What optimizations or architectural choices enable this efficiency level, and how should architects consider scaling in a Kubernetes environment?
Yaron Schneider: Dapr Agents represent agents and their subsequent tasks as actors – extremely lightweight, durable objects that can scale to the millions with very low latency. This enables Dapr Agents to run large amounts of agents using minimal CPU and memory requirements. As Dapr runs and integrates natively with Kubernetes, existing users of the platform should know that Dapr Agents is highly resilient to failures and takes into account the ephemeral nature of Kubernetes pods.
InfoQ: Debugging and observability become critical with distributed AI agents interacting asynchronously. What built-in capabilities do Dapr Agents provide for monitoring, logging, and troubleshooting agent behaviours?
Yaron Schneider: Dapr Agents, built on top of Dapr, emit metrics for its agentic workflows, including requests per second, error rates and latency. In addition, since Dapr Workflows supports distributed tracing, developers can visualize the agent call graph using their OTel-compliant tools. We will be investing more in agentic observability in the future.
InfoQ: What’s next for Dapr Agents? Are there any planned features or improvements, such as enhanced LLM integrations, new workflow primitives, or broader multi-cloud capabilities?
Yaron Schneider: Since data synthesis is becoming a crucial aspect of agentic workloads, we plan to integrate with Model Context Protocol (MCP) so developers can connect Dapr Agents to various data sources and Dapr’s native capabilities via the state store and bindings APIs. We also plan to add support to additional LLM providers through Dapr’s Conversation API. Most importantly, Dapr Agents is available today in Python, and we’re working on adding support for Dotnet and Java.