You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
payload={"task": "Find weekend flights to Paris"},
417
+
)
418
+
print(result)
419
+
finally:
420
+
runner.shutdown()
421
+
travel_planner.stop()
422
+
423
+
asyncio.run(main())
383
424
```
384
425
The implementation follows Dapr's sidecar architecture model, where all infrastructure concerns are handled by the Dapr runtime:
385
426
-**Persistent Memory** - Agent state is stored in Dapr's state store, surviving process crashes
386
427
-**Workflow Orchestration** - All agent interactions managed through Dapr's workflow system
387
-
-**Service Exposure** - REST endpoints for workflow management come out of the box
388
-
-**Pub/Sub Input/Output** - Event-driven messaging through Dapr's pub/sub system for seamless integration
428
+
-**Service Exposure** - `AgentRunner.serve()` exposes REST endpoints (e.g., `POST /run`) that schedule the agent's `@workflow_entry`
429
+
-**Pub/Sub Input/Output** - `AgentRunner.subscribe()` scans the agent for `@message_router` methods and wires the configured topics with schema validation
430
+
431
+
The Durable Agent enables the concept of "headless agents" - autonomous systems that operate without direct user interaction. Depending on the scenario you can:
432
+
433
+
1.**Run** durable workflows programmatically (`runner.run` as shown above)
434
+
2.**Subscribe** the agent to topics so other services can trigger it via pub/sub (`runner.subscribe`)
435
+
3.**Serve** the agent behind a FastAPI app with built-in `/run` and status endpoints (`runner.serve`)
389
436
390
-
The Durable Agent enables the concept of "headless agents" - autonomous systems that operate without direct user interaction. Dapr's Durable Agent exposes both REST and Pub/Sub APIs, making it ideal for long-running operations that are triggered by other applications or external events. This allows agents to run in the background, processing requests asynchronously and integrating seamlessly into larger distributed systems.
437
+
These options make it easy to process requests asynchronously and integrate seamlessly into larger distributed systems.
391
438
392
439
393
440
## Choosing the Right Pattern
@@ -397,4 +444,4 @@ The journey from simple agentic workflows to fully autonomous agents represents
397
444
-**Start with simpler patterns** like Augmented LLM and Prompt Chaining for well-defined tasks where predictability is crucial
398
445
-**Progress to more dynamic patterns** like Parallelization and Orchestrator-Workers as your needs grow more complex
399
446
-**Consider fully autonomous agents** only for open-ended tasks where the benefits of flexibility outweigh the need for strict control
0 commit comments