Of course. Here is a tutorial based on the content of the file.
This tutorial will guide you through the tools available for evaluating, tracing, and debugging your agents within the Microsoft Agent Framework. A key part of developing robust AI agents is understanding their behavior, and these tools provide the necessary insights.
We will cover two main components:
- DevUI: A web-based user interface for real-time visualization and debugging of agent sessions.
- Observability: How to configure logging to trace the step-by-step execution of your agents.
The DevUI is a powerful web-based tool designed to give you a clear, real-time view into your agent's inner workings. It helps you visualize the entire interaction flow, from the initial prompt to the final response, including the agent's thought process and any tools it utilizes.
- Session Visualization: Track the conversation and agent activities as they happen.
- Debugging: Easily inspect the messages, tool calls, and LLM responses to understand why an agent is behaving in a certain way.
- Interactive Interface: A user-friendly view that is much easier to parse than raw console logs.
To use the DevUI, you typically run a command provided by the agent framework's command-line interface. This command starts a local web server, allowing you to connect and monitor your agent sessions through your browser.
Sample Code:
-
basic_agent_Workflow : basic_agent_workflow_devui
-
multi_workflow_ghmodel_devui : multi_workflow_ghmodel_devui
For more detailed information and setup instructions, please visit the official DevUI package page: https://github.com/microsoft/agent-framework/tree/main/python/packages/devui
While the DevUI is excellent for real-time visual debugging, observability through logging provides a persistent and detailed text-based record of an agent's execution. The framework is built to integrate with standard Python logging, making it easy to capture the data you need for analysis.
- User Requests: The initial input that starts the agent's task.
- Agent's "Thoughts": The internal reasoning steps the agent takes.
- Tool Invocations: Which tools the agent decides to use and with what parameters.
- Final Responses: The output generated by the agent.
The framework automatically emits events during an agent's run. By configuring a logger, you can direct these events to your console or a file. The provided samples demonstrate how to set up this logging to see a sequential trace of the agent's operations, giving you a complete picture for post-execution analysis and debugging.
To review the sample code and learn how to configure the logger, check out the observability example here: tracer_aspire