Meta's AI-Powered Efficiency: How Unified Agents Scale Performance Optimization
Meta's Capacity Efficiency program uses a unified AI agent platform to automate performance optimization at hyperscale, recovering hundreds of megawatts and cutting investigation time from hours to minutes.
Introduction: The Hyperscale Efficiency Challenge
When your services reach billions of users, even the smallest performance dip can translate into massive energy waste. At Meta, the Capacity Efficiency team has long been tasked with balancing two critical fronts: proactively finding ways to make systems run better (offense) and rapidly catching any regressions that slip through (defense). Traditional methods worked for years, but as the infrastructure grew, the bottleneck became clear — human engineering time. Manual investigation and resolution simply couldn't keep pace. Enter a unified AI agent platform that encodes decades of domain expertise into reusable, composable skills. These agents now automate both the detection and resolution of performance issues, recovering hundreds of megawatts of power and compressing hours of manual work into minutes.

Two Sides of the Same Coin: Offense and Defense
Efficiency at hyperscale is a two-sided effort. On the offensive side, engineers actively search for code changes that can make existing systems more efficient — for example, optimizing algorithms, reducing memory footprint, or streamlining data paths. On the defensive side, tools like Meta’s in-house regression detector, FBDetect, monitor production resource usage around the clock. Thousands of regressions are caught weekly, each representing a potential waste of power that would compound across the fleet if left unfixed.
Both sides are essential, but they create a new problem: the sheer volume of issues overwhelms human capacity. Without automation, engineers would spend all their time fixing problems instead of innovating on new products.
Defense: Faster Regression Resolution
FBDetect flags regressions in real time. Previously, a human engineer would need to manually investigate each one — a process that could take up to 10 hours. Now, AI agents take over the initial diagnosis. They analyze the regression, trace it to a specific pull request, and even suggest or automatically create a mitigation. What once took 10 hours now takes about 30 minutes. This speed means fewer megawatts are wasted while the regression is still active across the fleet.
Offense: Proactive Optimization at Scale
Beyond fixing regressions, the AI agents also help find new opportunities for efficiency. They comb through code and system metrics, identifying patterns that senior engineers would recognize as potential wins. Then, they automatically generate ready-to-review pull requests, complete with performance estimates. This allows the team to expand into more product areas every half without proportionally growing headcount.
The Unified AI Agent Platform
The heart of this transformation is a unified platform that combines standardized tool interfaces with encoded domain expertise. Think of it as a library of “skills” that any agent can reuse — skills like “correlate CPU spikes with recent code changes” or “calculate expected power savings from a proposed optimization.” These skills are composable, so agents can be quickly trained for new tasks without starting from scratch.

The platform provides a consistent interface across all tools, making it easy for engineers to interact with the AI and for the AI to interact with Meta’s vast infrastructure. This standardization is key to scaling — without it, each new product area would require custom integrations and handcrafted automation.
Results: Measured Impact
The numbers speak for themselves. The program has already recovered hundreds of megawatts of power — enough to power hundreds of thousands of American homes for a year. Manual investigation time has dropped from ~10 hours to ~30 minutes. And the AI agents now handle the full pipeline from opportunity identification to generating ready-to-review code changes, dramatically increasing the throughput of the team.
Future: Toward a Self-Sustaining Efficiency Engine
The ultimate goal is a self-sustaining efficiency engine. In this vision, AI handles the long tail of small optimizations and regression fixes — the thousands of tiny improvements that add up to massive power savings but would never justify human intervention individually. Engineers then focus on high-impact innovations and architectural changes.
As the platform matures, the team expects it to handle an even greater share of the work, enabling the Capacity Efficiency program to keep delivering megawatt savings without needing to grow the team proportionally. Combined with continuous learning from new data and expert feedback, the AI agents will only get smarter and more effective.
Conclusion
Meta’s AI-powered approach to capacity efficiency is a blueprint for hyperscale optimization. By unifying domain expertise into a standardized platform, the company has broken through the human bottleneck. The result is faster fixes, more proactive optimizations, and a path to a fully automated efficiency program — all while recovering enough power to make a real environmental impact. The lessons learned here are applicable to any large-scale infrastructure operation seeking to balance performance, cost, and sustainability.