Microsoft Agent Framework

Microsoft's Agent Framework is an open-source toolkit for building intelligent agents. The framework offers components for creating agents that connect to services, execute tasks, and manage complex workflows. It supports multiple LLM providers including Azure OpenAI and OpenAI, with native OpenTelemetry integration for observability.

This guide covers routing telemetry from Microsoft Agent Framework applications to InteractiveAI for monitoring, debugging, and evaluating agent behavior.

Prerequisites

  • InteractiveAI account with API credentials

  • Azure OpenAI credentials or OpenAI API key


Installation

pip install agent-framework interactiveai

Configuration

Set your API credentials as environment variables:

import os

# InteractiveAI credentials
# Obtain keys from Settings > API Keys in the dashboard
os.environ["INTERACTIVEAI_PUBLIC_KEY"] = "pk-ia-..."
os.environ["INTERACTIVEAI_SECRET_KEY"] = "sk-ia-..."
os.environ["INTERACTIVEAI_HOST"] = "https://app.interactiveai.com"

# Azure OpenAI credentials
os.environ["AZURE_OPENAI_API_KEY"] = "your-azure-openai-key"
os.environ["AZURE_OPENAI_ENDPOINT"] = "https://your-resource.openai.azure.com/"
os.environ["AZURE_OPENAI_CHAT_DEPLOYMENT_NAME"] = "gpt-4o-mini"
os.environ["OPENAI_CHAT_MODEL_ID"] = "gpt-4o-mini"

Initialize the client and confirm connectivity:


Enabling Trace Capture

The Microsoft Agent Framework includes native OpenTelemetry support. Activate it by calling configure_otel_providers() to route traces to InteractiveAI:

Setting enable_sensitive_data=True captures complete request and response payloads including function arguments and return values.


Running an Agent with Azure OpenAI

Here's a working example with a tool-equipped agent using Azure OpenAI:


Running an Agent with OpenAI

The framework also supports direct OpenAI access. Use OpenAIResponsesClient instead of AzureOpenAIChatClient:


Enriching Traces with Context

Combine the framework's integration with the InteractiveAI SDK to attach identifiers and metadata:


Trace Visibility

The InteractiveAI dashboard displays:

  • Agent execution flow and task completion

  • LLM calls with prompts and completions

  • Tool invocations with arguments and results

  • Token consumption and latency metrics

  • Cost tracking per request

Last updated

Was this helpful?