{"id":53585,"date":"2026-09-02T09:00:00","date_gmt":"2026-09-02T16:00:00","guid":{"rendered":"https:\/\/azure.microsoft.com\/en-us\/blog\/?p=53585"},"modified":"2026-09-01T16:08:38","modified_gmt":"2026-09-01T23:08:38","slug":"the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents","status":"publish","type":"post","link":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/","title":{"rendered":"The Economics of Agent Optimization: Context engineering for enterprise AI agents"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><em>This blog post is the third of a four-part series called <\/em><a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/tag\/the-economics-of-agent-optimization\/\"><em>The Economics of Agent Optimization<\/em><\/a><em>, which shares the strategies, capabilities, and proof points to help you optimize agent costs and run AI as a managed investment system on Microsoft Foundry. <\/em><a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-from-pilots-to-measurable-returns\/\"><em>The first post<\/em><\/a> <em>set out the three decisions that systems rest on. <\/em><a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-four-ways-to-lower-the-cost\/\"><em>The second post<\/em><\/a><em> took the request at runtime. This post takes the next one: making each agent cheaper over time as it learns what works.<\/em><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Every agent has a mechanism that determines what its model sees on each turn. In many production systems, that choice was set during prototyping and never revisited, even though it often drives the largest share of operating cost and contributes to disappointing answers.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is also the part of an agent that can improve on its own. The model remains as capable as when you selected it, and instructions change only when someone rewrites them. But what an agent knows, can access, and remembers, grows as it runs\u2014making it the key to improving performance while lowering cost over time. Managing that process is called context engineering. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-the-context-window-sets-what-an-agent-costs\">Why the context window sets what an agent costs<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  A model has no memory of its own. On each turn, its context window supplies everything it can use: instructions, available tools, retrieved documents, and conversation history. When the turn ends, that context disappears and must be sent again on the next one.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That cost is manageable for a chatbot answering one question. For an agent working across many turns toward one outcome, it is often the largest expense. Because the context window is paid for every turn, unnecessary content is billed repeatedly. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The less visible cost is quality. More context does not guarantee better answers: a relevant fact buried in 40 pages is harder to use, and a long tool list makes the wrong choice more likely. Each mistake adds more turns\u2014and more cost\u2014to recover.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That makes context worth a leader\u2019s attention. Most cost reductions involve a tradeoff: a cheaper model may reduce quality, and shorter instructions may weaken an answer. By contrast, removing unnecessary context can lower costs without reducing quality, making it an easier optimization for teams to support. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what-context-engineering-means-in-practice\">What context engineering means in practice<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  That is what context engineering does: it decides what enters the context window on each turn, so the agent gets what this request needs rather than everything it might ever need. As a one-time choice, it is a design decision. Practiced continuously, it is how an agent improves, because every turn reveals what it actually used. Four questions cover the work, and teams usually take them in this order.\n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-should-the-agent-know\">What should the agent know?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Many teams begin with broad searches that insert entire documents into the prompt. This approach is easy to build but costly to run, and it forces the model to find the one relevant detail amid everything else.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/concepts\/what-is-foundry-iq\" target=\"_blank\" rel=\"noopener noreferrer\">Foundry IQ<\/a> replaces that with a managed knowledge layer. A knowledge base points at sources across <a href=\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/work-iq\" target=\"_blank\" rel=\"noopener noreferrer\">Work IQ<\/a>, <a href=\"https:\/\/www.microsoft.com\/en-us\/microsoft-fabric\/features\/iq\" target=\"_blank\" rel=\"noopener noreferrer\">Fabric IQ<\/a>, <a href=\"https:\/\/www.microsoft.com\/en-us\/webiq\" target=\"_blank\" rel=\"noopener noreferrer\">Web IQ<\/a>, <a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/storage\/blobs\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Azure Blob Storage<\/a>, <a href=\"https:\/\/www.microsoft.com\/en-us\/microsoft-365\/sharepoint\/collaboration\" target=\"_blank\" rel=\"noopener noreferrer\">SharePoint<\/a>, <a href=\"https:\/\/www.microsoft.com\/en-us\/microsoft-fabric\/features\/onelake\" target=\"_blank\" rel=\"noopener noreferrer\">OneLake<\/a>, and <a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/azure-sql\" target=\"_blank\" rel=\"noopener noreferrer\">Azure SQL<\/a>. When an agent submits a query, Foundry IQ decomposes it into subqueries, searches connected sources in parallel, semantically reranks the results, and returns grounded passages with citations. This narrows what enters the model\u2019s context to the most relevant evidence while preserving traceability to the source.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two features make this knowledge layer reusable across agents and governable at scale. A single knowledge base can serve multiple agents. Indexed sources can refresh incrementally on a configured indexer schedule, while remote sources are queried on demand. At query time, <a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/ai-foundry\/iq\" target=\"_blank\" rel=\"noopener noreferrer\">Foundry IQ<\/a> can run under the caller\u2019s <a href=\"https:\/\/www.microsoft.com\/en-us\/security\/business\/microsoft-entra\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Entra<\/a> identity, synchronize access-control lists for supported sources, and honor <a href=\"https:\/\/www.microsoft.com\/en-us\/security\/business\/microsoft-purview\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Purview<\/a> sensitivity labels, so the agent retrieves only content the caller is authorized to access. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/techcommunity.microsoft.com\/blog\/azure-ai-foundry-blog\/foundry-iq-improve-recall-by-up-to-54-with-knowledge-bases\/4524852\" target=\"_blank\" rel=\"noreferrer noopener\">Our internal evaluations<\/a> showed that Foundry IQ knowledge bases improved evidence recall by up to 54% on the BrowseComp-Plus benchmark while reducing retrieval token costs by 34%. The gains came from agentic retrieval, semantic reranking, improved answer synthesis, and more efficient token use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-should-the-agent-be-able-to-reach\">What should the agent be able to reach?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tool overhead is easy to miss: adding one may take a single line of code, but its full description occupies the prompt. Every tool attached to an agent has that description sent to the model on every turn, needed or not, and enterprise agents pick up tools quickly as they connect to more systems.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/how-to\/tools\/toolbox\" target=\"_blank\" rel=\"noreferrer noopener\">Toolboxes in Foundry<\/a> give an agent one managed Model Context Protocol (MCP) endpoint for built-in tools like web search, code interpreter, and file search alongside custom MCP servers, OpenAPI 3.0 and 3.1 APIs, and A2A agents. Foundry manages authentication, access policies, and tool versions in one place, rather than configuring each integration separately for every agent. Once a new toolbox version is tested and promoted, connected agents can use it without code changes or redeployment. <\/p>\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/image-2.webp\" alt=\"U I when creating a toolbox in Foundry.\" class=\"wp-image-53666 webp-format\" srcset=\"\" data-orig-src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/image-2.webp\"><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Toolboxes organize your tools. The <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/how-to\/tools\/tool-search\">tool search capability<\/a> inside Toolbox is what stops you paying for all of them. Instead of the full list, the model gets two things: a way to describe what it needs in plain language, and a way to call whatever comes back. The cost of the tool list stays flat, however large the toolbox grows. In internal benchmarking against a public, open-source tool-retrieval dataset, Toolboxes in Foundry reduced average input-token consumption around 97% for large tool libraries\u2014directly lowering inference costs for customers building agents.<sup>1<\/sup><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Foundry also notices which tools each toolbox uses most and puts those within easy reach, so the common path gets faster and cheaper the longer the agent runs. Accuracy improves alongside cost, because a short, well-matched list means fewer wrong calls and fewer turns spent recovering. \n<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-should-the-agent-do-the-work\">How should the agent do the work?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Knowledge and tools cover what an agent can find and do. Neither covers how your company expects the work to be done: the escalation path a support agent follows; the checklist a code review applies. That guidance usually lives in the agent&#8217;s instructions. As a result, the same procedures may be copied across multiple agents and included in every request, even when they are not relevant.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A skill turns that guidance into a named, reusable procedure. <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/how-to\/tools\/skills\">Skills<\/a> are stored centrally in Foundry and made available to agents through a toolbox. Instead of embedding a copy of the procedure in each agent, the toolbox references the centrally managed skill. When your organization improves a procedure, you can publish a new version and set it as the default. Every agent using that skill can then follow the updated procedure without code changes or redeployment. To minimize context usage, the agent initially sees only each skill\u2019s name and short description. It loads the full instructions only when the skill is relevant. This makes it practical to offer a large library of detailed procedures without adding unnecessary content to every interaction.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"what-should-the-agent-remember\">What should the agent remember?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Agents need continuity, but they do not need to carry every detail from every interaction. Repeatedly sending an entire conversation to the model adds cost and consumes context, even when only a few details remain useful.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/how-to\/memory-usage\">Memory in Foundry Agent Service<\/a> helps agents retain important context without replaying entire conversations. It supports three types of memory: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\"><strong>Session memory<\/strong> for the current conversation.<\/li>\n\n\n\n<li class=\"wp-block-list-item\"><strong>User memory<\/strong> for preferences and facts that persist across sessions.<\/li>\n\n\n\n<li class=\"wp-block-list-item\"><strong>Procedural memory<\/strong> for learned workflows and task execution patterns.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This allows a returning customer to pick up where they left off, while enabling an agent to consistently follow proven processes without being re-instructed each time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Together, these capabilities help an agent continue a customer interaction, personalize future responses, and improve how reliably it completes recurring tasks. Procedural memory complements centrally managed skills: a skill defines the organization\u2019s approved procedure, while procedural memory helps an agent learn from its own task execution. In\u202f<a href=\"https:\/\/devblogs.microsoft.com\/foundry\/memory-build2026\/\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft\u2019s evaluations<\/a>, enabling procedural memory produced about a 5% improvement on STATE-Bench and Tau-Bench. Organizations can also control memory through user-level isolation, retention settings, and time-to-live policies that determine what is stored and when it expires. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"why-context-engineering-becomes-a-system\">Why context engineering becomes a system<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  Any team can assemble knowledge retrieval, tools, procedural guidance, and memory. The challenge is making them work together, under one set of permissions, and keeping them current as the organization changes.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Foundry brings these pieces into a single system. Knowledge, tools, skills, and memory can be managed through shared infrastructure rather than separate products, while permissions are enforced where data is retrieved, so agents inherit the access controls already applied to enterprise content. <a href=\"https:\/\/azure.microsoft.com\/en-us\/products\/ai-foundry\/iq\" target=\"_blank\" rel=\"noopener noreferrer\">Foundry IQ<\/a> extends that model across enterprise knowledge, business data, and organizational context, while remaining compatible with frameworks such as <a href=\"https:\/\/learn.microsoft.com\/en-us\/agent-framework\/overview\/?pivots=programming-language-csharp\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Agent Framework<\/a>, LangGraph, GitHub Copilot SDK, and Claude Agent SDK. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  The result is that context improves without requiring agents to be rebuilt. Knowledge bases refresh as source systems change. Skills evolve as policies evolve. Memory accumulates what matters about users and successful workflows. Tool search adapts to the capabilities people actually use. <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/concepts\/agent-optimizer-overview\">Agent optimizer in Foundry Agent Service<\/a> then closes the loop by analyzing agent behavior and generating improved instructions, skills, tool descriptions, and model configurations.\n<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\n  That is the larger goal of context engineering: not simply reducing prompt size or retrieval costs, but creating agents that improve with use. When the knowledge they draw from, the tools they discover, the procedures they follow, and the memories they retain all become better over time, an agent can become both more capable and more efficient without starting over.\n<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"get-started\">Get started<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\n  If you&#8217;re building agents today, start by examining what enters the context window on every turn. Look at the documents being retrieved, the tools being exposed, the instructions being repeated, and the conversation history being carried forward. In many cases, improving those inputs has a larger impact on cost and quality than changing models.\n<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\">Ground an agent in enterprise data with Foundry IQ: <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/how-to\/foundry-iq-connect\">Connect a Foundry IQ knowledge base to an agent<\/a>.  <\/li>\n\n\n\n<li class=\"wp-block-list-item\">Give an agent one endpoint for its tools, and turn on tool search: <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/how-to\/tools\/tool-search\">Enable tool search in a toolbox<\/a>.  <\/li>\n\n\n\n<li class=\"wp-block-list-item\">Add memory so an agent carries context across sessions: <a href=\"https:\/\/learn.microsoft.com\/en-us\/azure\/foundry\/agents\/how-to\/memory-usage\">Create and use memory in Foundry Agent Service<\/a>.  <\/li>\n\n\n\n<li class=\"wp-block-list-item\">Start building in <a href=\"https:\/\/ai.azure.com\" target=\"_blank\" rel=\"noopener noreferrer\">Microsoft Foundry<\/a>.<\/li>\n<\/ul>\n\n\n\n<div class=\"is-style-inline wp-block-bloginabox-theme-promotional\">\n\t\n<div class=\"promotional promotional--has-media promotional--media-right\">\n\t<div class=\"promotional__wrapper\">\n\t\t<div class=\"promotional__content-wrapper\">\n\t\t\t<div class=\"promotional__content\">\n\t\t\t\t\n\n<h2 class=\"wp-block-heading\" id=\"microsoft-foundry\">Microsoft Foundry<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The enterprise AI platform to build, ground, and govern AI apps and agents at scale<\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a data-bi-an=\"Global CTA\" data-bi-ct=\"cta link\" data-bi-id=\"cta-block\" class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/ai.azure.com\/home\" target=\"_blank\" rel=\"noopener noreferrer\">Explore capabilities<\/a><\/div>\n<\/div>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<div class=\"promotional__media-wrapper\">\n\t\t\t\t<div class=\"promotional__media\">\n\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" width=\"2560\" height=\"1810\" src=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/06\/CLO24-Azure-Retail-020-1-scaled.jpg\" class=\"attachment-full size-full\" alt=\"Person sitting at a desk with headphones around their neck working on a computer.\" loading=\"lazy\" srcset=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/06\/CLO24-Azure-Retail-020-1-scaled.jpg 2560w, https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/06\/CLO24-Azure-Retail-020-1-300x212.jpg 300w, https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/06\/CLO24-Azure-Retail-020-1-1024x724.jpg 1024w, https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/06\/CLO24-Azure-Retail-020-1-768x543.jpg 768w, https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/06\/CLO24-Azure-Retail-020-1-1536x1086.jpg 1536w, https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/06\/CLO24-Azure-Retail-020-1-2048x1448.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/>\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t<\/div>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Did you miss these posts in <\/strong><a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/tag\/the-economics-of-agent-optimization\/\" rel=\"noreferrer noopener\" target=\"_blank\"><strong>The Economics of Agent Optimization series<\/strong><\/a><strong>?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li class=\"wp-block-list-item\"><a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-from-pilots-to-measurable-returns\/\" target=\"_blank\" rel=\"noreferrer noopener\">AI cost management: From AI pilots to measurable ROI<\/a><\/li>\n\n\n\n<li class=\"wp-block-list-item\"><a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-four-ways-to-lower-the-cost\/\" target=\"_blank\" rel=\"noopener noreferrer\">AI cost optimization: How to lower AI spend<\/a><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<p class=\"wp-block-paragraph\"><sup>1<\/sup> <a href=\"https:\/\/commandline.microsoft.com\/tool-search-toolboxes-foundry\/\" target=\"_blank\" rel=\"noopener noreferrer\">Command Line, Tool search: Finding the right tool at the right time, July 29, 2026<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI cost optimization goes beyond model selection. Discover how context engineering in Microsoft Foundry helps lower AI costs by improving knowledge retrieval, tool selection, memory, and agent performance at scale.<\/p>\n","protected":false},"author":42,"featured_media":53591,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","_alt_title":"","ms-ems-related-posts":[53414,53086],"footnotes":"","azure_community_cta_settings":[]},"categories":[1454,1474,1482],"tags":[3424],"audience":[3055,3053],"content-type":[1481],"product":[3239,3164,1796],"tech-community":[],"coauthors":[3430],"class_list":["post-53585","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-machine-learning","category-analytics","category-management-and-governance","tag-the-economics-of-agent-optimization","audience-developers","audience-it-decision-makers","content-type-thought-leadership","product-foundry-agent-service","product-microsoft-foundry","product-microsoft-purview","review-flag-1-1680286581-825","review-flag-3-1680286581-173","review-flag-5-1680286581-950","review-flag-microsofts","review-flag-never-1680286580-606","review-flag-new-1680286579-546"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AI agent optimization: How context engineering lowers AI costs | Microsoft Azure Blog<\/title>\n<meta name=\"description\" content=\"Discover how Microsoft Foundry helps optimize AI agents with context engineering, reducing token costs while improving quality, memory, and more.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AI agent optimization: How context engineering lowers AI costs | Microsoft Azure Blog\" \/>\n<meta property=\"og:description\" content=\"Discover how Microsoft Foundry helps optimize AI agents with context engineering, reducing token costs while improving quality, memory, and more.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft Azure Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/microsoftazure\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-02T16:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/Foundry-Economics-Series_3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jeff Hollan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@azure\" \/>\n<meta name=\"twitter:site\" content=\"@azure\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Hollan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/\"},\"author\":[{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/author\\\/jeff-hollan\\\/\",\"@type\":\"Person\",\"@name\":\"Jeff Hollan\"}],\"headline\":\"The Economics of Agent Optimization: Context engineering for enterprise AI agents\",\"datePublished\":\"2026-09-02T16:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/\"},\"wordCount\":1766,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Foundry-Economics-Series_3.jpg\",\"keywords\":[\"The Economics of Agent Optimization\"],\"articleSection\":[\"AI + machine learning\",\"Analytics\",\"Management and governance\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/\",\"name\":\"AI agent optimization: How context engineering lowers AI costs | Microsoft Azure Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Foundry-Economics-Series_3.jpg\",\"datePublished\":\"2026-09-02T16:00:00+00:00\",\"description\":\"Discover how Microsoft Foundry helps optimize AI agents with context engineering, reducing token costs while improving quality, memory, and more.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#primaryimage\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Foundry-Economics-Series_3.jpg\",\"contentUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/Foundry-Economics-Series_3.jpg\",\"width\":1920,\"height\":1080,\"caption\":\"Person in the background with text reading \\\"Microsoft Foundry. Build agents and optimize workflows. The economics of agent optimization\\\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog home\",\"item\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AI + machine learning\",\"item\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/category\\\/ai-machine-learning\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"The Economics of Agent Optimization: Context engineering for enterprise AI agents\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/\",\"name\":\"Microsoft Azure Blog\",\"description\":\"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.\",\"publisher\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#organization\",\"name\":\"Microsoft Azure Blog\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/microsoft_logo.webp\",\"contentUrl\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/06\\\/microsoft_logo.webp\",\"width\":512,\"height\":512,\"caption\":\"Microsoft Azure Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/microsoftazure\",\"https:\\\/\\\/x.com\\\/azure\",\"https:\\\/\\\/www.instagram.com\\\/microsoftdeveloper\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/16188386\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/windowsazure\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/#\\\/schema\\\/person\\\/d4f509f08165350bd886db626e0f875d\",\"name\":\"Kristin Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/38b96ac4ee66ea757c68dce07759462f843dbf6ac655175a8a5c93464fbc0e86?s=96&d=mm&r=gc17a8d4a6f500f25f2f520496348542a\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/38b96ac4ee66ea757c68dce07759462f843dbf6ac655175a8a5c93464fbc0e86?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/38b96ac4ee66ea757c68dce07759462f843dbf6ac655175a8a5c93464fbc0e86?s=96&d=mm&r=g\",\"caption\":\"Kristin Gallagher\"},\"url\":\"https:\\\/\\\/azure.microsoft.com\\\/en-us\\\/blog\\\/author\\\/kristingallagher\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AI agent optimization: How context engineering lowers AI costs | Microsoft Azure Blog","description":"Discover how Microsoft Foundry helps optimize AI agents with context engineering, reducing token costs while improving quality, memory, and more.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/","og_locale":"en_US","og_type":"article","og_title":"AI agent optimization: How context engineering lowers AI costs | Microsoft Azure Blog","og_description":"Discover how Microsoft Foundry helps optimize AI agents with context engineering, reducing token costs while improving quality, memory, and more.","og_url":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/","og_site_name":"Microsoft Azure Blog","article_publisher":"https:\/\/www.facebook.com\/microsoftazure","article_published_time":"2026-09-02T16:00:00+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/Foundry-Economics-Series_3.jpg","type":"image\/jpeg"}],"author":"Jeff Hollan","twitter_card":"summary_large_image","twitter_creator":"@azure","twitter_site":"@azure","twitter_misc":{"Written by":"Jeff Hollan","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#article","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/"},"author":[{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/jeff-hollan\/","@type":"Person","@name":"Jeff Hollan"}],"headline":"The Economics of Agent Optimization: Context engineering for enterprise AI agents","datePublished":"2026-09-02T16:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/"},"wordCount":1766,"commentCount":0,"publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/Foundry-Economics-Series_3.jpg","keywords":["The Economics of Agent Optimization"],"articleSection":["AI + machine learning","Analytics","Management and governance"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/","name":"AI agent optimization: How context engineering lowers AI costs | Microsoft Azure Blog","isPartOf":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#primaryimage"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#primaryimage"},"thumbnailUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/Foundry-Economics-Series_3.jpg","datePublished":"2026-09-02T16:00:00+00:00","description":"Discover how Microsoft Foundry helps optimize AI agents with context engineering, reducing token costs while improving quality, memory, and more.","breadcrumb":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#primaryimage","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/Foundry-Economics-Series_3.jpg","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2026\/09\/Foundry-Economics-Series_3.jpg","width":1920,"height":1080,"caption":"Person in the background with text reading \"Microsoft Foundry. Build agents and optimize workflows. The economics of agent optimization\""},{"@type":"BreadcrumbList","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/the-economics-of-agent-optimization-context-engineering-for-enterprise-ai-agents\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog home","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/"},{"@type":"ListItem","position":2,"name":"AI + machine learning","item":"https:\/\/azure.microsoft.com\/en-us\/blog\/category\/ai-machine-learning\/"},{"@type":"ListItem","position":3,"name":"The Economics of Agent Optimization: Context engineering for enterprise AI agents"}]},{"@type":"WebSite","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#website","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","name":"Microsoft Azure Blog","description":"Get the latest Azure news, updates, and announcements from the Azure blog. From product updates to hot topics, hear from the Azure experts.","publisher":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/azure.microsoft.com\/en-us\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#organization","name":"Microsoft Azure Blog","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","contentUrl":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-content\/uploads\/2024\/06\/microsoft_logo.webp","width":512,"height":512,"caption":"Microsoft Azure Blog"},"image":{"@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/microsoftazure","https:\/\/x.com\/azure","https:\/\/www.instagram.com\/microsoftdeveloper\/","https:\/\/www.linkedin.com\/company\/16188386","https:\/\/www.youtube.com\/user\/windowsazure"]},{"@type":"Person","@id":"https:\/\/azure.microsoft.com\/en-us\/blog\/#\/schema\/person\/d4f509f08165350bd886db626e0f875d","name":"Kristin Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/38b96ac4ee66ea757c68dce07759462f843dbf6ac655175a8a5c93464fbc0e86?s=96&d=mm&r=gc17a8d4a6f500f25f2f520496348542a","url":"https:\/\/secure.gravatar.com\/avatar\/38b96ac4ee66ea757c68dce07759462f843dbf6ac655175a8a5c93464fbc0e86?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/38b96ac4ee66ea757c68dce07759462f843dbf6ac655175a8a5c93464fbc0e86?s=96&d=mm&r=g","caption":"Kristin Gallagher"},"url":"https:\/\/azure.microsoft.com\/en-us\/blog\/author\/kristingallagher\/"}]}},"bloginabox_animated_featured_image":null,"bloginabox_display_generated_audio":true,"distributor_meta":false,"distributor_terms":false,"distributor_media":false,"distributor_original_site_name":"Microsoft Azure Blog","distributor_original_site_url":"https:\/\/azure.microsoft.com\/en-us\/blog","push-errors":false,"_links":{"self":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/53585","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/users\/42"}],"replies":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/comments?post=53585"}],"version-history":[{"count":23,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/53585\/revisions"}],"predecessor-version":[{"id":53694,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/posts\/53585\/revisions\/53694"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/media\/53591"}],"wp:attachment":[{"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/media?parent=53585"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/categories?post=53585"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tags?post=53585"},{"taxonomy":"audience","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/audience?post=53585"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/content-type?post=53585"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/product?post=53585"},{"taxonomy":"tech-community","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/tech-community?post=53585"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/azure.microsoft.com\/en-us\/blog\/wp-json\/wp\/v2\/coauthors?post=53585"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}