<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0">

<channel>
	<title>Jesse Liberty - Silverlight Geek</title>
	<atom:link href="https://jesseliberty.com/feed/" rel="self" type="application/rss+xml"/>
	<link>https://jesseliberty.com</link>
	<description>More Signal - Less Noise</description>
	<lastBuildDate>Tue, 11 Aug 2026 16:29:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.3</generator>

<image>
	<url>https://jesseliberty.com/wp-content/uploads/2026/07/cropped-Square-Headshot-32x32.jpg</url>
	<title>Jesse Liberty</title>
	<link>https://jesseliberty.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Configuration Management in Microsoft Agent Framework</title>
		<link>https://jesseliberty.com/2026/08/11/configuration-management-in-microsoft-agent-framework/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Tue, 11 Aug 2026 16:27:50 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13490</guid>

					<description><![CDATA[In the realm of software development, managing configuration values and sensitive information is a critical aspect that can significantly impact the security and functionality of applications. Developers often find themselves at a crossroads when deciding how to store configuration values, &#8230; <a href="https://jesseliberty.com/2026/08/11/configuration-management-in-microsoft-agent-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In the realm of software development, managing configuration values and sensitive information is a critical aspect that can significantly impact the security and functionality of applications. Developers often find themselves at a crossroads when deciding how to store configuration values, particularly when it comes to sensitive data such as API keys, passwords, and other credentials. Two common approaches are using a <code>config.json</code> file for configuration values and utilizing a secrets management system, such as that provided by the Microsoft Agent Framework. This post delves into the differences, trade-offs, and considerations for each approach, helping developers make informed decisions based on their specific needs.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph">Note: Microsoft strongly suggests using <em>secrets</em> and not putting these values in config.json</p>
</blockquote>



<figure class="wp-block-image size-full is-resized"><img fetchpriority="high" decoding="async" width="775" height="706" src="https://jesseliberty.com/wp-content/uploads/2026/08/shhh.jpg" alt="" class="wp-image-13491" style="aspect-ratio:1.0977445533908503;width:301px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/08/shhh.jpg 775w, https://jesseliberty.com/wp-content/uploads/2026/08/shhh-300x273.jpg 300w, https://jesseliberty.com/wp-content/uploads/2026/08/shhh-150x137.jpg 150w, https://jesseliberty.com/wp-content/uploads/2026/08/shhh-768x700.jpg 768w" sizes="(max-width: 775px) 100vw, 775px" /></figure>



<span id="more-13490"></span>



<h3 class="wp-block-heading">What is <code>config.json</code>?</h3>



<p class="wp-block-paragraph">The <code>config.json</code> file is a widely used configuration file format in many programming environments, particularly in JavaScript and .NET applications. It serves as a simple way to store application settings, such as API endpoints, feature flags, and other non-sensitive configurations. The structure of a <code>config.json</code> file is straightforward, making it easy for developers to read and modify.</p>



<h4 class="wp-block-heading">Example of <code>config.json</code></h4>



<pre class="wp-block-code"><code>{
  "ApiUrl": "https://api.example.com",
  "FeatureFlag": true
}</code></pre>



<h3 class="wp-block-heading">Advantages of Using <code>config.json</code></h3>



<ol class="wp-block-list">
<li><strong>Simplicity and Accessibility</strong>: One of the primary advantages of using <code>config.json</code> is its simplicity. Developers can easily read and modify the file, making it an excellent choice for local development and testing environments. This ease of access allows for rapid iteration and debugging.</li>



<li><strong>Version Control</strong>: Configuration files can be included in version control systems like Git. This feature is beneficial for tracking changes over time, allowing teams to collaborate effectively and maintain a history of configuration changes. <br /><br /><strong>Note</strong>, if you have secret values (such as keys) you do <em>not</em> want them in version control. One solution is to add them to your .gitignore file. A better solution is not to have them in config.json in the first place.<br /></li>



<li><strong>No Additional Setup Required</strong>: Unlike secrets management systems, which may require additional setup and configuration, using <code>config.json</code> typically involves minimal overhead. Developers can start using it right away without needing to integrate with external services.</li>
</ol>



<h3 class="wp-block-heading">Disadvantages of Using <code>config.json</code></h3>



<ol class="wp-block-list">
<li><strong>Security Risks</strong>: The most significant drawback of using <code>config.json</code> is its lack of security for sensitive data. If sensitive information, such as passwords or API keys, is stored in this file, it can be easily accessed by anyone with access to the codebase. This poses a substantial risk, especially in production environments.</li>



<li><strong>Accidental Exposure</strong>: Including <code>config.json</code> in version control can lead to accidental exposure of sensitive data. Developers must be diligent about ensuring that sensitive information is excluded from version control, which can be challenging.</li>



<li><strong>Limited to Non-Sensitive Data</strong>: While <code>config.json</code> is suitable for general configuration, it is not designed for managing sensitive information securely. Developers must find alternative methods for handling sensitive data, which can complicate the development process.</li>
</ol>



<h2 class="wp-block-heading">Secrets Management in Microsoft Agent Framework</h2>



<h3 class="wp-block-heading">What is Secrets Management?</h3>



<p class="wp-block-paragraph">The Microsoft Agent Framework provides a robust secrets management system designed to securely manage sensitive information such as credentials, API keys, and other secrets. This system is particularly useful for applications deployed in production environments where security is paramount.</p>



<h4 class="wp-block-heading">Example of Secrets Management</h4>



<p class="wp-block-paragraph">Using Azure Key Vault, developers can securely store and retrieve secrets. Here’s a simple example of how to access a secret using the Azure SDK:</p>



<pre class="wp-block-code"><code>var secretClient = new SecretClient(new Uri("https://&lt;your-key-vault-name&gt;.vault.azure.net/"), new DefaultAzureCredential());
KeyVaultSecret secret = await secretClient.GetSecretAsync("MySecret");
string secretValue = secret.Value;</code></pre>



<h3 class="wp-block-heading">Advantages of Using Secrets Management</h3>



<ol class="wp-block-list">
<li><strong>Enhanced Security</strong>: The primary advantage of using a secrets management system is its built-in security features. Secrets are encrypted and access-controlled, ensuring that sensitive data is not exposed in the codebase. This level of security is essential for protecting sensitive information in production environments.</li>



<li><strong>Centralized Management</strong>: Secrets management systems like Azure Key Vault allow for centralized management of secrets across multiple applications. This centralization simplifies the process of updating and rotating secrets, reducing the risk of outdated or compromised credentials.</li>



<li><strong>Integration with Azure Services</strong>: The Microsoft Agent Framework&#8217;s secrets management seamlessly integrates with other Azure services, providing a cohesive environment for managing application secrets. This integration enhances the overall security posture of applications deployed in the Azure ecosystem.</li>
</ol>



<h3 class="wp-block-heading">Disadvantages of Using Secrets Management</h3>



<ol class="wp-block-list">
<li><strong>Complexity</strong>: Implementing a secrets management system can introduce additional complexity in setup and management compared to using a simple configuration file. Developers must familiarize themselves with the secrets management system and its APIs, which may require additional time and resources.</li>



<li><strong>Cost</strong>: Depending on the chosen secrets management solution, there may be associated costs. For example, using Azure Key Vault incurs charges based on the number of operations performed and the amount of data stored. Organizations must weigh these costs against the benefits of enhanced security.</li>



<li><strong>Learning Curve</strong>: For teams unfamiliar with secrets management practices, there may be a learning curve involved in adopting a new system. Training and documentation may be necessary to ensure that all team members understand how to use the system effectively.</li>
</ol>



<h2 class="wp-block-heading">Key Trade-offs</h2>



<p class="wp-block-paragraph">When deciding between <code>config.json</code> and secrets management in the Microsoft Agent Framework, developers must consider several key trade-offs:</p>



<ol class="wp-block-list">
<li><strong>Security vs. Convenience</strong>: Using <code>config.json</code> is convenient for non-sensitive configurations but poses security risks for sensitive data. In contrast, the Microsoft Agent Framework&#8217;s secrets management is secure but may require more setup and management effort.</li>



<li><strong>Development vs. Production</strong>: <code>config.json</code> is often more suitable for development environments, where rapid iteration is essential. However, for production environments, where security is a priority, leveraging secrets management is advisable.</li>



<li><strong>Version Control</strong>: Configuration files can be versioned easily, allowing for tracking changes over time. However, secrets should never be included in version control to prevent accidental exposure, necessitating a different approach for managing sensitive data.</li>
</ol>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Choosing between <code>config.json</code> and secrets management in the Microsoft Agent Framework ultimately depends on the specific needs of your application. For general configuration values that do not involve sensitive information, <code>config.json</code> remains a practical choice, provided that developers are diligent about handling sensitive data appropriately. However, for applications that require the management of sensitive information, leveraging the secrets management capabilities of the Microsoft Agent Framework is advisable to ensure security and compliance.</p>



<p class="wp-block-paragraph">In summary, understanding the differences and trade-offs between these two approaches is crucial for developers aiming to build secure and efficient applications. By carefully considering the specific requirements of your project, you can make an informed decision that balances convenience, security, and maintainability.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Detecting AI</title>
		<link>https://jesseliberty.com/2026/08/08/detecting-ai/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Sat, 08 Aug 2026 18:25:51 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13487</guid>

					<description><![CDATA[I fed the first half of one of the blog posts generated by my demonstration program to Pangram. Here are the results: Bzzzz Still your turn.]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">I fed the first half of one of the blog posts generated by my demonstration program to Pangram. Here are the results:</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="629" height="540" src="https://jesseliberty.com/wp-content/uploads/2026/08/image.png" alt="" class="wp-image-13488" style="aspect-ratio:1.164819583899997;width:316px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/08/image.png 629w, https://jesseliberty.com/wp-content/uploads/2026/08/image-300x258.png 300w, https://jesseliberty.com/wp-content/uploads/2026/08/image-150x129.png 150w" sizes="(max-width: 629px) 100vw, 629px" /></figure>



<p class="wp-block-paragraph">Bzzzz Still your turn.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ChatClient Middleware vs. Agent Middleware</title>
		<link>https://jesseliberty.com/2026/08/08/chatclient-middleware-vs-agent-middleware/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Sat, 08 Aug 2026 17:55:28 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Essentials]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13481</guid>

					<description><![CDATA[As noted in a previous post, middleware plays a pivotal role in enhancing the functionality and observability of agents. The Microsoft Agent Framework utilizes two primary types of middleware: ChatClient Middleware and Agent Middleware. Understanding the distinctions between these two &#8230; <a href="https://jesseliberty.com/2026/08/08/chatclient-middleware-vs-agent-middleware/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">As noted in a<a href="https://jesseliberty.com/2026/07/23/middleware-in-microsoft-agent-framework/"> previous post</a>, middleware plays a pivotal role in enhancing the functionality and observability of agents. The Microsoft Agent Framework utilizes two primary types of middleware: <strong>ChatClient Middleware</strong> and <strong>Agent Middleware</strong>. Understanding the distinctions between these two middleware types is essential for developers looking to optimize their agents&#8217; performance and capabilities. This post will delve into the differences between ChatClient Middleware and Agent Middleware, illustrating their functionalities with examples, including a demonstration of function-invocation middleware for a single agent.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="765" height="457" src="https://jesseliberty.com/wp-content/uploads/2026/08/middleware-with-search.jpg" alt="" class="wp-image-13483" style="aspect-ratio:1.673980089791138;width:398px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/08/middleware-with-search.jpg 765w, https://jesseliberty.com/wp-content/uploads/2026/08/middleware-with-search-300x179.jpg 300w, https://jesseliberty.com/wp-content/uploads/2026/08/middleware-with-search-150x90.jpg 150w" sizes="(max-width: 765px) 100vw, 765px" /></figure>



<p class="wp-block-paragraph">This is the approach I use in the<a href="https://github.com/JesseLiberty/blogMigration---public"> demonstration program</a> to log the invocation of the Tavily search tool.</p>



<span id="more-13481"></span>



<h2 class="wp-block-heading">What is Middleware?</h2>



<p class="wp-block-paragraph">To review, middleware is a software layer that acts as an intermediary between different software applications or components. In the context of the Microsoft Agent Framework, middleware enhances the interaction between agents and their underlying systems, allowing developers to intercept, modify, and log messages and operations. This capability is crucial for debugging, monitoring, and extending the functionality of agents.</p>



<h2 class="wp-block-heading">ChatClient Middleware</h2>



<h3 class="wp-block-heading">Purpose</h3>



<p class="wp-block-paragraph">ChatClient Middleware is specifically designed to intercept calls made to an <code>IChatClient</code> implementation. This middleware is particularly useful for logging, modifying, or inspecting the raw messages exchanged between the agent and the underlying language model (LLM). By utilizing ChatClient Middleware, developers can gain insights into the communication flow, which is essential for debugging and improving the agent&#8217;s performance.</p>



<h3 class="wp-block-heading">Use Case</h3>



<p class="wp-block-paragraph">A common use case for ChatClient Middleware is logging all messages sent and received by the agent. This can help developers understand how the agent interacts with users and the LLM, allowing for better optimization of responses and overall user experience.</p>



<h3 class="wp-block-heading">Example</h3>



<p class="wp-block-paragraph">Here’s a simple example of how to implement ChatClient Middleware in C#:</p>



<pre class="wp-block-code"><code>var chatClient = new AIProjectClient(new Uri("your-uri"), new DefaultAzureCredential())
    .GetProjectOpenAIClient()
    .GetProjectResponsesClient()
    .AsIChatClient(deploymentName);

var middlewareEnabledChatClient = chatClient
    .AsBuilder()
    .Use(getResponseFunc: CustomChatClientMiddleware, getStreamingResponseFunc: null)
    .Build();</code></pre>



<p class="wp-block-paragraph">In this example, <code>CustomChatClientMiddleware</code> would be a function that processes the messages before they are sent to or after they are received from the LLM. This middleware can log the messages, modify them, or even implement additional logic based on the content of the messages.</p>



<h2 class="wp-block-heading">Agent Middleware</h2>



<h3 class="wp-block-heading">Purpose</h3>



<p class="wp-block-paragraph">Agent Middleware operates at a higher level than ChatClient Middleware. It allows for the interception of all agent runs, enabling developers to inspect and modify the input and output of the agent&#8217;s operations. This middleware is essential for managing the overall behavior of the agent, including session management, identity tracking, and token budget management.</p>



<h3 class="wp-block-heading">Use Case</h3>



<p class="wp-block-paragraph">A typical use case for Agent Middleware is collecting information about the agent&#8217;s session or identity. For instance, if an agent needs to maintain context across multiple interactions or manage its resource usage effectively, Agent Middleware would be the appropriate choice.</p>



<h3 class="wp-block-heading">Example</h3>



<p class="wp-block-paragraph">Here’s how you might implement Agent Middleware in C#:</p>



<pre class="wp-block-code"><code>var agent = new ChatClientAgent(middlewareEnabledChatClient, instructions: "You are a helpful assistant.");</code></pre>



<p class="wp-block-paragraph">In this example, the <code>ChatClientAgent</code> is initialized with the middleware-enabled chat client. The agent can now leverage the capabilities of both ChatClient and Agent Middleware to enhance its functionality.</p>



<h2 class="wp-block-heading">Function-Invocation Middleware for a Single Agent</h2>



<p class="wp-block-paragraph">Function-invocation middleware can be applied to both ChatClient and Agent Middleware. This type of middleware allows for the interception of function calls executed by the agent, enabling developers to inspect and modify inputs and outputs. This capability is particularly useful for logging, debugging, and implementing additional logic based on the agent&#8217;s operations.</p>



<h3 class="wp-block-heading">Example of Function-Invocation Middleware in C</h3>



<p class="wp-block-paragraph">Here’s a simple example of how to implement function-invocation middleware for a single agent:</p>



<pre class="wp-block-code"><code>public class FunctionInvocationMiddleware
{
    public async Task InvokeAsync(AgentRunContext context, Func&lt;AgentRunContext, Task&gt; next)
    {
        // Before the function call
        Console.WriteLine($"Before function call: {context.FunctionName}");

        // Call the next middleware in the pipeline
        await next(context);

        // After the function call
        Console.WriteLine($"After function call: {context.Result}");
    }
}

// Usage
var agent = new ChatClientAgent(middlewareEnabledChatClient, instructions: "You are a helpful assistant.")
    .AsBuilder()
    .Use(FunctionInvocationMiddleware.InvokeAsync)
    .Build();</code></pre>



<p class="wp-block-paragraph">In this example, the <code>FunctionInvocationMiddleware</code> class defines an <code>InvokeAsync</code> method that logs the function name before and after the function call. This middleware can be used to track the execution flow of the agent&#8217;s operations, providing valuable insights into its behavior.</p>



<p class="wp-block-paragraph">In the demonstration program we modify the creation of the ResearcherAgent to ad this bit of code:</p>



<pre class="wp-block-code"><code>.Use(async (agent, context, next, cancellationToken) =>
        {
            if (context.Function.Name == tavilyTool.Name)
            {
                _logger.LogInformation(
                    "Researcher invoking Tavily tool '{Tool}' with arguments {Arguments}",
                    context.Function.Name,
                    context.Arguments);
            }

            return await next(context, cancellationToken);
        })</code></pre>



<p class="wp-block-paragraph">That&#8217;s the only change necessary to have the middleware capture the calls to Tavily tool by the Researcher agent.  None of the other agents change.<br /><br />The trace from this change looks like this:</p>



<pre class="wp-block-code"><code>&#91;trace] → execute_tool tavily_search
info: BlogWriter.ResearcherAgent&#91;0]
      Researcher invoking Tavily tool 'tavily_search' with arguments &#91;query, ChatClient middleware vs Agent middleware Microsoft Agent Framework]
&#91;trace] ← execute_tool tavily_search (1796 ms)</code></pre>



<h2 class="wp-block-heading">Summary</h2>



<p class="wp-block-paragraph">In summary, the Microsoft Agent Framework offers two distinct types of middleware: <strong>ChatClient Middleware</strong> and <strong>Agent Middleware</strong>.</p>



<ul class="wp-block-list">
<li><strong>ChatClient Middleware</strong> focuses on the interaction with the chat client, allowing for the logging and modification of messages exchanged with the LLM.</li>



<li><strong>Agent Middleware</strong> deals with the overall operations of the agent, enabling developers to manage session information, identity, and resource usage.</li>
</ul>



<p class="wp-block-paragraph">Additionally, function-invocation middleware can be implemented to intercept function calls, allowing for detailed control over the agent&#8217;s behavior.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Long-term memory in Microsoft Agent Framework</title>
		<link>https://jesseliberty.com/2026/08/05/long-term-memory-in-microsoft-agent-framework/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Wed, 05 Aug 2026 19:05:59 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13474</guid>

					<description><![CDATA[Long-term memory in AI agents refers to the ability to retain information across multiple interactions and sessions. This is essential for creating a more personalized user experience, as it allows agents to recall user preferences, past conversations, and contextual information. &#8230; <a href="https://jesseliberty.com/2026/08/05/long-term-memory-in-microsoft-agent-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Long-term memory in AI agents refers to the ability to retain information across multiple interactions and sessions. This is essential for creating a more personalized user experience, as it allows agents to recall user preferences, past conversations, and contextual information. The Microsoft Agent Framework employs a dual memory architecture that includes both short-term and long-term memory.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="761" height="674" src="https://jesseliberty.com/wp-content/uploads/2026/08/memory-brain.jpg" alt="" class="wp-image-13475" style="aspect-ratio:1.1290781262342997;width:341px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/08/memory-brain.jpg 761w, https://jesseliberty.com/wp-content/uploads/2026/08/memory-brain-300x266.jpg 300w, https://jesseliberty.com/wp-content/uploads/2026/08/memory-brain-150x133.jpg 150w" sizes="auto, (max-width: 761px) 100vw, 761px" /></figure>



<span id="more-13474"></span>



<h3 class="wp-block-heading">Memory Architecture</h3>



<ol class="wp-block-list">
<li><strong>Short-Term Memory</strong>: This component tracks ongoing interactions and is typically volatile, meaning it is cleared after the session ends. It allows the agent to respond to immediate queries and maintain a fluid conversation.</li>



<li><strong>Long-Term Memory</strong>: In contrast, long-term memory retains information across sessions, enabling the agent to remember details that can enhance future interactions. This memory is crucial for building a relationship with users, as it allows the agent to provide continuity and context in conversations.</li>
</ol>



<h3 class="wp-block-heading">Context Providers</h3>



<p class="wp-block-paragraph">In MAF, long-term memory is managed through ContextProviders. These components allow agents to access relevant past interactions, user preferences, and other contextual information. By leveraging ContextProviders, agents can provide more relevant responses based on historical data, making interactions feel more natural and engaging.</p>



<h3 class="wp-block-heading">Integration with Databases</h3>



<p class="wp-block-paragraph">To effectively manage long-term memory, AI agents require a reliable storage solution. Databases play a critical role in this process. Popular databases such as Neo4j and Azure Cosmos DB are commonly used to store long-term memory.</p>



<ul class="wp-block-list">
<li><strong>Neo4j</strong>: This graph database allows for the storage of entities extracted from conversations. It enables the classification and linking of these entities back to the original messages, facilitating complex queries and relationships.</li>



<li><strong>Azure Cosmos DB</strong>: This database offers a unified solution for memory systems, providing speed and scalability essential for AI agents. Its multi-model capabilities allow for the storage of various data types, making it a versatile choice for long-term memory management.</li>
</ul>



<h2 class="wp-block-heading">Real-World Use Cases</h2>



<p class="wp-block-paragraph">The integration of databases into the Microsoft Agent Framework opens up a plethora of possibilities for AI agents. Here are some real-world use cases that illustrate the benefits of long-term memory:</p>



<h3 class="wp-block-heading">Personalized Recommendations</h3>



<p class="wp-block-paragraph">With long-term memory an AI agent can remember user preferences and past interactions to suggest tailored options. If a user frequently inquires about travel destinations, the agent can store this information and offer relevant suggestions in future conversations. This not only enhances user satisfaction but also fosters a sense of connection between the user and the agent.</p>



<h3 class="wp-block-heading">Contextual Awareness</h3>



<p class="wp-block-paragraph">Long-term memory enables agents to maintain context over multiple sessions. For example, if a user mentions a specific project during one interaction, the agent can recall details about that project in subsequent conversations. This continuity enhances the overall user experience, as it allows for more meaningful and relevant interactions. Users are more likely to engage with an agent that remembers their interests and past discussions.</p>



<h2 class="wp-block-heading">Supporting Data and Quotes</h2>



<p class="wp-block-paragraph">. According to a blog post on Neo4j, &#8220;Long-term memory consists of entities which can be automatically extracted from conversations using the LLM and classified with the POLE+O schema.&#8221; This highlights the need for a systematic approach to data storage that allows for easy retrieval and classification.</p>



<p class="wp-block-paragraph">POLE+P schema is a framework used to analyze systems by breaking them into five interacting dimensions:</p>



<ul class="wp-block-list">
<li>P)eople &#8211; Human actors</li>



<li>O)bjects &#8211; tangible or digital artifacts</li>



<li>L)ocation &#8211; spatial or contextual setting</li>



<li>E)vents &#8211; actions that trigger change</li>



<li>O)rganization &#8211; the structure or procedural layer that connects everything</li>
</ul>



<p class="wp-block-paragraph">In essence, this is the <em>Who, What, Where, When </em>and <em>How</em>.</p>



<p class="wp-block-paragraph">A Microsoft Community Hub article states, &#8220;Long-term memory is typically shared across sessions,&#8221; emphasizing the necessity of a database that can persist data beyond individual interactions. This persistence is crucial for building a comprehensive understanding of user preferences and behaviors.</p>



<p class="wp-block-paragraph">When an agent interacts with a user, it can save important information (like preferences or past conversations) in a database. The next time the user interacts with the agent, it can retrieve this information to provide a more personalized experience. This process is fundamental to creating a seamless and engaging interaction between users and AI agents.</p>



<h2 class="wp-block-heading">Code Example</h2>



<p class="wp-block-paragraph">To illustrate how an AI agent might store and retrieve user preferences using a database, here’s a simple example in C#:</p>



<pre class="wp-block-code"><code>public class UserPreferences
{
    public string UserId { get; set; }
    public string Preference { get; set; }
}

public class MemoryDatabase
{
    private List&lt;UserPreferences&gt; preferencesStore = new List&lt;UserPreferences&gt;();

    public void SavePreference(string userId, string preference)
    {
        preferencesStore.Add(new UserPreferences { UserId = userId, Preference = preference });
    }

    public List&lt;string&gt; GetPreferences(string userId)
    {
        return preferencesStore.Where(p =&gt; p.UserId == userId).Select(p =&gt; p.Preference).ToList();
    }
}

// Usage
var memoryDb = new MemoryDatabase();
memoryDb.SavePreference("user123", "likes travel");
var userPreferences = memoryDb.GetPreferences("user123");</code></pre>



<p class="wp-block-paragraph">In this code snippet, we define a <code>UserPreferences</code> class to represent user preferences and a <code>MemoryDatabase</code> class to manage the storage and retrieval of these preferences. The <code>SavePreference</code> method allows the agent to store user preferences, while the <code>GetPreferences</code> method retrieves them for future interactions. </p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">The integration of databases into the Microsoft Agent Framework is crucial for enabling long-term memory in AI agents. By leveraging structured data storage, agents can provide personalized and contextually aware interactions, significantly enhancing user experience. As AI technology continues to advance, the ability to remember and learn from past interactions will become increasingly important, making the role of databases in AI development more critical than ever. By understanding and implementing these concepts, developers can create more intelligent and responsive AI agents that truly understand and cater to user needs.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>LangChain vs Microsoft Agent Framework</title>
		<link>https://jesseliberty.com/2026/08/01/langchain-vs-microsoft-agent-framework/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Sat, 01 Aug 2026 18:44:39 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13466</guid>

					<description><![CDATA[In the rapidly evolving landscape of artificial intelligence, developers are presented with a myriad of frameworks to build applications that leverage the power of large language models (LLMs) and multi-agent systems. Among these, LangChain, LangGraph, and the Microsoft Agent Framework &#8230; <a href="https://jesseliberty.com/2026/08/01/langchain-vs-microsoft-agent-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In the rapidly evolving landscape of artificial intelligence, developers are presented with a myriad of frameworks to build applications that leverage the power of large language models (LLMs) and multi-agent systems. Among these, LangChain, LangGraph, and the Microsoft Agent Framework stand out for their unique capabilities and target use cases. This post aims to examine the differences between these frameworks, helping developers make informed decisions based on their specific needs and environments.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="575" height="419" src="https://jesseliberty.com/wp-content/uploads/2026/08/chained-computer.jpg" alt="" class="wp-image-13467" style="aspect-ratio:1.3723662129405183;width:303px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/08/chained-computer.jpg 575w, https://jesseliberty.com/wp-content/uploads/2026/08/chained-computer-300x219.jpg 300w, https://jesseliberty.com/wp-content/uploads/2026/08/chained-computer-150x109.jpg 150w" sizes="auto, (max-width: 575px) 100vw, 575px" /></figure>



<span id="more-13466"></span>



<h2 class="wp-block-heading">Overview of the Frameworks</h2>



<h3 class="wp-block-heading">LangChain</h3>



<p class="wp-block-paragraph">LangChain is a comprehensive framework designed for building applications that utilize large language models. It provides a rich set of tools for creating chains, retrievers, and tool-calling agents, making it particularly suitable for rapid prototyping and a wide array of use cases. The framework is primarily Python-based, which aligns well with the preferences of many data scientists and AI developers.</p>



<h3 class="wp-block-heading">LangGraph</h3>



<p class="wp-block-paragraph">LangGraph, on the other hand, is a lower-level orchestration framework that focuses on building stateful multi-agent systems. It is tailored for workflows that require loops, persistence, and cyclic reasoning, making it ideal for complex agent architectures. LangGraph is particularly useful in scenarios where explicit state management is crucial, allowing developers to create intricate workflows that can adapt and respond to changing conditions.</p>



<p class="wp-block-paragraph">These are not incompatible and many (most?) AI applications using one will use the other as well. I started my demonstration program starting <a href="https://jesseliberty.com/2026/06/11/creating-a-multi-agent-application/">here</a> using LangChain and LangGraph and then translated it to C# starting <a href="https://jesseliberty.com/2026/06/19/migrating-agentic-code-python-c-part-1/">here</a>, and finally migrated it to Microsoft Agent Framework starting <a href="https://jesseliberty.com/2026/06/22/migrating-agentic-code-python-c-part-6-final/">here</a>.</p>



<h3 class="wp-block-heading">Microsoft Agent Framework</h3>



<p class="wp-block-paragraph">The Microsoft Agent Framework is a robust solution designed specifically for .NET environments and Azure integration. It supports multi-agent orchestration and is built for enterprise-grade applications, providing first-class support for C# and Python. This framework is particularly advantageous for organizations that are heavily invested in the Microsoft ecosystem, as it offers seamless integration with Azure services and tools.</p>



<h2 class="wp-block-heading">Key Differences</h2>



<h3 class="wp-block-heading">1. Ecosystem Fit</h3>



<ul class="wp-block-list">
<li><strong>LangChain</strong>: This framework is favored by teams that require flexibility and rapid iteration, especially in Python environments. Its extensive library of integrations (over 1,000) allows developers to quickly adapt and extend their applications.</li>



<li><strong>LangGraph</strong>: LangGraph is the choice for applications that necessitate explicit state management and complex workflows. It excels in scenarios where persistent memory and human-in-the-loop control are essential.</li>



<li><strong>Microsoft Agent Framework</strong>: This framework is ideal for .NET developers and organizations that rely on Azure services.</li>
</ul>



<h3 class="wp-block-heading">2. Architecture</h3>



<ul class="wp-block-list">
<li><strong>LangChain</strong>: The architecture of LangChain emphasizes building agent capabilities, focusing on the skills layer. It is designed for rapid development, allowing developers to create and iterate on applications quickly.</li>



<li><strong>LangGraph</strong>: In contrast, LangGraph serves as the control layer, defining how agents think and manage workflows. It employs structured logic, such as state machines and loops, to facilitate complex decision-making processes.</li>



<li><strong>Microsoft Agent Framework</strong>: This framework orchestrates multiple agents into a cohesive system, making it particularly suitable for enterprise applications that require coordination among various agents.</li>
</ul>



<h3 class="wp-block-heading">3. Integration and Support</h3>



<ul class="wp-block-list">
<li><strong>LangChain</strong>: With its vast ecosystem of integrations, LangChain is versatile and can be applied to a wide range of applications, from simple chatbots to complex data processing pipelines.</li>



<li><strong>LangGraph</strong>: Designed for complex, cloud-agnostic workflows, LangGraph excels in scenarios that require checkpointing and debugging, making it a powerful tool for developers working on intricate systems.</li>



<li><strong>Microsoft Agent Framework</strong>: The deep integration with Azure services and the focus on enterprise-level orchestration make the Microsoft Agent Framework a strong choice for organizations looking to leverage cloud capabilities in their applications.</li>
</ul>



<h2 class="wp-block-heading">Use Cases</h2>



<h3 class="wp-block-heading">LangChain</h3>



<p class="wp-block-paragraph">LangChain is particularly well-suited for projects that require quick iterations and flexibility. Some common use cases include:</p>



<ul class="wp-block-list">
<li><strong>Retrieval-Augmented Generation (RAG) Pipelines</strong>: These pipelines combine retrieval mechanisms with generative models to produce contextually relevant responses.</li>



<li><strong>Multi-Step Workflows</strong>: LangChain can efficiently manage workflows that involve multiple steps, allowing for seamless transitions between tasks.</li>
</ul>



<h3 class="wp-block-heading">LangGraph</h3>



<p class="wp-block-paragraph">LangGraph shines in applications that require persistent memory and complex task automation. Typical use cases include:</p>



<ul class="wp-block-list">
<li><strong>Human-in-the-Loop Control</strong>: Scenarios where human oversight is necessary, such as in decision-making processes that require validation or input from users.</li>



<li><strong>Complex Task Automation</strong>: Applications that involve intricate workflows, such as automated customer support systems or multi-agent negotiation platforms.</li>
</ul>



<h3 class="wp-block-heading">Microsoft Agent Framework</h3>



<p class="wp-block-paragraph">The Microsoft Agent Framework is ideal for enterprise applications, particularly in sectors that demand robust orchestration and compliance. Use cases include:</p>



<ul class="wp-block-list">
<li><strong>Healthcare Applications</strong>: Systems that require secure and compliant handling of sensitive patient data, where multiple agents must work together to provide accurate and timely information.</li>



<li><strong>Financial Services</strong>: Applications that need to adhere to strict regulatory requirements while managing complex workflows involving multiple agents.</li>
</ul>



<h2 class="wp-block-heading">Example Code Snippets</h2>



<p class="wp-block-paragraph">To illustrate the capabilities of each framework, here are simple code snippets demonstrating their usage.</p>



<h3 class="wp-block-heading">LangChain (Python)</h3>



<pre class="wp-block-code"><code>from langchain import LLMChain, OpenAI

# Create a simple LLM chain
llm = OpenAI(model="text-davinci-003")
chain = LLMChain(llm=llm, prompt="What is the capital of France?")
response = chain.run()
print(response)  # Output: Paris</code></pre>



<h3 class="wp-block-heading">LangGraph (Python)</h3>



<pre class="wp-block-code"><code>from langgraph import StateMachine

# Define a simple state machine
sm = StateMachine()
sm.add_state("start", on_enter=lambda: print("Starting..."))
sm.add_state("end", on_enter=lambda: print("Ending..."))
sm.add_transition("start", "end")
sm.run("start")  # Output: Starting...</code></pre>



<h3 class="wp-block-heading">Microsoft Agent Framework (C#)</h3>



<pre class="wp-block-code"><code>using Microsoft.AgentFramework;

// Create a simple agent
var agent = new Agent("MyAgent");
agent.OnMessageReceived += (sender, message) =&gt; {
    Console.WriteLine($"Received: {message.Content}");
};
agent.Start();</code></pre>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Choosing between LangChain, LangGraph, and the Microsoft Agent Framework ultimately depends on your specific needs, including the programming environment, the complexity of the agent workflows, and the level of integration required with cloud services. Each framework has its strengths, making them suitable for different types of AI applications. </p>



<ul class="wp-block-list">
<li><strong>LangChain</strong> is ideal for rapid development and flexibility in Python environments.</li>



<li><strong>LangGraph</strong> excels in scenarios requiring complex workflows and state management.</li>



<li><strong>Microsoft Agent Framework</strong> is the best choice for enterprise applications, particularly for organizations leveraging the Microsoft ecosystem.</li>
</ul>



<p class="wp-block-paragraph">That said, I suspect that the driving factor will be which environment the developer (team?) is comfortable with. .NET developers will be driven to Microsoft Agent Framework and most others will use LangChain/LangGraph or another Python framework.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OpenTelemetry in Microsoft Agent Framework Apps</title>
		<link>https://jesseliberty.com/2026/07/31/opentelemetry-in-microsoft-agent-framework-apps/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Fri, 31 Jul 2026 15:28:11 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13462</guid>

					<description><![CDATA[Observability has become a critical component for ensuring the performance and reliability of applications. OpenTelemetry, an open-source observability framework, provides developers with the tools necessary to collect and export telemetry data from their applications. When integrated with the Microsoft Agent &#8230; <a href="https://jesseliberty.com/2026/07/31/opentelemetry-in-microsoft-agent-framework-apps/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Observability has become a critical component for ensuring the performance and reliability of applications. OpenTelemetry, an open-source observability framework, provides developers with the tools necessary to collect and export telemetry data from their applications. When integrated with the Microsoft Agent Framework (MAF), OpenTelemetry offers profound insights into the performance and behavior of AI agents. This post will explore how to effectively use OpenTelemetry in a Microsoft Agent Framework application, highlighting key trends, real-world use cases, challenges, and providing practical code examples.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="559" height="535" src="https://jesseliberty.com/wp-content/uploads/2026/07/OpenTelemetry.jpg" alt="" class="wp-image-13463" style="aspect-ratio:1.0448611232804697;width:308px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/07/OpenTelemetry.jpg 559w, https://jesseliberty.com/wp-content/uploads/2026/07/OpenTelemetry-300x287.jpg 300w, https://jesseliberty.com/wp-content/uploads/2026/07/OpenTelemetry-150x144.jpg 150w" sizes="auto, (max-width: 559px) 100vw, 559px" /></figure>



<span id="more-13462"></span>



<h3 class="wp-block-heading">What is OpenTelemetry?</h3>



<p class="wp-block-paragraph">OpenTelemetry is a set of APIs, libraries, agents, and instrumentation that enables developers to collect telemetry data from their applications. This data can include traces, metrics, and logs, which are essential for monitoring application performance and diagnosing issues. OpenTelemetry is designed to be vendor-agnostic, allowing developers to send their telemetry data to various backends for analysis.</p>



<h2 class="wp-block-heading">Key Trends and Innovations in OpenTelemetry and MAF</h2>



<h3 class="wp-block-heading">1. Built-in Support for OpenTelemetry</h3>



<p class="wp-block-paragraph">One of the most significant advancements in the Microsoft Agent Framework is its built-in support for OpenTelemetry. This integration allows developers to automatically emit spans and metrics without the need for manual wrapping of every agent call. This feature simplifies the process of adding observability to applications, enabling developers to focus on building functionality rather than instrumentation.</p>



<h3 class="wp-block-heading">2. Semantic Conventions</h3>



<p class="wp-block-paragraph">OpenTelemetry employs semantic conventions that help structure telemetry data in a meaningful way. In the context of AI agents, the OpenTelemetry GenAI semantic conventions ensure that the telemetry data collected is relevant and useful for analysis. This structured approach aids developers in understanding the performance and behavior of their agents more effectively.</p>



<h3 class="wp-block-heading">3. Support for Multi-Agent Systems</h3>



<p class="wp-block-paragraph">The Microsoft Agent Framework is designed to support multi-agent architectures, allowing for complex interactions and behaviors to be monitored effectively. This capability is particularly beneficial in scenarios where multiple agents work together to complete tasks, as it provides a comprehensive view of the system&#8217;s performance.</p>



<p class="wp-block-paragraph">By integrating OpenTelemetry, developers can monitor agent performance and interactions, gaining insights into usage patterns, error rates, and overall system efficiency. This data can be invaluable for optimizing the application and enhancing user experience.</p>



<h2 class="wp-block-heading">Challenges in Integration</h2>



<p class="wp-block-paragraph">While the integration of OpenTelemetry with the Microsoft Agent Framework offers numerous benefits, there are challenges that developers may encounter. One notable issue is the missing Activity Events. Reports indicate that while spans and metrics are emitted correctly, some expected Activity Events, such as <code>gen_ai.client.inference.operation.details</code>, are not being generated. This limitation can restrict the granularity of observability, making it difficult to gain a complete understanding of agent interactions and performance.</p>



<h2 class="wp-block-heading">Code Example: Setting Up OpenTelemetry in a Microsoft Agent Framework Application</h2>



<p class="wp-block-paragraph">To illustrate how to set up OpenTelemetry in a Microsoft Agent Framework application, consider the following code example:</p>



<pre class="wp-block-code"><code>using Microsoft.Extensions.AI;

// Create OpenAI client
var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT");
var apiKey = Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY");
var deploymentName = "gpt-4o-mini";

using var client = new AzureOpenAIClient(new Uri(endpoint), new AzureKeyCredential(apiKey))
    .GetChatClient(deploymentName)
    .AsIChatClient()
    .AsBuilder()
    .UseOpenTelemetry(sourceName: "MyAgent", configure: (cfg) =&gt; cfg.EnableSensitiveData = true)
    .Build();

var thread = client.GetNewThread();
logger.LogInformation("Agent created successfully with ID: {AgentId}", client.Id);</code></pre>



<h3 class="wp-block-heading">Explanation of the Code</h3>



<ol class="wp-block-list">
<li><strong>Environment Variables</strong>: The code begins by retrieving the Azure OpenAI endpoint and API key from environment variables. This approach ensures that sensitive information is not hard-coded into the application.</li>



<li><strong>Creating the OpenAI Client</strong>: An instance of <code>AzureOpenAIClient</code> is created using the retrieved endpoint and API key. This client is responsible for interacting with the OpenAI service.</li>



<li><strong>Using OpenTelemetry</strong>: The <code>UseOpenTelemetry</code> method is called on the chat client builder. This method configures OpenTelemetry for the agent, allowing it to emit telemetry data. The <code>sourceName</code> parameter is set to &#8220;MyAgent,&#8221; and sensitive data emission is enabled.</li>



<li><strong>Creating a New Thread</strong>: Finally, a new thread is created for the chat client, and a log message is generated to confirm the successful creation of the agent.</li>
</ol>



<p class="wp-block-paragraph">You can use OpenTelemetry on each agent, or you can instrument the model calls. To do the latter you only need to update Program.cs</p>



<pre class="wp-block-code"><code>IChatClient llm = openAIClient
    .GetChatClient(modelName)
    .AsIChatClient()
    .AsBuilder()
    .UseFunctionInvocation()
    .UseOpenTelemetry(sourceName: "BlogWriter.Agents")
    .Use(inner => new TokenCapChatClient(inner, maxTotalTokens: 10000))
    .Build();</code></pre>



<p class="wp-block-paragraph">Per agent allows you to capture which agent ran and agent-level timing. Per model call allows you to track model name, token usage, tool calls and per-round-trip latency.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Integrating OpenTelemetry with the Microsoft Agent Framework significantly enhances the observability of AI agents, providing developers with valuable insights into their performance and interactions. The built-in support for OpenTelemetry, along with semantic conventions and multi-agent system capabilities, makes it a robust choice for monitoring complex applications. </p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Agentic Table of Contents (so far)</title>
		<link>https://jesseliberty.com/2026/07/30/agentic-table-of-contents-so-far/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Thu, 30 Jul 2026 20:01:06 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Essentials]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13458</guid>

					<description><![CDATA[RAG &#8211; A quick example RAG in detail Deeper into RAG The R in RAG PEAS for Agentic AI AI Reasoning and Planning REACT and Agents in AI Creating a multi-agent system (Python &#38; LangChain/LangGraph) part 1 of 6 Migrating &#8230; <a href="https://jesseliberty.com/2026/07/30/agentic-table-of-contents-so-far/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="482" height="462" src="https://jesseliberty.com/wp-content/uploads/2026/07/agentic-logo.jpg" alt="" class="wp-image-13459" style="width:144px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/07/agentic-logo.jpg 482w, https://jesseliberty.com/wp-content/uploads/2026/07/agentic-logo-300x288.jpg 300w, https://jesseliberty.com/wp-content/uploads/2026/07/agentic-logo-150x144.jpg 150w" sizes="auto, (max-width: 482px) 100vw, 482px" /></figure>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/04/19/rag-a-quick-example/">RAG &#8211; A quick example</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/04/21/rag-in-detail/">RAG in detail</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/04/25/deeper-into-rag/">Deeper into RAG</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/04/25/deeper-into-rag/">The R in RAG</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/05/11/peas-for-agent-ai/">PEAS for Agentic AI</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/05/18/ai-reasoning-and-planning/">AI Reasoning and Planning</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/05/22/react-and-agents-in-ai/">REACT and Agents in AI</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/06/11/creating-a-multi-agent-application/">Creating a multi-agent system (Python &amp; LangChain/LangGraph) part 1 of 6</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/06/19/migrating-agentic-code-python-c-part-1/">Migrating Agentic Code Python -&gt; C# Part 1 of </a>6</p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/06/26/dependency-injection-agent-framework/">Dependency Injection &amp; Microsoft Agentic Framework</a><br /><br /><a href="https://jesseliberty.com/2026/06/28/migrating-c-microsoft-agent-framework/">Migrating C# to Microsoft Agentic Framework</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/07/07/transparency-in-agentics/">Transparency in Agentics</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/07/10/ensuring-agent-safety-in-ai-development/">Ensuring Agent Safety</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/07/21/logging-opentelemetry-in-maf/">Logging &amp; OpenTelemetry in Microsoft Agentic Framework</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/07/21/activity-source-in-microsoft-agent-framework/">Activity Source in Microsoft Agentic Framework</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/07/23/middleware-in-microsoft-agent-framework/">Middleware in Microsoft Agentic Framework</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/07/29/limit-token-usage-in-microsoft-agent-framework/">Limit token usage in Microsoft Agentic Framework</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/07/31/opentelemetry-in-microsoft-agent-framework-apps/">Using OpenTelemetry in Microsoft Agent Framework</a> </p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/08/01/langchain-vs-microsoft-agent-framework/">LangChain/LangGraph vs. Microsoft Agent Framework</a> </p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/08/05/long-term-memory-in-microsoft-agent-framework/">Long term memory in Microsoft Agent Framework</a> </p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/08/08/chatclient-middleware-vs-agent-middleware/">Agent vs ChatClient Middleware</a></p>



<p class="wp-block-paragraph"><a href="https://jesseliberty.com/2026/08/11/configuration-management-in-microsoft-agent-framework/">Configuration Management (secrets)</a></p>



<p class="wp-block-paragraph"><em>Note: many of these blog posts had initial research and drafts done by the <a href="https://github.com/JesseLiberty/blogMigration---public">Blog Writer multi-agent application </a>that serves as a demo for these articles. All were then edited by me.</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Limit token usage in Microsoft Agent Framework</title>
		<link>https://jesseliberty.com/2026/07/29/limit-token-usage-in-microsoft-agent-framework/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Wed, 29 Jul 2026 16:22:56 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[Essentials]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13452</guid>

					<description><![CDATA[In the rapidly evolving landscape of artificial intelligence, managing costs associated with API usage is a critical concern for developers. The Microsoft Agent Framework offers a powerful tool in this regard: ChatClientAgentRunOptions. This component allows developers to cap the number &#8230; <a href="https://jesseliberty.com/2026/07/29/limit-token-usage-in-microsoft-agent-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In the rapidly evolving landscape of artificial intelligence, managing costs associated with API usage is a critical concern for developers. The Microsoft Agent Framework offers a powerful tool in this regard: <strong>ChatClientAgentRunOptions</strong>. This component allows developers to cap the number of output tokens generated in a single call, ensuring that a single interaction does not exceed budgetary constraints. In this post, we will explore how <em>ChatClientAgentRunOptions</em> functions, its key features, real-world applications, and the challenges developers may face when implementing it.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="613" height="292" src="https://jesseliberty.com/wp-content/uploads/2026/07/image-7.png" alt="" class="wp-image-13456" style="aspect-ratio:2.0993738962915396;width:374px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/07/image-7.png 613w, https://jesseliberty.com/wp-content/uploads/2026/07/image-7-300x143.png 300w, https://jesseliberty.com/wp-content/uploads/2026/07/image-7-150x71.png 150w" sizes="auto, (max-width: 613px) 100vw, 613px" /></figure>



<h2 class="wp-block-heading">Overview of ChatClientAgentRunOptions</h2>



<p class="wp-block-paragraph">At its core, <strong>ChatClientAgentRunOptions</strong> is designed to manage various parameters for chat interactions within the Microsoft Agent Framework. One of its most significant features is the ability to limit the number of tokens generated in a single response through the <code>max_tokens</code> parameter. This capability is essential for controlling costs, as excessive token consumption can lead to budget overruns, especially in applications with high user engagement.</p>



<span id="more-13452"></span>



<h3 class="wp-block-heading">Key Features</h3>



<ol class="wp-block-list">
<li><strong>Token Management</strong>:  By specifying a maximum number of tokens that can be generated in a single response, developers can prevent a single interaction from consuming an excessive amount of tokens. This is particularly important in scenarios where the chat agent might otherwise generate verbose or unnecessary responses.</li>



<li><strong>Customizable Options</strong>: Beyond token management, ChatClientAgentRunOptions allows developers to fine-tune the behavior of the chat agent through various customizable options. Parameters such as <code>temperature</code>, <code>frequency_penalty</code>, and <code>presence_penalty</code> can be adjusted alongside <code>max_tokens</code> to create a more tailored user experience. For instance, a higher temperature might lead to more creative responses, while penalties can help reduce repetitive outputs.</li>



<li><strong>Integration with Metrics</strong>: The Microsoft Agent Framework provides valuable metrics on token usage, enabling developers to monitor both input and output tokens, estimated costs, and latency. This data is crucial for optimizing performance and ensuring that the application remains within budgetary limits.</li>
</ol>



<h2 class="wp-block-heading">Real-World Use Case</h2>



<p class="wp-block-paragraph">To illustrate the practical application of ChatClientAgentRunOptions, consider a developer creating a chat agent that provides weather information. By implementing a <code>max_tokens</code> limit, the developer can ensure that the agent does not generate overly verbose responses that could inflate costs. Here’s a simple example of how this might be implemented in Python:</p>



<pre class="wp-block-code"><code>from agent_framework.openai import OpenAIChatClient, OpenAIChatOptions

# Set default options at construction time
agent = OpenAIChatClient().as_agent(
    instructions="You are a helpful assistant",
    default_options={
        "temperature": 0.7,
        "max_tokens": 150  # Limit output tokens to manage costs
    }
)

result = await agent.run("What is the weather like in Amsterdam?")
print(result)</code></pre>



<p class="wp-block-paragraph">In this example, the developer has set a <code>max_tokens</code> limit of 150. This means that regardless of the complexity of the user&#8217;s query, the agent&#8217;s response will be capped at 150 tokens, effectively managing costs while still providing valuable information.</p>



<h2 class="wp-block-heading">Challenges in Token Management</h2>



<p class="wp-block-paragraph">While the capabilities of ChatClientAgentRunOptions are robust, developers must remain vigilant about token usage, particularly in applications with extensive conversation histories. Here are some challenges they may encounter:</p>



<ul class="wp-block-list">
<li><strong>Token Overuse</strong>: If developers do not actively manage token consumption, the cumulative token count can exceed budget limits. This is especially true in applications where multiple users interact with the agent simultaneously. Developers should implement strategies to monitor and control token usage effectively.</li>



<li><strong>Context Management</strong>: Maintaining relevant context in conversations without sending excessive historical data is crucial. Developers are encouraged to trim or limit the stored message history to optimize token usage. This can involve implementing strategies to summarize past interactions or selectively retaining only the most relevant messages.</li>
</ul>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">The <strong>ChatClientAgentRunOptions</strong> in the Microsoft Agent Framework provides a robust mechanism for managing output tokens, thereby helping developers control costs associated with AI interactions. By leveraging this feature, developers can create efficient and cost-effective chat applications that deliver value to users without exceeding budgetary constraints. As the demand for AI-driven solutions continues to grow, understanding and implementing effective token management strategies will be crucial for developers looking to optimize their applications and maintain financial sustainability.</p>



<p class="wp-block-paragraph">In summary, the integration of ChatClientAgentRunOptions into your development process can significantly enhance your ability to manage costs while providing a high-quality user experience. By setting appropriate limits on token usage and continuously monitoring performance metrics, developers can navigate the complexities of AI interactions with confidence.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Middleware in Microsoft Agent Framework</title>
		<link>https://jesseliberty.com/2026/07/23/middleware-in-microsoft-agent-framework/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Thu, 23 Jul 2026 17:44:32 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13441</guid>

					<description><![CDATA[A critical need, when creating multi-agent applications is to manage token usage in API calls. This is where middleware plays a crucial role. In this post, we will explore what middleware is within the Microsoft Agent Framework, why it is &#8230; <a href="https://jesseliberty.com/2026/07/23/middleware-in-microsoft-agent-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">A critical need, when creating multi-agent applications is to manage token usage in API calls. This is where middleware plays a crucial role. In this post, we will explore what middleware is within the Microsoft Agent Framework, why it is essential for capping token usage, and how to implement it effectively.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="619" height="319" src="https://jesseliberty.com/wp-content/uploads/2026/07/image-5.png" alt="" class="wp-image-13444" style="aspect-ratio:1.940484937545922;width:334px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/07/image-5.png 619w, https://jesseliberty.com/wp-content/uploads/2026/07/image-5-300x155.png 300w, https://jesseliberty.com/wp-content/uploads/2026/07/image-5-150x77.png 150w" sizes="auto, (max-width: 619px) 100vw, 619px" /></figure>



<h2 class="wp-block-heading">What is Middleware in the Microsoft Agent Framework?</h2>



<p class="wp-block-paragraph">Middleware serves as an intermediary layer that processes requests and responses between users and AI agents. It acts as a bridge, allowing developers to intercept, inspect, and modify the data flowing through the system. This capability is vital for implementing additional logic, such as validation, logging, and, importantly, token management.</p>



<p class="wp-block-paragraph">In the context of the Microsoft Agent Framework, middleware can be utilized to enhance the functionality of AI agents by providing a structured way to handle requests and responses. This not only improves the overall efficiency of the system but also allows for greater control over how the AI interacts with users.</p>



<span id="more-13441"></span>



<h2 class="wp-block-heading">Why Use Middleware?</h2>



<h3 class="wp-block-heading">1. Control Costs</h3>



<p class="wp-block-paragraph">One of the primary reasons to implement middleware for capping token usage is cost management. Many AI services, including those provided by Microsoft, charge based on the number of tokens processed during interactions. By using middleware to monitor and limit token usage, organizations can prevent unexpected spikes in expenses. This is particularly important for businesses that rely heavily on AI for customer service, content generation, or data analysis.</p>



<h3 class="wp-block-heading">2. Enhance Security</h3>



<p class="wp-block-paragraph">Security is a paramount concern when dealing with AI agents, especially in environments that handle sensitive data. Middleware can validate requests before they reach the agent, ensuring that only legitimate requests are processed. This validation step is crucial for preventing malicious attacks or unintended data exposure, thereby enhancing the overall security posture of the application.</p>



<h3 class="wp-block-heading">3. Improve Performance</h3>



<p class="wp-block-paragraph">Middleware can also play a significant role in optimizing the performance of AI agents. By intercepting and modifying requests and responses, middleware can streamline the data flow, reducing latency and improving response times. This ensures that the AI agent operates efficiently, providing users with a seamless experience.</p>



<h3 class="wp-block-heading">4. Custom Logic Implementation</h3>



<p class="wp-block-paragraph">Another advantage of middleware is the ability to implement custom logic tailored to specific business needs. For instance, organizations can modify the input or output of the AI agent based on predefined business rules or user requirements. This flexibility allows for a more personalized interaction, enhancing user satisfaction and engagement.</p>



<h2 class="wp-block-heading">Types of Middleware in the Microsoft Agent Framework</h2>



<p class="wp-block-paragraph">The Microsoft Agent Framework offers several types of middleware, each serving a unique purpose:</p>



<h3 class="wp-block-heading">1. Agent Run Middleware</h3>



<p class="wp-block-paragraph">This type of middleware intercepts all agent runs, allowing developers to inspect and modify both input and output. It is particularly useful for implementing global logic that applies to all interactions with the agent.</p>



<h3 class="wp-block-heading">2. Function Calling Middleware</h3>



<p class="wp-block-paragraph">Function calling middleware intercepts function calls made by the agent, enabling similar inspection and modification capabilities. This is beneficial for managing specific functions that may require additional validation or processing.</p>



<h3 class="wp-block-heading">3. Streaming Middleware</h3>



<p class="wp-block-paragraph">Designed specifically for handling streaming data, streaming middleware allows for real-time modifications. This is essential for applications that require continuous data flow, such as live chatbots or real-time analytics.</p>



<h2 class="wp-block-heading">Example of Middleware Implementation</h2>



<p class="wp-block-paragraph">To illustrate how middleware can be implemented to cap token usage, consider the following example in C#:</p>



<pre class="wp-block-code"><code>public class TokenUsageMiddleware
{
    private readonly RequestDelegate _next;
    private const int MAX_TOKENS = 1000; // Define your maximum token limit

    public TokenUsageMiddleware(RequestDelegate next)
    {
        _next = next;
    }

    public async Task InvokeAsync(HttpContext context)
    {
        // Inspect the incoming request
        var tokenCount = CountTokens(context.Request.Body);

        // Cap the token usage
        if (tokenCount &gt; MAX_TOKENS)
        {
            context.Response.StatusCode = StatusCodes.Status400BadRequest;
            await context.Response.WriteAsync("Token limit exceeded.");
            return;
        }

        // Call the next middleware in the pipeline
        await _next(context);
    }

    private int CountTokens(Stream requestBody)
    {
        // Logic to count tokens in the request body
        // This is a placeholder for actual token counting logic
        return 0; // Replace with actual token counting implementation
    }
}</code></pre>



<p class="wp-block-paragraph">In this example, the <code>TokenUsageMiddleware</code> class intercepts incoming requests, counts the tokens, and checks if the count exceeds a predefined limit. If the limit is exceeded, it returns a 400 Bad Request response, effectively capping token usage.</p>



<h2 class="wp-block-heading">Additional Real-World Use Cases</h2>



<h3 class="wp-block-heading">Cost Management</h3>



<p class="wp-block-paragraph">Organizations utilizing AI services, such as OpenAI&#8217;s GPT models, can implement middleware to monitor and cap token usage. This ensures that they remain within budget and avoid unexpected costs associated with excessive API calls.</p>



<h3 class="wp-block-heading">Data Validation</h3>



<p class="wp-block-paragraph">Middleware can also be employed to validate user inputs before they reach the AI agent. This prevents invalid or harmful requests from being processed, safeguarding the integrity of the system and enhancing user experience.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Middleware in the Microsoft Agent Framework is a powerful tool for managing interactions with AI agents. By implementing middleware to cap token usage, organizations can effectively control costs, enhance security, and improve performance. This makes middleware an essential component of modern AI applications, enabling businesses to leverage the full potential of AI while maintaining control over their resources.</p>



<p class="wp-block-paragraph">My blog post application code has been updated to cap token usage <a href="https://github.com/JesseLiberty/blogMigration---public">here</a>. <br /><br />The series actually begins with a Python application using LangChain, etc. We then port that to C# and from there we port it to Microsoft Agent Framework, <a href="https://jesseliberty.com/2026/06/22/migrating-agentic-code-python-c-part-6-final/">here</a>. From there, in subsequent blog posts we add features.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Activity Source in Microsoft Agent Framework</title>
		<link>https://jesseliberty.com/2026/07/21/activity-source-in-microsoft-agent-framework/</link>
		
		<dc:creator><![CDATA[Jesse Liberty]]></dc:creator>
		<pubDate>Tue, 21 Jul 2026 18:35:23 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<guid isPermaLink="false">https://jesseliberty.com/?p=13434</guid>

					<description><![CDATA[In the rapidly evolving landscape of artificial intelligence, the ability to monitor and debug multi-agent systems is paramount. The Microsoft Agent Framework (MAF) has taken a significant step forward by integrating OpenTelemetry, a powerful observability framework that enhances the monitoring &#8230; <a href="https://jesseliberty.com/2026/07/21/activity-source-in-microsoft-agent-framework/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In the rapidly evolving landscape of artificial intelligence, the ability to monitor and debug multi-agent systems is paramount. The Microsoft Agent Framework (MAF) has taken a significant step forward by integrating OpenTelemetry, a powerful observability framework that enhances the monitoring capabilities of AI agents. This post delves into the key features, innovations, and real-world applications of this integration, providing developers with the insights they need to optimize their AI systems.</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="767" height="446" src="https://jesseliberty.com/wp-content/uploads/2026/07/image-4.png" alt="" class="wp-image-13435" style="aspect-ratio:1.7197689808687282;width:359px;height:auto" srcset="https://jesseliberty.com/wp-content/uploads/2026/07/image-4.png 767w, https://jesseliberty.com/wp-content/uploads/2026/07/image-4-300x174.png 300w, https://jesseliberty.com/wp-content/uploads/2026/07/image-4-150x87.png 150w" sizes="auto, (max-width: 767px) 100vw, 767px" /></figure>



<span id="more-13434"></span>



<h2 class="wp-block-heading">Understanding the Microsoft Agent Framework and OpenTelemetry</h2>



<p class="wp-block-paragraph">The Microsoft Agent Framework is designed to facilitate the development of intelligent agents that can interact with users and other systems. With the integration of OpenTelemetry, MAF now offers a robust solution for tracking and analyzing agent behavior, performance, and interactions. OpenTelemetry is a set of APIs, libraries, and tools that enable developers to collect and export telemetry data, such as logs and metrics, from their applications. This integration allows for a more comprehensive understanding of how AI agents operate in real-world scenarios.</p>



<h3 class="wp-block-heading">Key Trends and Innovations</h3>



<h4 class="wp-block-heading">1. Unified Observability</h4>



<p class="wp-block-paragraph">One of the standout features of the MAF&#8217;s integration with OpenTelemetry is the support for OpenTelemetry conventions. This allows for a unified timeline of tasks across different agents and tools, which is crucial for understanding the interactions and performance of AI agents in production environments. By providing a coherent view of agent activities, developers can more easily identify patterns and correlations that may impact performance.</p>



<h4 class="wp-block-heading">2. Instrumentation Layer</h4>



<p class="wp-block-paragraph">The MAF includes an automatic instrumentation layer that tracks various metrics, such as token consumption, interaction durations, and tool usage. This layer is essential for diagnosing issues and optimizing agent performance. By automatically capturing these metrics, developers can focus on building and improving their agents rather than spending time on manual logging and monitoring.</p>



<h4 class="wp-block-heading">3. Integration with Azure</h4>



<p class="wp-block-paragraph">Another significant advantage of the MAF&#8217;s integration with OpenTelemetry is its ability to ship traces to Azure AI Foundry. This centralized monitoring and analysis capability allows teams to gain insights into agent behavior across different environments. By leveraging Azure&#8217;s powerful analytics tools, developers can visualize performance metrics and identify areas for improvement.</p>



<h3 class="wp-block-heading">Real-World Use Cases</h3>



<p class="wp-block-paragraph">The integration of OpenTelemetry into the Microsoft Agent Framework opens up a range of practical applications for developers:</p>



<ul class="wp-block-list">
<li><strong>Debugging and Evaluation</strong>: Developers can utilize OpenTelemetry to trace agent interactions, making it easier to identify bottlenecks or failures in real-time. This capability is invaluable for ensuring that agents perform as expected and for quickly addressing any issues that arise.</li>



<li><strong>Performance Monitoring</strong>: By tracking metrics such as latency and interaction counts, teams can optimize their agents for better user experiences. Understanding how agents perform under different conditions allows developers to make informed decisions about enhancements and adjustments.</li>
</ul>



<h3 class="wp-block-heading">Supporting Data and Quotes</h3>



<p class="wp-block-paragraph">The importance of OpenTelemetry in enhancing observability is underscored by insights from industry experts. According to a <a href="https://techcommunity.microsoft.com/blog/azure-ai-foundry-blog/observability-for-multi-agent-systems-with-microsoft-agent-framework-and-azure-a/4469090">Microsoft Tech Community blog post</a>, &#8220;OpenTelemetry for traces/spans + attributes (agent, tool, retrieval, latency, tokens)&#8221; enables detailed monitoring of agent activities. This level of granularity is essential for developers looking to improve their systems.</p>



<p class="wp-block-paragraph">As of now, the framework is in public preview (version 1.0.0-rc1), with stable OpenTelemetry contracts guiding its development. This means that developers can start experimenting with these features and provide feedback to shape the future of the framework.</p>



<h3 class="wp-block-heading">A Simple Explanation of OpenTelemetry</h3>



<p class="wp-block-paragraph">OpenTelemetry can be thought of as a toolkit that helps developers collect and export telemetry data from their applications. In the context of the Microsoft Agent Framework, it allows developers to track how their AI agents are performing, making it easier to spot issues and improve functionality. This is particularly important in complex systems where multiple agents interact with each other and with users.</p>



<h3 class="wp-block-heading">Code Example: Using OpenTelemetry with the Microsoft Agent Framework</h3>



<p class="wp-block-paragraph">To illustrate how developers can leverage OpenTelemetry within the Microsoft Agent Framework, consider the following C# code example. This snippet demonstrates how to start an activity for an agent session and log interactions using OpenTelemetry:</p>



<pre class="wp-block-code"><code>using System;
using System.Collections.Generic;
using System.Diagnostics;
using Microsoft.Extensions.Logging;

public class Agent
{
    private static readonly ActivitySource activitySource = new ActivitySource("Microsoft.Extensions.AI");

    public void StartSession(string sessionId, ILogger logger)
    {
        logger.LogInformation("Starting agent session with ID: {SessionId}", sessionId);
        using (var activity = activitySource.StartActivity("Agent Session"))
        {
            int interactionCount = 0;
            while (true)
            {
                Console.Write("You (or 'exit' to quit): ");
                var input = Console.ReadLine();
                if (string.IsNullOrWhiteSpace(input) || input.Equals("exit", StringComparison.OrdinalIgnoreCase))
                {
                    logger.LogInformation("User requested to exit the session");
                    break;
                }
                interactionCount++;
                logger.LogInformation("Processing interaction #{InteractionCount}", interactionCount);
                using (var interactionActivity = activitySource.StartActivity("Agent Interaction"))
                {
                    // Simulate processing the input
                }
            }
        }
    }
}</code></pre>



<p class="wp-block-paragraph">In this example, the <code>StartSession</code> method initiates an agent session and logs each interaction. Each interaction is tracked as a child span, allowing for detailed performance analysis. This approach not only enhances observability but also provides developers with the tools they need to optimize their agents effectively.</p>



<h3 class="wp-block-heading">Conclusion</h3>



<p class="wp-block-paragraph">The integration of OpenTelemetry into the Microsoft Agent Framework represents a significant advancement in the monitoring and debugging of AI agents. By leveraging these tools, developers can gain valuable insights into their systems, leading to improved performance and user satisfaction. </p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>